[llvm] 3120980 - [LV][NFC]: Use CostCtx.CM instead of CM in precomputeCosts (#212287)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 29 03:29:00 PDT 2026
Author: Hassnaa Hamdi
Date: 2026-07-29T11:28:56+01:00
New Revision: 3120980d24f67f5754742c1dc8865e30307529ce
URL: https://github.com/llvm/llvm-project/commit/3120980d24f67f5754742c1dc8865e30307529ce
DIFF: https://github.com/llvm/llvm-project/commit/3120980d24f67f5754742c1dc8865e30307529ce.diff
LOG: [LV][NFC]: Use CostCtx.CM instead of CM in precomputeCosts (#212287)
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index aa099b84ed61b..e1178c6750f2c 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5731,7 +5731,7 @@ LoopVectorizationPlanner::precomputeCosts(VPlan &Plan, ElementCount VF,
// accounted for here using the legacy cost model. However, some opcodes
// are excluded from these precomputed scalarization costs and are instead
// modeled later by the VPlan cost model (see UseVPlanCostModel below).
- for (Instruction *ForcedScalar : CM.ForcedScalars[VF]) {
+ for (Instruction *ForcedScalar : CostCtx.CM.ForcedScalars[VF]) {
if (CostCtx.skipCostComputation(ForcedScalar, VF.isVector()))
continue;
CostCtx.SkipCostComputation.insert(ForcedScalar);
@@ -5754,7 +5754,7 @@ LoopVectorizationPlanner::precomputeCosts(VPlan &Plan, ElementCount VF,
return false;
}
};
- for (const auto &[Scalarized, ScalarCost] : CM.InstsToScalarize[VF]) {
+ for (const auto &[Scalarized, ScalarCost] : CostCtx.CM.InstsToScalarize[VF]) {
if (UseVPlanCostModel(Scalarized) ||
CostCtx.skipCostComputation(Scalarized, VF.isVector()))
continue;
More information about the llvm-commits
mailing list