diff options
| author | Joel Galenson <jgalenson@google.com> | 2017-12-05 21:33:12 +0000 |
|---|---|---|
| committer | Joel Galenson <jgalenson@google.com> | 2017-12-05 21:33:12 +0000 |
| commit | 3e40883e4c85672272ea5f8f489c6f532fad4724 (patch) | |
| tree | 727035c51ba6bb5e677248b2b38d1bd54c46cc4a /llvm/lib/Target/AArch64 | |
| parent | 49fbcd45e40f7135dc92a21e44905751dbdea465 (diff) | |
| download | bcm5719-llvm-3e40883e4c85672272ea5f8f489c6f532fad4724.tar.gz bcm5719-llvm-3e40883e4c85672272ea5f8f489c6f532fad4724.zip | |
[AArch64] Do not abort if overflow check does not use EQ or NE.
As suggested by Eli Friedman, instead of aborting if an overflow check
uses something other than SETEQ or SETNE, simply do not apply the
optimization.
Differential Revision: https://reviews.llvm.org/D39147
llvm-svn: 319837
Diffstat (limited to 'llvm/lib/Target/AArch64')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index 00c45044648..faddd39f79d 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -4006,9 +4006,8 @@ SDValue AArch64TargetLowering::LowerBR_CC(SDValue Op, SelectionDAG &DAG) const { // Optimize {s|u}{add|sub|mul}.with.overflow feeding into a branch // instruction. - if (isOverflowIntrOpRes(LHS) && isOneConstant(RHS)) { - assert((CC == ISD::SETEQ || CC == ISD::SETNE) && - "Unexpected condition code."); + if (isOverflowIntrOpRes(LHS) && isOneConstant(RHS) && + (CC == ISD::SETEQ || CC == ISD::SETNE)) { // Only lower legal XALUO ops. if (!DAG.getTargetLoweringInfo().isTypeLegal(LHS->getValueType(0))) return SDValue(); |

