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

Ye Tian via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 21 18:37:38 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,
----------------
TianYe717 wrote:

Thanks for the suggestion! I’ll keep this patch focused, but I’m happy to work on adding X86ISD::FSHLI/FSHRI in a follow-up

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


More information about the llvm-commits mailing list