Closed Colloportus0 closed 1 year ago
@llvm/issue-subscribers-mlir
Here is the IR post running the pass:
"llvm.func"() ({
^bb0(%arg0: !llvm.ptr<f32>, %arg1: !llvm.ptr<f32>, %arg2: i64, %arg3: i64, %arg4: i64, %arg5: i64, %arg6: i64, %arg7: i64):
%0 = "builtin.unrealized_conversion_cast"(%arg7) : (i64) -> index
%1 = "llvm.mlir.undef"() : () -> !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>
%2 = "llvm.insertvalue"(%1, %arg0) {position = array<i64: 0>} : (!llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>, !llvm.ptr<f32>) -> !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>
%3 = "llvm.insertvalue"(%2, %arg1) {position = array<i64: 1>} : (!llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>, !llvm.ptr<f32>) -> !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>
%4 = "llvm.insertvalue"(%3, %arg2) {position = array<i64: 2>} : (!llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>, i64) -> !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>
%5 = "llvm.insertvalue"(%4, %arg3) {position = array<i64: 3, 0>} : (!llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>, i64) -> !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>
%6 = "llvm.insertvalue"(%5, %arg5) {position = array<i64: 4, 0>} : (!llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>, i64) -> !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>
%7 = "llvm.insertvalue"(%6, %arg4) {position = array<i64: 3, 1>} : (!llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>, i64) -> !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>
%8 = "llvm.insertvalue"(%7, %arg6) {position = array<i64: 4, 1>} : (!llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>, i64) -> !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>
%9 = "builtin.unrealized_conversion_cast"(%8) : (!llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2 x i64>, array<2 x i64>)>) -> memref<?x?xf32>
%10 = "memref.dim"(%9, %0) : (memref<?x?xf32>, index) -> index
"affine.for"(%10) ({
^bb0(%arg8: index):
"affine.yield"() : () -> ()
}) {lower_bound = affine_map<() -> (0)>, step = 1 : index, upper_bound = affine_map<()[s0] -> (s0)>} : (index) -> ()
"llvm.return"() : () -> ()
}) {CConv = #llvm.cconv<ccc>, function_type = !llvm.func<void (ptr<f32>, ptr<f32>, i64, i64, i64, i64, i64, i64)>, linkage = #llvm.linkage<external>, sym_name = "func"} : () -> ()
This is then a verifier crash for mlir::isValidSymbol
.
@bondhugula or @ftynse may be able to help here?
I believe the assertion is incorrect there and was not updated when we changed memref.dim
to take the dimension index as an operand instead of an attribute. https://reviews.llvm.org/D142204
@llvm/issue-subscribers-mlir-affine
MLIR built at commit https://github.com/llvm/llvm-project/commit/a0138390 Reproduced with:
mlir-opt --convert-func-to-llvm temp.mlir
temp.mlir
:trace: