summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMISelLowering.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2019-08-22 09:16:53 +0000
committerHans Wennborg <hans@hanshq.net>2019-08-22 09:16:53 +0000
commitcd53ff6c0df5f75c4c15abffa18755a8768fc6b3 (patch)
treee9ac57e9b862551adec2064516a3bc98ae6a39cf /llvm/lib/Target/ARM/ARMISelLowering.cpp
parent494370c101e27c5a4561df864825992087a2d69f (diff)
downloadbcm5719-llvm-cd53ff6c0df5f75c4c15abffa18755a8768fc6b3.tar.gz
bcm5719-llvm-cd53ff6c0df5f75c4c15abffa18755a8768fc6b3.zip
Revert r369626 "[ARM] Fix lsrl with a 128/256 bit shift amount or a shift of 32"
It broke the bots, see e.g. http://lab.llvm.org:8011/builders/clang-cuda-build/builds/36275/ > This patch fixes shifts by a 128/256 bit shift amount. It also fixes > codegen for shifts of 32 by delegating to LLVM's default optimisation > instead of emitting a long shift. > > Tests that used to generate long shifts of 32 are updated to check for the > more optimised codegen. > > Differential revision: https://reviews.llvm.org/D66519 > > llvm-svn: 369626 llvm-svn: 369636
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 275859a6b91..04ac7777f5e 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -5938,15 +5938,14 @@ static SDValue Expand64BitShift(SDNode *N, SelectionDAG &DAG,
unsigned ShPartsOpc = ARMISD::LSLL;
ConstantSDNode *Con = dyn_cast<ConstantSDNode>(ShAmt);
- // If the shift amount is greater than 32 or has a greater bitwidth than 64
- // then do the default optimisation
- if (ShAmt->getValueType(0).getSizeInBits() > 64 ||
- (Con && Con->getZExtValue() >= 32))
+ // If the shift amount is greater than 32 then do the default optimisation
+ if (Con && Con->getZExtValue() > 32)
return SDValue();
- // Extract the lower 32 bits of the shift amount if it's not an i32
- if (ShAmt->getValueType(0) != MVT::i32)
- ShAmt = DAG.getZExtOrTrunc(ShAmt, dl, MVT::i32);
+ // Extract the lower 32 bits of the shift amount if it's an i64
+ if (ShAmt->getValueType(0) == MVT::i64)
+ ShAmt = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, MVT::i32, ShAmt,
+ DAG.getConstant(0, dl, MVT::i32));
if (ShOpc == ISD::SRL) {
if (!Con)
OpenPOWER on IntegriCloud