Skip to content

Commit 8823abe

Browse files
committed
InstCombine: Simplify vector initialization
1 parent 4ff45ee commit 8823abe

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,7 @@ void PointerReplacer::replace(Instruction *I) {
382382
} else if (auto *GEP = dyn_cast<GetElementPtrInst>(I)) {
383383
auto *V = getReplacement(GEP->getPointerOperand());
384384
assert(V && "Operand not replaced");
385-
SmallVector<Value *, 8> Indices;
386-
Indices.append(GEP->idx_begin(), GEP->idx_end());
385+
SmallVector<Value *, 8> Indices(GEP->indices());
387386
auto *NewI =
388387
GetElementPtrInst::Create(GEP->getSourceElementType(), V, Indices);
389388
IC.InsertNewInstWith(NewI, GEP->getIterator());

0 commit comments

Comments
 (0)