Skip to content

Commit aca50cd

Browse files
committed
Change the loop iterator.
1 parent 8db6d10 commit aca50cd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,8 +1160,8 @@ Instruction *InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(
11601160
// Avoid constructing constant aggregate because constant value may expose
11611161
// more optimizations.
11621162
bool ConstAgg = true;
1163-
for (auto I : enumerate(AggElts)) {
1164-
Value *Elt = (*I.value())->DoPHITranslation(UseBB, It.first);
1163+
for (auto [Idx, Val] : enumerate(AggElts)) {
1164+
Value *Elt = (*Val)->DoPHITranslation(UseBB, It.first);
11651165
if (!isa<Constant>(Elt)) {
11661166
ConstAgg = false;
11671167
break;
@@ -1180,9 +1180,9 @@ Instruction *InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(
11801180
BasicBlock *Pred = It.first;
11811181
Builder.SetInsertPoint(Pred, Pred->getTerminator()->getIterator());
11821182
Value *V = PoisonValue::get(AggTy);
1183-
for (auto I : enumerate(AggElts)) {
1184-
Value *Elt = (*I.value())->DoPHITranslation(UseBB, Pred);
1185-
V = Builder.CreateInsertValue(V, Elt, I.index());
1183+
for (auto [Idx, Val] : enumerate(AggElts)) {
1184+
Value *Elt = (*Val)->DoPHITranslation(UseBB, Pred);
1185+
V = Builder.CreateInsertValue(V, Elt, Idx);
11861186
}
11871187

11881188
It.second = V;

0 commit comments

Comments
 (0)