DominatorTree is invalid after SimplifyCFG because of a missed Changed = true when simplifying a branch condition and removing an edge.
Resolves PR42272.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
*ping* We would like to bump up the priority of this since this allows us to enable the new PM when building fuchsia.
lgtm
lib/Transforms/Utils/SimplifyCFG.cpp | ||
---|---|---|
4181 ↗ | (On Diff #212473) | Is this check necessary? If not, might be nice to remove it (in a separate change). |
4192 ↗ | (On Diff #212473) | You could sink down the Changed = true; outside the if/else. |
test/Transforms/SimplifyCFG/invalidate-dom.ll | ||
16 ↗ | (On Diff #212473) | You can use opt -metarenamer to give names to all these instructions. That makes the test a bit more resilient to changes. |
Address comments.
lib/Transforms/Utils/SimplifyCFG.cpp | ||
---|---|---|
4192 ↗ | (On Diff #212473) | Right, but this is non-obvious because of the else if below (instead of else). Unless one notices that this iterates over BB's predecessors, then they may think BB may not be either the 0 or 1 successor. |
test/Transforms/SimplifyCFG/invalidate-dom.ll | ||
16 ↗ | (On Diff #212473) | SG, but I renamed just the instructions manually. The metarenamer renames everything and I for one get more confused when everything is named foo, bar etc :). |