[llvm-commits] [llvm] r106149 - /llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp

Jim Grosbach grosbach at apple.com
Wed Jun 16 14:13:38 PDT 2010


Author: grosbach
Date: Wed Jun 16 16:13:38 2010
New Revision: 106149

URL: http://llvm.org/viewvc/llvm-project?rev=106149&view=rev
Log:
A few more places where SCEVExpander bits need to skip over debug intrinsics
when iterating through instructions. Yet more work for rdar://7797940

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=106149&r1=106148&r2=106149&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Wed Jun 16 16:13:38 2010
@@ -97,7 +97,7 @@
           BasicBlock::iterator It = I; ++It;
           if (isa<InvokeInst>(I))
             It = cast<InvokeInst>(I)->getNormalDest()->begin();
-          while (isa<PHINode>(It)) ++It;
+          while (isa<PHINode>(It) || isa<DbgInfoIntrinsic>(It)) ++It;
           if (It != BasicBlock::iterator(CI)) {
             // Recreate the cast after the user.
             // The old cast is left in place in case it is being used
@@ -115,7 +115,7 @@
   BasicBlock::iterator IP = I; ++IP;
   if (InvokeInst *II = dyn_cast<InvokeInst>(I))
     IP = II->getNormalDest()->begin();
-  while (isa<PHINode>(IP)) ++IP;
+  while (isa<PHINode>(IP) || isa<DbgInfoIntrinsic>(IP)) ++IP;
   Instruction *CI = CastInst::Create(Op, V, Ty, V->getName(), IP);
   rememberInstruction(CI);
   return CI;
@@ -1070,7 +1070,8 @@
     BasicBlock::iterator SaveInsertPt = Builder.GetInsertPoint();
     BasicBlock::iterator NewInsertPt =
       llvm::next(BasicBlock::iterator(cast<Instruction>(V)));
-    while (isa<PHINode>(NewInsertPt)) ++NewInsertPt;
+    while (isa<PHINode>(NewInsertPt) || isa<DbgInfoIntrinsic>(NewInsertPt))
+      ++NewInsertPt;
     V = expandCodeFor(SE.getTruncateExpr(SE.getUnknown(V), Ty), 0,
                       NewInsertPt);
     restoreInsertPoint(SaveInsertBB, SaveInsertPt);





More information about the llvm-commits mailing list