[llvm] [X86] Remove X86ISD::VSHLDV/VSHRDV and use ISD::FSHL/FSHR opcodes directly (PR #157616)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 21 03:33:01 PDT 2025


================
@@ -31205,16 +31205,16 @@ static SDValue LowerFunnelShift(SDValue Op, const X86Subtarget &Subtarget,
     unsigned NumElts = VT.getVectorNumElements();
 
     if (Subtarget.hasVBMI2() && EltSizeInBits > 8) {
-      if (IsFSHR)
-        std::swap(Op0, Op1);
 
       if (IsCstSplat) {
+        if (IsFSHR)
+          std::swap(Op0, Op1);
         uint64_t ShiftAmt = APIntShiftAmt.urem(EltSizeInBits);
         SDValue Imm = DAG.getTargetConstant(ShiftAmt, DL, MVT::i8);
         return getAVX512Node(IsFSHR ? X86ISD::VSHRD : X86ISD::VSHLD, DL, VT,
----------------
RKSimon wrote:

Another future patch to consider is replacing these with X86ISD::FSHLI/X86ISD::FSHRI nodes that more closely match ISD::FSHL/FSHR but with uniform constant shift amount.

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


More information about the llvm-commits mailing list