Standard types not converted to LLVM

Can someone explain why the types are not being converted to the LLVM ones?

// Before
module  {
  func @main() -> i32 {
    %c57_i32 = constant 57 : i32
    return %c57_i32 : i32

// After
module  {
  llvm.func @main() -> i32 {
    %0 = llvm.mlir.constant(57 : i32) : i32
    llvm.return %0 : i32

My pass is the following (nothing different from the Toy example one):

void MyDialectToLLVMLoweringPass::runOnOperation()
    auto module = getOperation();

    mlir::ConversionTarget target(getContext());
    target.addLegalOp<mlir::ModuleOp, mlir::ModuleTerminatorOp>();

    mlir::LLVMTypeConverter typeConverter(&getContext());

    mlir::OwningRewritePatternList patterns;
    populateStdToLLVMConversionPatterns(typeConverter, patterns);

    if (failed(applyFullConversion(module, target, std::move(patterns))))
        mlir::emitError(module.getLoc(), "Error in converting to LLVM dialect\n");

If I try to convert the module to LLVM IR I also get:

error: unsupported or non-LLVM operation: llvm.mlir.constant

Code used for the conversion (again, nothing strange to my eyes):

llvm::LLVMContext llvmContext;
auto llvmModule = mlir::translateModuleToLLVMIR(module, llvmContext);
llvmModule->print(llvm::errs(), nullptr);

LLVM dialect no longer has types that duplicate built-in types. Instead, the ops understand built-in types. PSA: LLVM dialect types are now based on built-in types

This is a different change I landed over the past week: translation to LLVM IR is now extensible to different dialects and therefore requires the dialect to have an interface that implements the translation, and to register it on the dialect or on the context. You need to call mlir::registerLLVMDialectTranslation(*module->getContext()) before calling into the translation, or register it in DialectRegistry before constructing the main context.

Got it, thanks Alex!