[Mlir-commits] [mlir] [mlir][llvm] Drop unreachable basic block during import (PR #78467)

Tobias Gysi llvmlistbot at llvm.org
Wed Jan 17 11:22:16 PST 2024


gysit wrote:

> I'm confused because the title says "Import unreachable basic blocks" but the description says "We thus delete the unreachable basic block"?

I tried to improve title and comment. That was indeed a failed attempt of coming up with a short title.

The revision indeed deletes unreachable basic blocks before the import since importing an unreachable block is not possible in the general case. The problem is that instructions can use a value that they define themselves. This is possible since an unreachable block can dominate itself.

The fadd in the following code is an example for such a self dependency.
```
define void @unreachable_block(float %0) {
.entry:
  ret void

unreachable:
  %1 = fadd float %0, %1
  br label %unreachable
}
```

https://github.com/llvm/llvm-project/pull/78467


More information about the Mlir-commits mailing list