[llvm] 769dbe3 - [X86] combineConcatVectorOps - IsConcatFree - detect splats first, then check for repeated load. NFC. (#174950)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 8 04:03:38 PST 2026


Author: Simon Pilgrim
Date: 2026-01-08T12:03:33Z
New Revision: 769dbe369a549319e0b7c14585fbc3dd71468175

URL: https://github.com/llvm/llvm-project/commit/769dbe369a549319e0b7c14585fbc3dd71468175
DIFF: https://github.com/llvm/llvm-project/commit/769dbe369a549319e0b7c14585fbc3dd71468175.diff

LOG: [X86] combineConcatVectorOps - IsConcatFree - detect splats first, then check for repeated load. NFC. (#174950)

This will make it easier to handle other splat values that are free to
concat.

There should be no need to do repeated peekThroughBitcasts for every
(canonicalised) bitcasted operand.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 9dd389a068a7d..1835d58f7cd41 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -59230,11 +59230,13 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
       bool AllConstants = true;
       bool AllSubs = true;
       unsigned VecSize = VT.getSizeInBits();
-      SDValue BC0 = peekThroughBitcasts(SubOps[0].getOperand(Op));
-      if (isa<LoadSDNode>(BC0) && all_of(SubOps, [&](SDValue SubOp) {
-            return BC0 == peekThroughBitcasts(SubOp.getOperand(Op));
-          }))
-        return true;
+      SDValue SubOp0 = SubOps[0].getOperand(Op);
+      if (all_of(SubOps, [&](SDValue SubOp) {
+            return SubOp0 == SubOp.getOperand(Op);
+          })) {
+        if (isa<LoadSDNode>(peekThroughBitcasts(SubOp0)))
+          return true;
+      }
       SmallVector<SDValue> Subs;
       for (unsigned I = 0, E = SubOps.size(); I != E; ++I) {
         Subs.push_back(SubOps[I].getOperand(Op));


        


More information about the llvm-commits mailing list