Since the recent MemRef refactoring that centralizes the lowering of complex MemRef operations outside of the conversion framework, the MemRefToLLVM pass doesn't directly convert these complex operations. Instead, to fully convert the whole MemRef dialect space, MemRefToLLVM needs to run after `expand-strided-metadata`. Make this more obvious by changing the name of the pass and the option associated with it from `convert-memref-to-llvm` to `finalize-memref-to-llvm`. The word "finalize" conveys that this pass needs to run after something else and that something else is documented in its tablegen description. This is a follow-up patch related to the conversation at: https://discourse.llvm.org/t/psa-you-need-to-run-expand-strided-metadata-before-memref-to-llvm-now/66956/14 Differential Revision: https://reviews.llvm.org/D142463
17 lines
609 B
MLIR
17 lines
609 B
MLIR
// RUN: mlir-opt %s --finalize-memref-to-llvm | \
|
|
// RUN: mlir-cpu-runner -e entry -entry-point-result=void
|
|
|
|
//
|
|
// Code should not crash on the complex32 sparse constant.
|
|
//
|
|
module attributes {llvm.data_layout = ""} {
|
|
memref.global "private" constant @"__constant_32xcomplex<f32>_0" : memref<32xcomplex<f32>> =
|
|
sparse<[[1], [28], [31]],
|
|
[(1.000000e+00,0.000000e+00), (2.000000e+00,0.000000e+00), (3.000000e+00,0.000000e+00)]
|
|
> {alignment = 128 : i64}
|
|
llvm.func @entry() {
|
|
%0 = memref.get_global @"__constant_32xcomplex<f32>_0" : memref<32xcomplex<f32>>
|
|
llvm.return
|
|
}
|
|
}
|