Issue 177835
Summary mlir-opt --remove-dead-values crashes on vector.bitcast with index type
Labels new issue
Assignees
Reporter Subway2023
    # Description
mlir-opt version: 22.1.0-rc1

Running mlir-opt with the --remove-dead-values pass on a module containing a vector.bitcast from vector<index> to an integer vector causes an assertion failure in Type::getIntOrFloatBitWidth()

# Reproduce
location: If the **vector.bitcast** is commented out, the crash no longer occurs.

```
module {
  func.func @main() {
    %0 = vector.step : vector<16xindex>
    scf.execute_region -> vector<16xindex> {
 scf.yield %0 : vector<16xindex>
    }
    %2 = arith.constant dense<0> : vector<16xindex>
    %3 = vector.constant_mask [16] : vector<16xi1>
    %4 = vector.bitcast %2 : vector<16xindex> to vector<16xi64>
    return
 }
}
```
```
mlir-opt --remove-dead-values
```
```
mlir-opt: /mnt/sdd1/mlir/tool/llvm-project-llvmorg-22.1.0-rc1/mlir/lib/IR/Types.cpp:123: unsigned int mlir::Type::getIntOrFloatBitWidth() const: Assertion `isIntOrFloat() && "only integers and floats have a bitwidth"' 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 --remove-dead-values /mnt/sdd1/sbw/mlir/data/genProgram_1218_morning/181215_f4ac/mlir_steps/181215_f4ac_5.mlir
 #0 0x0000647453f75e32 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/mnt/sdd1/sbw/mlir/tool/llvmorg-22.1.0-install/bin/mlir-opt+0x252fe32)
 #1 0x0000647453f725af llvm::sys::RunSignalHandlers() (/mnt/sdd1/sbw/mlir/tool/llvmorg-22.1.0-install/bin/mlir-opt+0x252c5af)
 #2 0x0000647453f726fc SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007d3406845330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x00007d340689eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007d340689eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007d340689eb2c pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007d340684527e raise ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007d34068288ff abort ./stdlib/abort.c:81:7
 #9 0x00007d340682881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007d340683b517 (/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