[llvm-branch-commits] [llvm-branch] r115962 - /llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp

Gabor Greif ggreif at gmail.com
Thu Oct 7 12:46:21 PDT 2010


Author: ggreif
Date: Thu Oct  7 14:46:21 2010
New Revision: 115962

URL: http://llvm.org/viewvc/llvm-project?rev=115962&view=rev
Log:
small tweak: only consider phis in destination block

Modified:
    llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp

Modified: llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=115962&r1=115961&r2=115962&view=diff
==============================================================================
--- llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu Oct  7 14:46:21 2010
@@ -900,6 +900,8 @@
   for (BasicBlock::use_iterator U = New->use_begin(),
          E = New->use_end(); U != E; ++U)
     if (PHINode *PHI = dyn_cast<PHINode>(*U)) {
+      if (Old->getTerminator()->getSuccessor(0) != PHI->getParent())
+        continue;
       int IDX = PHI->getBasicBlockIndex(New);
       if (IDX >= 0 &&
           PHI->getBasicBlockIndex(Old) < 0)





More information about the llvm-branch-commits mailing list