Unreachable blocks may not be in the dominator tree, so don't crash on them.
Details
Diff Detail
Event Timeline
Thanks! I completely missed this case :(
lib/Analysis/DivergenceAnalysis.cpp | ||
---|---|---|
148 | s/BBNode/ThisNode/ There are InfluenceBB and InfluenceNode below, so we'd better be explicit. | |
188 | This seems unnecessary. ThisBB is guaranteed reachable according to the check you added above. InfluenceBB is guaranteed to dominate ThisBB, so it must be reachable too. If you agree, maybe change this if to an assert. |
lib/Analysis/DivergenceAnalysis.cpp | ||
---|---|---|
188 | I hit the first one, and then hit another crash here |
lib/Analysis/DivergenceAnalysis.cpp | ||
---|---|---|
188 | Looking at your code more, the first check PDT.getNode doesn't really guard against unreachable basic blocks. You may want to use DT.getNode() or DT.isReachableFromEntry (I prefer the latter because it's more explicit) there. Then, I believe the second check here is unnecessary. |
s/BBNode/ThisNode/
There are InfluenceBB and InfluenceNode below, so we'd better be explicit.