Block merging in MLIR will incorrectly merge blocks with operations whose values are used outside of that block. This change forbids this behavior and provides a test where it is illegal to perform such a merge.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| mlir/test/Transforms/canonicalize-block-merge.mlir | ||
|---|---|---|
| 177 | Added full-stop. Unsure where back edges are handled. This test, however, accidentally exhibited the same bug and had to be modified as a result. It now just tests for back edges and does not in the case a value is used externally (the portion we modified and checked by new test). | |
This bug should only manifest when one of the blocks dominates the other, but we don't have access to DominanceInfo to check that easily right now though. Can you add a TODO that we can allow this merging when we can check the dominance?
| mlir/lib/Transforms/Utils/RegionUtils.cpp | ||
|---|---|---|
| 522 | You can remove the functionality for newOpsToReplace/opsToReplace for now as well. | |
You can remove the functionality for newOpsToReplace/opsToReplace for now as well.