From: Simon Pilgrim Date: Wed, 3 Jul 2019 10:04:16 +0000 (+0000) Subject: [X86] LowerFunnelShift - use modulo constant shift amount. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9739a115f4b123f44e39649bee9c1bddc5984dd6;p=llvm [X86] LowerFunnelShift - use modulo constant shift amount. This avoids the use of getZExtValue and uses the modulo shift amount which is whats expected for funnel shifts anyhow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365016 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 3807ad68ee9..65a72fea379 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -17831,7 +17831,7 @@ static SDValue LowerFunnelShift(SDValue Op, const X86Subtarget &Subtarget, APInt APIntShiftAmt; if (isConstantSplat(Amt, APIntShiftAmt)) { - uint64_t ShiftAmt = APIntShiftAmt.getZExtValue(); + uint64_t ShiftAmt = APIntShiftAmt.urem(VT.getScalarSizeInBits()); return DAG.getNode(IsFSHR ? X86ISD::VSHRD : X86ISD::VSHLD, DL, VT, Op0, Op1, DAG.getConstant(ShiftAmt, DL, MVT::i8)); }