Skip to content

Commit 8fb802e

Browse files
authored
[LV] Improve code in collectInstsToScalarize (NFC) (#130643)
1 parent 5f58f3d commit 8fb802e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5391,12 +5391,12 @@ void LoopVectorizationCostModel::collectInstsToScalarize(ElementCount VF) {
53915391
ScalarCostsVF.insert(ScalarCosts.begin(), ScalarCosts.end());
53925392
// Check if we decided to scalarize a call. If so, update the widening
53935393
// decision of the call to CM_Scalarize with the computed scalar cost.
5394-
for (const auto &[I, _] : ScalarCosts) {
5394+
for (const auto &[I, Cost] : ScalarCosts) {
53955395
auto *CI = dyn_cast<CallInst>(I);
53965396
if (!CI || !CallWideningDecisions.contains({CI, VF}))
53975397
continue;
53985398
CallWideningDecisions[{CI, VF}].Kind = CM_Scalarize;
5399-
CallWideningDecisions[{CI, VF}].Cost = ScalarCosts[CI];
5399+
CallWideningDecisions[{CI, VF}].Cost = Cost;
54005400
}
54015401
}
54025402
// Remember that BB will remain after vectorization.

0 commit comments

Comments
 (0)