[llvm] [PowerPC] extend smaller splats into bigger splats (with fix) (PR #142194)
Amy Kwan via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 6 22:56:24 PDT 2025
================
@@ -9785,13 +9802,37 @@ SDValue PPCTargetLowering::LowerBUILD_VECTOR(SDValue Op,
dl);
// If the sign extended value is in the range [-16,15], use VSPLTI[bhw].
- int32_t SextVal = SignExtend32(SplatBits, SplatBitSize);
- if (SextVal >= -16 && SextVal <= 15)
- return getCanonicalConstSplat(SextVal, SplatSize, Op.getValueType(), DAG,
- dl);
+ // Use VSPLTIW/VUPKLSW for v2i64 in range [-16,15].
+ if (SextVal >= -16 && SextVal <= 15) {
+ unsigned UseSize = SplatSize == 8 ? 4 : SplatSize;
----------------
amy-kwan wrote:
Would it be reasonable to put that comment about the SplatSize in a comment here?
https://github.com/llvm/llvm-project/pull/142194
More information about the llvm-commits
mailing list