[Mlir-commits] [mlir] [mlir][llvm] Drop unreachable basic block during import (PR #78467)
Tobias Gysi
llvmlistbot at llvm.org
Wed Jan 17 23:33:26 PST 2024
gysit wrote:
> I know about self-referencing instructions, but I don't quite get why we can't import this in MLIR?
The import in its current form cannot support this since all operand values need to exist before the operation is converted. There is currently no mechanism to create temporary values that then later on are magically replaced. A possibly solution may be to have an LLVM pass before the import that introduces phi instructions for such values. That sounds really complex to get right in the general case though.
Is there a use case for such unreachable blocks in MLIR? Canonicalize immediately deletes such a block since there to the best of my knowledge there is no way to reach an unreachable block in MLIR (since there is no indirect branch or similar). I would thus strongly favor the current solution which is much simpler and leads to the same result.
https://github.com/llvm/llvm-project/pull/78467
More information about the Mlir-commits
mailing list