[PATCH] D15835: [SplitLandingPadPredecessors] Create a PHINode for the original landingpad only if it has some uses

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 4 13:58:15 PST 2016


reames requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: lib/Transforms/Utils/BasicBlockUtils.cpp:629
@@ -628,6 +628,3 @@
 
-    // Create a PHI node for the two cloned landingpad instructions.
-    PHINode *PN = PHINode::Create(LPad->getType(), 2, "lpad.phi", LPad);
-    PN->addIncoming(Clone1, NewBB1);
-    PN->addIncoming(Clone2, NewBB2);
-    LPad->replaceAllUsesWith(PN);
+    // Create a PHI node for the two cloned landingpad instructions only
+    // if the original landingpad instruction has some uses.
----------------
I happen to know from talking to you offline that this is about fixing an issue for token types, but that's not obvious in the code.  I'd add something to make this clear like an assertion that the type of the PHI being created isn't a token type with a comment talking about the splitting restriction.


http://reviews.llvm.org/D15835





More information about the llvm-commits mailing list