diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 38916f55f2c4b..fd319920837ad 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -30831,8 +30831,11 @@ SDValue X86TargetLowering::LowerWin64_INT128_TO_FP(SDValue Op, // Return true if the required (according to Opcode) shift-imm form is natively // supported by the Subtarget -static bool supportedVectorShiftWithImm(MVT VT, const X86Subtarget &Subtarget, +static bool supportedVectorShiftWithImm(EVT VT, const X86Subtarget &Subtarget, unsigned Opcode) { + if (!VT.isSimple()) + return false; + if (!(VT.is128BitVector() || VT.is256BitVector() || VT.is512BitVector())) return false; @@ -30854,15 +30857,18 @@ static bool supportedVectorShiftWithImm(MVT VT, const X86Subtarget &Subtarget, // The shift amount is a variable, but it is the same for all vector lanes. // These instructions are defined together with shift-immediate. static -bool supportedVectorShiftWithBaseAmnt(MVT VT, const X86Subtarget &Subtarget, +bool supportedVectorShiftWithBaseAmnt(EVT VT, const X86Subtarget &Subtarget, unsigned Opcode) { return supportedVectorShiftWithImm(VT, Subtarget, Opcode); } // Return true if the required (according to Opcode) variable-shift form is // natively supported by the Subtarget -static bool supportedVectorVarShift(MVT VT, const X86Subtarget &Subtarget, +static bool supportedVectorVarShift(EVT VT, const X86Subtarget &Subtarget, unsigned Opcode) { + if (!VT.isSimple()) + return false; + if (!(VT.is128BitVector() || VT.is256BitVector() || VT.is512BitVector())) return false; @@ -49719,7 +49725,7 @@ static SDValue combineAndMaskToShift(SDNode *N, SelectionDAG &DAG, // If the bitcasts can't be eliminated, then it is unlikely that this fold // will be profitable. if (N->getValueType(0) == VT && - supportedVectorShiftWithImm(VT.getSimpleVT(), Subtarget, ISD::SRA)) { + supportedVectorShiftWithImm(VT, Subtarget, ISD::SRA)) { SDValue X, Y; if (Op1.getOpcode() == X86ISD::PCMPGT && isAllOnesOrAllOnesSplat(Op1.getOperand(1)) && Op1.hasOneUse()) { @@ -49748,7 +49754,7 @@ static SDValue combineAndMaskToShift(SDNode *N, SelectionDAG &DAG, if (isBitwiseNot(Op0)) return SDValue(); - if (!supportedVectorShiftWithImm(VT.getSimpleVT(), Subtarget, ISD::SRL)) + if (!supportedVectorShiftWithImm(VT, Subtarget, ISD::SRL)) return SDValue(); unsigned EltBitWidth = VT.getScalarSizeInBits();