[InstCombine] Use CreateVectorSplat(ElementCount) variant directly

This was introduced at rGe20223672100, and the CreateVectorSplat(unsigned NumElements) variant calls it internally
This commit is contained in:
Simon Pilgrim 2020-08-08 19:26:02 +01:00
parent 090f9d5a55
commit f13e92d4b2
1 changed files with 2 additions and 2 deletions

View File

@ -2017,8 +2017,8 @@ static Instruction *canonicalizeScalarSelectOfVecs(SelectInst &Sel,
// select (extelt V, Index), T, F --> select (splat V, Index), T, F // select (extelt V, Index), T, F --> select (splat V, Index), T, F
// Splatting the extracted condition reduces code (we could directly create a // Splatting the extracted condition reduces code (we could directly create a
// splat shuffle of the source vector to eliminate the intermediate step). // splat shuffle of the source vector to eliminate the intermediate step).
unsigned NumElts = Ty->getNumElements(); return IC.replaceOperand(
return IC.replaceOperand(Sel, 0, IC.Builder.CreateVectorSplat(NumElts, Cond)); Sel, 0, IC.Builder.CreateVectorSplat(Ty->getElementCount(), Cond));
} }
/// Reuse bitcasted operands between a compare and select: /// Reuse bitcasted operands between a compare and select: