Override the type converter configuration (a pass option by conversion passes)

Hello.
At LLVM IR Target - MLIR it is written that: “Index type is converted into an LLVM dialect integer type with the bitwidth specified by the [data layout] (Data Layout Modeling - MLIR) of the closest module. For example, on x86-64 CPUs it converts to i64. This behavior can be overridden by the type converter configuration, which is often exposed as a pass option by conversion passes.”

Could you please tell me how can I override the type converter configuration (a pass option by conversion passes).

Thank you very much,
Alex

The way it is exposed in a pass depends on the pass…

The easiest way is to set the data layout to something like #dlti.dl_spec<#dlti.dl_entry<index,32:i32>> that the type converter should respect.

Hello.
I’ve programatically changed the type converter configuration by making these calls in my MLIR conversion pass:
mlir::LowerToLLVMOptions options(&ctx);
options.overrideIndexBitwidth(32); // make the Index type 32-bits
mlir::LLVMTypeConverter typeConverter(&ctx, options);
Thank you very much,
Alex