[llvm] r260614 - [SLP] Add debug output for extract cost (NFC)

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 15:06:40 PST 2016


Author: mssimpso
Date: Thu Feb 11 17:06:40 2016
New Revision: 260614

URL: http://llvm.org/viewvc/llvm-project?rev=260614&view=rev
Log:
[SLP] Add debug output for extract cost (NFC)

Modified:
    llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp

Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=260614&r1=260613&r2=260614&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Thu Feb 11 17:06:40 2016
@@ -1779,7 +1779,6 @@ int BoUpSLP::getSpillCost() {
     PrevInst = Inst;
   }
 
-  DEBUG(dbgs() << "SLP: SpillCost=" << Cost << "\n");
   return Cost;
 }
 
@@ -1833,10 +1832,13 @@ int BoUpSLP::getTreeCost() {
         TTI->getVectorInstrCost(Instruction::ExtractElement, VecTy, EU.Lane);
   }
 
-  Cost += getSpillCost();
+  int SpillCost = getSpillCost();
+  Cost += SpillCost + ExtractCost;
 
-  DEBUG(dbgs() << "SLP: Total Cost " << Cost + ExtractCost<< ".\n");
-  return  Cost + ExtractCost;
+  DEBUG(dbgs() << "SLP: Spill Cost = " << SpillCost << ".\n"
+               << "SLP: Extract Cost = " << ExtractCost << ".\n"
+               << "SLP: Total Cost = " << Cost << ".\n");
+  return Cost;
 }
 
 int BoUpSLP::getGatherCost(Type *Ty) {




More information about the llvm-commits mailing list