summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/DivergenceAnalysis.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DivergenceAnalysis.cpp b/llvm/lib/Analysis/DivergenceAnalysis.cpp
index b30539f3b31..d38725ff0ac 100644
--- a/llvm/lib/Analysis/DivergenceAnalysis.cpp
+++ b/llvm/lib/Analysis/DivergenceAnalysis.cpp
@@ -138,6 +138,11 @@ void DivergencePropagator::exploreSyncDependency(TerminatorInst *TI) {
// a2 = 2;
// a = phi(a1, a2); // sync dependent on (tid < 5)
BasicBlock *ThisBB = TI->getParent();
+
+ // Unreachable blocks may not be in the dominator tree.
+ if (!DT.isReachableFromEntry(ThisBB))
+ return;
+
BasicBlock *IPostDom = PDT.getNode(ThisBB)->getIDom()->getBlock();
if (IPostDom == nullptr)
return;
OpenPOWER on IntegriCloud