Issue 153906
Summary [MLIR] RemoveDeadValues pass errors on unreachable operation
Labels rejects-valid, mlir
Assignees
Reporter Sirraide
    Consider (https://godbolt.org/z/7c7oqqEY7):
```mlir
module @test {
  func.func @foo() {
    %false = arith.constant false
    %zero = arith.constant 0 : i64
    cf.cond_br %false, ^bb1, ^bb4
  ^bb1:
    %3 = arith.cmpi eq, %zero, %zero : i64
    cf.br ^bb1
  ^bb4:
    return
  }
}
```
For some reason `--remove-dead-values` chokes on this and errors rather than just removing the block
```console
<source>:7:10: error: null operand found
 %3 = arith.cmpi eq, %zero, %zero : i64
         ^
<source>:7:10: note: see current operation: %1 = "arith.cmpi"(<<NULL VALUE>>, <<NULL VALUE>>) <{predicate = 0 : i64}> : (<<NULL TYPE>>, <<NULL TYPE>>) -> i1
```

Not sure if #153732 is in any way related but in both cases the cause of the problem seems to be an unreachable block.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to