forked from OSchip/llvm-project
[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:
parent
090f9d5a55
commit
f13e92d4b2
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue