[PATCH] D13718: [SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad.

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 11:54:55 PDT 2015


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/minor comment addressed.


================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2954
@@ -2917,4 +2953,3 @@
   // Turn all invokes that unwind here into calls and delete the basic block.
-  for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE;) {
-    BasicBlock *Pred = *PI++;
-    removeUnwindEdge(Pred);
+  for (auto TrivialBB : TrivialUnwindBlocks) {
+    if (isa<PHINode>(RI->getValue())) {
----------------
use auto * here.

================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2973
@@ +2972,3 @@
+  // Delete the resume block if all its predecessors have been deleted.
+  if (BB && pred_begin(BB) == pred_end(BB)) {
+    BB->eraseFromParent();
----------------
A comment correction is in other.  Possibly: have been deleted, and we haven't already deleted it above when deleting the landing pad blocks.


http://reviews.llvm.org/D13718





More information about the llvm-commits mailing list