summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-03-21 12:41:18 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-03-21 12:41:18 +0000
commit87d261bfd3f06789b7b9679d8f10fecccbbd328b (patch)
tree69c9820453b678fdf6ef40c45b3557af53b533c3 /llvm/lib
parent361b5b2193421824925a72669f1d06cd63c3d9a7 (diff)
downloadbcm5719-llvm-87d261bfd3f06789b7b9679d8f10fecccbbd328b.tar.gz
bcm5719-llvm-87d261bfd3f06789b7b9679d8f10fecccbbd328b.zip
[Thumb] Fix infinite loop in ABS expansion (PR41160)
Don't expand ISD::ABS node if its legal. llvm-svn: 356661
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index be6d11a962a..36df387cd1b 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -10391,9 +10391,12 @@ static SDValue PerformABSCombine(SDNode *N,
SelectionDAG &DAG = DCI.DAG;
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
- if (!TLI.expandABS(N, res, DAG))
+ if (TLI.isOperationLegal(N->getOpcode(), N->getValueType(0)))
return SDValue();
+ if (!TLI.expandABS(N, res, DAG))
+ return SDValue();
+
return res;
}
OpenPOWER on IntegriCloud