Issue 177836
Summary mlir-opt crash on math.ipowi with i1 type during --bufferization-lower-deallocations pass
Labels new issue
Assignees
Reporter Subway2023
    #Description

mlir-opt version: 22.1.0-rc1

When running mlir-opt with the --bufferization-lower-deallocations pass on an MLIR module that contains math.ipowi with an i1 operand, mlir-opt crashes with an assertion failure in llvm::APInt. The crash seems to be triggered by constant folding of i1 values, which causes the APInt constructor to fail

# Reproduce
location: If the math.ipowi is commented out, the crash no longer occurs.

```
module {
  func.func @main() {
    %0 = vector.constant_mask [2, 2] : vector<4x4xi1>
    %1 = arith.constant true
 %2 = vector.step : vector<4xindex>
    %3, %4 = arith.mului_extended %2, %2 : vector<4xindex>
    %5 = math.ipowi %1, %1 : i1
    return
 }
}
```

```
mlir-opt --bufferization-lower-deallocations test.mlir
```

```
s/181550_401c_5.mlir
mlir-opt: /mnt/sdd1/mlir/tool/llvm-project-llvmorg-22.1.0-rc1/llvm/include/llvm/ADT/APInt.h:120: llvm::APInt::APInt(unsigned int, uint64_t, bool, bool): Assertion `llvm::isIntN(BitWidth, val) && "Value is not an N-bit signed value"' 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: /mnt/sdd1/sbw/mlir/tool/llvmorg-22.1.0-install/bin/mlir-opt --bufferization-lower-deallocations /mnt/sdd1/sbw/mlir/data/genProgram_1218_morning/181550_401c/mlir_steps/181550_401c_5.mlir
 #0 0x0000566f72c11e32 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/mnt/sdd1/sbw/mlir/tool/llvmorg-22.1.0-install/bin/mlir-opt+0x252fe32)
 #1 0x0000566f72c0e5af llvm::sys::RunSignalHandlers() (/mnt/sdd1/sbw/mlir/tool/llvmorg-22.1.0-install/bin/mlir-opt+0x252c5af)
 #2 0x0000566f72c0e6fc SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007714ce445330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x00007714ce49eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007714ce49eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007714ce49eb2c pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007714ce44527e raise ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007714ce4288ff abort ./stdlib/abort.c:81:7
 #9 0x00007714ce42881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007714ce43b517 (/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

Reply via email to