For some irreducible CFG the domtree nodes might be dead, do not update domtree for dead nodes.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
For some irreducible CFG the domtree nodes might be dead, do not update domtree for dead nodes.
Can you show some example of such CFG and add a comment explaining this check?
DomTree::getNode return nullptr only for forward-unreachable CFG nodes.
I think that this deserves a comment with a (partial) example, otherwise the change looks suspicious.
Fair point. All the users of MergeBasicBlockIntoOnlyPred in the tree, do not pass DT to the function, so it is never exposed. Is there a way to test this in tree by passing DT to MergeBasicBlockIntoOnlyPred?
It shouldn't be difficult to turn it into a unit test. I haven't checked how Local.cpp is tested, but you can find some existing dominator tree tests in IRTests/DominatorTree.cpp.
Thanks for adding the comment.
The testcase seems really long and it's not obvious why what it tries to exercise -- have you tried reducing it with bugpoint to something shorter and easier to reason about?
Sorry for the long testcase, but this untitest was extracted after using bugpoint to reduce the lit test in test/Transforms/CodeGenPrepare/2008-11-24-RAUW-Self.ll. Is there a way to reduce a unittest using bugpoint?