[Mlir-commits] [mlir] [mlir] Add use-vector-alignment flag to ConvertVectorToLLVMPass (PR #137389)

Krzysztof Drewniak llvmlistbot at llvm.org
Thu May 1 16:02:26 PDT 2025


================
@@ -0,0 +1,144 @@
+// RUN: mlir-opt %s --convert-vector-to-llvm='use-vector-alignment=0' --split-input-file | FileCheck %s --check-prefix=MEMREF-ALIGN
+// RUN: mlir-opt %s --convert-vector-to-llvm='use-vector-alignment=1' --split-input-file | FileCheck %s --check-prefix=VEC-ALIGN
----------------
krzysz00 wrote:

Yeah - in some future point we should have a MLIR data layout <=> LLVM data layout translation that'll make everything work nicely.

I think you'll get what you want by changing the `options(context)` to
```
    LowerToLLVMOptions options(
        ctx, DataLayout(cast<DataLayoutOpInterface>(m.getOperation())));
```

That'll let you pick things up from an MLIR DLTI, though I don't think that supports vector alignments yet

https://github.com/llvm/llvm-project/pull/137389


More information about the Mlir-commits mailing list