| Issue |
178228
|
| Summary |
mlir-opt crashes on tensor.collapse_shape with unranked tensor
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
mlirBug
|
mlir-opt version: 22.1.0-rc1
mlir-opt crashes with an assertion failure when running on a `tensor.collapse_shape` operation applied to an unranked or pointer-like tensor. The pass internally casts the operand to a RankedTensorType, which fails, causing a hard abort.
```
mlir-opt test.mlir
```
```
module {
func.func @main() {
%0 = index.sizeof
%1 = pdl.type : index
%2 = tensor.generate %0 {
^bb0(%arg0: index):
%3 = arith.index_cast %arg0 : index to i32
%4 = arith.sitofp %3 : i32 to f32
tensor.yield %4 : f32
} : tensor<?xf32>
%5 = tensor.cast %2 : tensor<?xf32> to tensor<*xf32>
%6 = math.ceil %5 : tensor<*xf32>
%7 = tensor.collapse_shape %6 [] : tensor<*xf32> into tensor<f32>
return
}
}
```
```
mlir-opt: llvm-project-llvmorg-22.1.0-rc1/llvm/include/llvm/Support/Casting.h:560: decltype(auto) llvm::cast(const From&) [with To = mlir::RankedTensorType; From = mlir::TensorType]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: llvmorg-22.1.0-install/bin/mlir-opt test.mlir
#0 0x000055c8350cde32 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (llvmorg-22.1.0-install/bin/mlir-opt+0x252fe32)
#1 0x000055c8350ca5af llvm::sys::RunSignalHandlers() (llvmorg-22.1.0-install/bin/mlir-opt+0x252c5af)
#2 0x000055c8350ca6fc SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007a908f645330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x00007a908f69eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x00007a908f69eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x00007a908f69eb2c pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x00007a908f64527e raise ./signal/../sysdeps/posix/raise.c:27:6
#8 0x00007a908f6288ff abort ./stdlib/abort.c:81:7
#9 0x00007a908f62881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007a908f63b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs