Skip to content

Commit f13e92d

Browse files
committed
[InstCombine] Use CreateVectorSplat(ElementCount) variant directly
This was introduced at rGe20223672100, and the CreateVectorSplat(unsigned NumElements) variant calls it internally
1 parent 090f9d5 commit f13e92d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,8 +2017,8 @@ static Instruction *canonicalizeScalarSelectOfVecs(SelectInst &Sel,
20172017
// select (extelt V, Index), T, F --> select (splat V, Index), T, F
20182018
// Splatting the extracted condition reduces code (we could directly create a
20192019
// splat shuffle of the source vector to eliminate the intermediate step).
2020-
unsigned NumElts = Ty->getNumElements();
2021-
return IC.replaceOperand(Sel, 0, IC.Builder.CreateVectorSplat(NumElts, Cond));
2020+
return IC.replaceOperand(
2021+
Sel, 0, IC.Builder.CreateVectorSplat(Ty->getElementCount(), Cond));
20222022
}
20232023

20242024
/// Reuse bitcasted operands between a compare and select:

0 commit comments

Comments
 (0)