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

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 11:44:52 PST 2016


reames added a comment.

Please briefly explain the motivation in this description as well.  You want the commit comment to be self explanatory to reviewers and readers of the commit message.


================
Comment at: lib/Transforms/Scalar/LoopUnswitch.cpp:1064
@@ +1063,3 @@
+      auto *OriginalLPad = ExitBlocks[i]->getLandingPadInst();
+      if (!OriginalLPad->use_empty()) {
+        assert(!LPad->getType()->isTokenTy() &&
----------------
I believe this code is wrong as written. If you don't insert the PHI, you still need to replace the original LandingPad with the new one.  


http://reviews.llvm.org/D15931





More information about the llvm-commits mailing list