[PATCH] D19732: DivergenceAnalysis: Fix crash with no return blocks

Jingyue Wu via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 17:50:58 PDT 2016


jingyue accepted this revision.
This revision is now accepted and ready to land.

================
Comment at: lib/Analysis/DivergenceAnalysis.cpp:146
@@ -145,2 +145,3 @@
 
-  BasicBlock *IPostDom = PDT.getNode(ThisBB)->getIDom()->getBlock();
+  // If the function has no return blocks, the post dominator tree may not have
+  // a root.
----------------
The comment seems inaccurate. `PDT.getNode(ThisBB) == nullptr` means the function doesn't have an exit block **or** `ThisBB` doesn't reach any exit block of the function. 


http://reviews.llvm.org/D19732





More information about the llvm-commits mailing list