forked from OSchip/llvm-project
[InstCombine] simplify code for shuffle mask canonicalization; NFC
We never use the local 'Mask' before returning, so that was dead code.
This commit is contained in:
parent
847aabf11f
commit
fc31b58eff
|
|
@ -1900,13 +1900,11 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Mask[i] < (int)LHSWidth && isa<UndefValue>(LHS)) {
|
// Change select of undef to undef mask element or force to LHS.
|
||||||
Mask[i] = -1; // Turn into undef.
|
if (Mask[i] < (int)LHSWidth && isa<UndefValue>(LHS))
|
||||||
Elts.push_back(UndefValue::get(Int32Ty));
|
Elts.push_back(UndefValue::get(Int32Ty));
|
||||||
} else {
|
else
|
||||||
Mask[i] = Mask[i] % LHSWidth; // Force to LHS.
|
Elts.push_back(ConstantInt::get(Int32Ty, Mask[i] % LHSWidth));
|
||||||
Elts.push_back(ConstantInt::get(Int32Ty, Mask[i]));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SVI.setOperand(0, SVI.getOperand(1));
|
SVI.setOperand(0, SVI.getOperand(1));
|
||||||
SVI.setOperand(1, UndefValue::get(RHS->getType()));
|
SVI.setOperand(1, UndefValue::get(RHS->getType()));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue