[llvm] r365016 - [X86] LowerFunnelShift - use modulo constant shift amount.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 3 03:04:16 PDT 2019
Author: rksimon
Date: Wed Jul 3 03:04:16 2019
New Revision: 365016
URL: http://llvm.org/viewvc/llvm-project?rev=365016&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=365016&r1=365015&r2=365016&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jul 3 03:04:16 2019
@@ -17831,7 +17831,7 @@ static SDValue LowerFunnelShift(SDValue
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));
}
More information about the llvm-commits
mailing list