[llvm] r370471 - [DAGCombine] visitVSELECT - use getShiftAmountTy for shift amounts.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 30 06:30:37 PDT 2019
Author: rksimon
Date: Fri Aug 30 06:30:37 2019
New Revision: 370471
URL: http://llvm.org/viewvc/llvm-project?rev=370471&view=rev
Log:
[DAGCombine] visitVSELECT - use getShiftAmountTy for shift amounts.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=370471&r1=370470&r2=370471&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Aug 30 06:30:37 2019
@@ -8715,9 +8715,9 @@ SDValue DAGCombiner::visitVSELECT(SDNode
if (TLI.isOperationLegalOrCustom(ISD::ABS, VT))
return DAG.getNode(ISD::ABS, DL, VT, LHS);
- SDValue Shift = DAG.getNode(
- ISD::SRA, DL, VT, LHS,
- DAG.getConstant(VT.getScalarSizeInBits() - 1, DL, VT));
+ SDValue Shift = DAG.getNode(ISD::SRA, DL, VT, LHS,
+ DAG.getConstant(VT.getScalarSizeInBits() - 1,
+ DL, getShiftAmountTy(VT)));
SDValue Add = DAG.getNode(ISD::ADD, DL, VT, LHS, Shift);
AddToWorklist(Shift.getNode());
AddToWorklist(Add.getNode());
More information about the llvm-commits
mailing list