diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-01-12 12:00:43 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-01-12 12:00:43 +0000 |
commit | 0d92c4debc405d5abfe2c4832a0633f01330d8ac (patch) | |
tree | fc638b4e13936c5b5f70cccc42b394d00336edb3 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 606feebb2eca1b5449ca693aee1795f0e7e000bb (diff) | |
download | bcm5719-llvm-0d92c4debc405d5abfe2c4832a0633f01330d8ac.tar.gz bcm5719-llvm-0d92c4debc405d5abfe2c4832a0633f01330d8ac.zip |
Use getShiftAmountTy for shift amounts.
llvm-svn: 351005
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 1d8615ccce9..0175bcd7339 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -4719,6 +4719,7 @@ bool TargetLowering::expandABS(SDNode *N, SDValue &Result, SelectionDAG &DAG) const { SDLoc dl(N); EVT VT = N->getValueType(0); + EVT ShVT = getShiftAmountTy(VT, DAG.getDataLayout()); SDValue Op = N->getOperand(0); // Only expand vector types if we have the appropriate vector operations. @@ -4729,7 +4730,7 @@ bool TargetLowering::expandABS(SDNode *N, SDValue &Result, SDValue Shift = DAG.getNode(ISD::SRA, dl, VT, Op, - DAG.getConstant(VT.getScalarSizeInBits() - 1, dl, VT)); + DAG.getConstant(VT.getScalarSizeInBits() - 1, dl, ShVT)); SDValue Add = DAG.getNode(ISD::ADD, dl, VT, Op, Shift); Result = DAG.getNode(ISD::XOR, dl, VT, Add, Shift); return true; |