Print IV chain numbers while collecting them.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 25 Apr 2012 18:01:32 +0000 (18:01 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 25 Apr 2012 18:01:32 +0000 (18:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155567 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index fe4700b36e78e2fcf8db4886e55124383ed33210..803feb4fd720c4299b171a5e9a582ca3ccaf820f 100644 (file)
@@ -2487,12 +2487,12 @@ void LSRInstance::ChainInstruction(Instruction *UserInst, Instruction *IVOper,
     ++NChains;
     IVChainVec.resize(NChains);
     ChainUsersVec.resize(NChains);
-    DEBUG(dbgs() << "IV Head: (" << *UserInst << ") IV=" << *LastIncExpr
-          << "\n");
+    DEBUG(dbgs() << "IV Chain#" << ChainIdx << " Head: (" << *UserInst
+                 << ") IV=" << *LastIncExpr << "\n");
   }
   else
-    DEBUG(dbgs() << "IV  Inc: (" << *UserInst << ") IV+" << *LastIncExpr
-          << "\n");
+    DEBUG(dbgs() << "IV Chain#" << ChainIdx << "  Inc: (" << *UserInst
+                 << ") IV+" << *LastIncExpr << "\n");
 
   // Add this IV user to the end of the chain.
   IVChainVec[ChainIdx].push_back(IVInc(UserInst, IVOper, LastIncExpr));
@@ -2551,6 +2551,7 @@ void LSRInstance::ChainInstruction(Instruction *UserInst, Instruction *IVOper,
 /// loop latch. This will discover chains on side paths, but requires
 /// maintaining multiple copies of the Chains state.
 void LSRInstance::CollectChains() {
+  DEBUG(dbgs() << "Collecting IV Chains.\n");
   SmallVector<ChainUsers, 8> ChainUsersVec;
 
   SmallVector<BasicBlock *,8> LatchPath;