[llvm] [PowerPC] extend smaller splats into bigger splats (with fix) (PR #142194)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 07:20:52 PDT 2025


================
@@ -9664,7 +9664,25 @@ SDValue PPCTargetLowering::LowerBUILD_VECTOR(SDValue Op,
     }
   }
 
-  if (!BVNIsConstantSplat || SplatBitSize > 32) {
+  bool IsSplat64 = false;
+  uint64_t SplatBits = 0;
+  int32_t SextVal = 0;
+  if (BVNIsConstantSplat) {
+    if (SplatBitSize <= 32) {
+      SplatBits = APSplatBits.getZExtValue();
+      SextVal = SignExtend32(SplatBits, SplatBitSize);
+    } else if (SplatBitSize == 64 && Subtarget.hasP8Altivec()) {
+      int64_t Splat64Val = APSplatBits.getSExtValue();
+      SplatBits = (uint64_t)Splat64Val;
+      SextVal = (int32_t)SplatBits;
----------------
RolandF77 wrote:

SplatBits is used below, it is an existing variable moved earlier. I think the rest is addressed.

https://github.com/llvm/llvm-project/pull/142194


More information about the llvm-commits mailing list