| Issue |
178205
|
| Summary |
mlir-opt --bufferization-lower-deallocations crashes in DenseElementsAttr::reshape
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
mlirBug
|
mlir-opt version: 22.1.0-rc1
The crash is triggered while processing a **tensor.collapse_shape** operation, which leads to a call to DenseElementsAttr::reshape with a mismatched number of elements, causing a hard assertion failure.
```
module {
func.func @main() {
%0 = smt.forall ["a", "b", "c"] {
^bb0(%arg0: !smt.int, %arg1: !smt.int, %arg2: !smt.int):
%1 = smt.eq %arg0, %arg1 : !smt.int
%2 = smt.eq %arg1, %arg2 : !smt.int
%3 = smt.and %1, %2
smt.yield %3 : !smt.bool
}
%4 = shape.const_shape [1, 2, 3] : tensor<3xindex>
smt.solver(%4) : (tensor<3xindex>) -> () {
^bb0(%arg0: tensor<3xindex>):
smt.yield
}
%5 = tensor.collapse_shape %4 [] : tensor<3xindex> into tensor<index>
return
}
}
```
```
mlir-opt --bufferization-lower-deallocations test.mlir
```
```
mlir-opt: llvm-project-llvmorg-22.1.0-rc1/mlir/lib/IR/BuiltinAttributes.cpp:1246: mlir::DenseElementsAttr mlir::DenseElementsAttr::reshape(mlir::ShapedType): Assertion `newType.getNumElements() == curType.getNumElements() && "expected the same number of elements"' 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 --bufferization-lower-deallocations test.mlir
#0 0x000063d7c7445e32 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (llvmorg-22.1.0-install/bin/mlir-opt+0x252fe32)
#1 0x000063d7c74425af llvm::sys::RunSignalHandlers() (llvmorg-22.1.0-install/bin/mlir-opt+0x252c5af)
#2 0x000063d7c74426fc SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x0000742a0fe45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x0000742a0fe9eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x0000742a0fe9eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x0000742a0fe9eb2c pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x0000742a0fe4527e raise ./signal/../sysdeps/posix/raise.c:27:6
#8 0x0000742a0fe288ff abort ./stdlib/abort.c:81:7
#9 0x0000742a0fe2881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x0000742a0fe3b517 (/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