Skip to content

Commit 7b78206

Browse files
committed
[InstCombine] Simplify code. NFCI.
1 parent 4f6e119 commit 7b78206

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2635,17 +2635,9 @@ Instruction *InstCombinerImpl::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
26352635
// If the result mask is equal to one of the original shuffle masks,
26362636
// or is a splat, do the replacement.
26372637
if (isSplat || newMask == LHSMask || newMask == RHSMask || newMask == Mask) {
2638-
SmallVector<Constant*, 16> Elts;
2639-
for (unsigned i = 0, e = newMask.size(); i != e; ++i) {
2640-
if (newMask[i] < 0) {
2641-
Elts.push_back(UndefValue::get(Int32Ty));
2642-
} else {
2643-
Elts.push_back(ConstantInt::get(Int32Ty, newMask[i]));
2644-
}
2645-
}
26462638
if (!newRHS)
26472639
newRHS = UndefValue::get(newLHS->getType());
2648-
return new ShuffleVectorInst(newLHS, newRHS, ConstantVector::get(Elts));
2640+
return new ShuffleVectorInst(newLHS, newRHS, newMask);
26492641
}
26502642

26512643
return MadeChange ? &SVI : nullptr;

0 commit comments

Comments
 (0)