[SLP][NFC] Fix uninitialized ReductionRoot in getTreeCost
ReductionRoot was initialized to nullptr instead of the RdxRoot parameter. This caused two ScaleCost calls (for MinBWs cast cost and ReductionBitWidth resize cost) to pass nullptr as the user instruction, and suppressed the "Reduction Cost" line in debug output. In practice the scale factor is the same because the tree root's main op and the reduction root share the same basic block, so this is NFC. Reviewers: Pull Request: https://github.com/llvm/llvm-project/pull/189994
This commit is contained in:
parent
27c8596400
commit
1e06cd634e
@ -18082,11 +18082,11 @@ InstructionCost BoUpSLP::getTreeCost(InstructionCost TreeCost,
|
||||
LLVM_DEBUG(dbgs() << "Scale " << Scale << " For entry " << TE.Idx << "\n");
|
||||
return C * Scale;
|
||||
};
|
||||
Instruction *ReductionRoot = nullptr;
|
||||
Instruction *ReductionRoot = RdxRoot;
|
||||
if (UserIgnoreList) {
|
||||
// Scale reduction cost to the factor of the loop nest trip count.
|
||||
ReductionCost = ScaleCost(ReductionCost, *VectorizableTree.front().get(),
|
||||
/*Scalar=*/nullptr, RdxRoot);
|
||||
/*Scalar=*/nullptr, ReductionRoot);
|
||||
}
|
||||
|
||||
// Add the cost for reduction.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user