Skip to content

Commit e792a35

Browse files
committed
[slp] adjust debug output to include final computed cost
1 parent ace3ce8 commit e792a35

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10079,7 +10079,7 @@ bool SLPVectorizerPass::vectorizeStoreChain(ArrayRef<Value *> Chain, BoUpSLP &R,
1007910079

1008010080
InstructionCost Cost = R.getTreeCost();
1008110081

10082-
LLVM_DEBUG(dbgs() << "SLP: Found cost = " << Cost << " for VF =" << VF << "\n");
10082+
LLVM_DEBUG(dbgs() << "SLP: Found cost = " << Cost << " for VF=" << VF << "\n");
1008310083
if (Cost < -SLPCostThreshold) {
1008410084
LLVM_DEBUG(dbgs() << "SLP: Decided to vectorize cost = " << Cost << "\n");
1008510085

@@ -10380,6 +10380,7 @@ bool SLPVectorizerPass::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R,
1038010380
CandidateFound = true;
1038110381
MinCost = std::min(MinCost, Cost);
1038210382

10383+
LLVM_DEBUG(dbgs() << "SLP: Found cost = " << Cost << " for VF=" << VF << "\n");
1038310384
if (Cost < -SLPCostThreshold) {
1038410385
LLVM_DEBUG(dbgs() << "SLP: Vectorizing list at cost:" << Cost << ".\n");
1038510386
R.getORE()->emit(OptimizationRemark(SV_NAME, "VectorizedList",
@@ -11219,8 +11220,8 @@ class HorizontalReduction {
1121911220
InstructionCost ReductionCost =
1122011221
getReductionCost(TTI, VL, ReduxWidth, RdxFMF);
1122111222
InstructionCost Cost = TreeCost + ReductionCost;
11223+
LLVM_DEBUG(dbgs() << "SLP: Found cost = " << Cost << " for reduction\n");
1122211224
if (!Cost.isValid()) {
11223-
LLVM_DEBUG(dbgs() << "Encountered invalid baseline cost.\n");
1122411225
return nullptr;
1122511226
}
1122611227
if (Cost >= -SLPCostThreshold) {

0 commit comments

Comments
 (0)