[llvm] [LoopVectorize] Use CodeSize as the cost kind for minsize (PR #124119)
John Brawn via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 30 05:24:28 PST 2025
================
@@ -793,7 +793,7 @@ InstructionCost VPRegionBlock::cost(ElementCount VF, VPCostContext &Ctx) {
// For the scalar case, we may not always execute the original predicated
// block, Thus, scale the block's cost by the probability of executing it.
- if (VF.isScalar())
+ if (VF.isScalar() && Ctx.CostKind != TTI::TCK_CodeSize)
return ThenCost / getReciprocalPredBlockProb();
----------------
john-brawn-arm wrote:
I've changed the function and renamed it to getPredBlockCostDivisor.
https://github.com/llvm/llvm-project/pull/124119
More information about the llvm-commits
mailing list