[llvm] r319837 - [AArch64] Do not abort if overflow check does not use EQ or NE.
Joel Galenson via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 5 13:33:12 PST 2017
Author: jgalenson
Date: Tue Dec 5 13:33:12 2017
New Revision: 319837
URL: http://llvm.org/viewvc/llvm-project?rev=319837&view=rev
Log:
[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
Modified:
llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=319837&r1=319836&r2=319837&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp Tue Dec 5 13:33:12 2017
@@ -4006,9 +4006,8 @@ SDValue AArch64TargetLowering::LowerBR_C
// 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();
More information about the llvm-commits
mailing list