[llvm] ab2cbb8 - [X86] LowerShiftByScalarVariable - remove 32-bit vXi64 bitcast shift amount handling

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 2 05:52:37 PST 2022


Author: Simon Pilgrim
Date: 2022-03-02T13:52:14Z
New Revision: ab2cbb8466f0934e3d6fb30069017986ef89e5db

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

LOG: [X86] LowerShiftByScalarVariable - remove 32-bit vXi64 bitcast shift amount handling

This was handled generically (and better) by D120553

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 6ec80d0b02369..d08458bf2160f 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -29338,7 +29338,6 @@ static SDValue LowerShiftByScalarVariable(SDValue Op, SelectionDAG &DAG,
   SDValue Amt = Op.getOperand(1);
   unsigned Opcode = Op.getOpcode();
   unsigned X86OpcI = getTargetVShiftUniformOpcode(Opcode, false);
-  unsigned X86OpcV = getTargetVShiftUniformOpcode(Opcode, true);
 
   // TODO: Use getSplatSourceVector.
   if (SDValue BaseShAmt = DAG.getSplatValue(Amt)) {
@@ -29401,23 +29400,6 @@ static SDValue LowerShiftByScalarVariable(SDValue Op, SelectionDAG &DAG,
     }
   }
 
-  // Check cases (mainly 32-bit) where i64 is expanded into high and low parts.
-  if (VT == MVT::v2i64 && Amt.getOpcode() == ISD::BITCAST &&
-      Amt.getOperand(0).getOpcode() == ISD::BUILD_VECTOR) {
-    Amt = Amt.getOperand(0);
-    unsigned Ratio = 64 / Amt.getScalarValueSizeInBits();
-    std::vector<SDValue> Vals(Ratio);
-    for (unsigned i = 0; i != Ratio; ++i)
-      Vals[i] = Amt.getOperand(i);
-    for (unsigned i = Ratio, e = Amt.getNumOperands(); i != e; i += Ratio) {
-      for (unsigned j = 0; j != Ratio; ++j)
-        if (Vals[j] != Amt.getOperand(i + j))
-          return SDValue();
-    }
-
-    if (supportedVectorShiftWithBaseAmnt(VT, Subtarget, Op.getOpcode()))
-      return DAG.getNode(X86OpcV, dl, VT, R, Op.getOperand(1));
-  }
   return SDValue();
 }
 


        


More information about the llvm-commits mailing list