[llvm] r258532 - [AArch64] Assert that CCMP isel didn't fail inconsistently.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 11:43:44 PST 2016


Author: ab
Date: Fri Jan 22 13:43:43 2016
New Revision: 258532

URL: http://llvm.org/viewvc/llvm-project?rev=258532&view=rev
Log:
[AArch64] Assert that CCMP isel didn't fail inconsistently.

We verify that the op tree is eligible for CCMP emission in
isConjunctionDisjunctionTree, but it's also possible that
emitConjunctionDisjunctionTree fails later.
The initial check is useful, as it avoids building nodes
that will get discarded.
Still, make sure that inconsistencies don't happen with
an assert.

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=258532&r1=258531&r2=258532&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp Fri Jan 22 13:43:43 2016
@@ -1418,11 +1418,13 @@ static SDValue emitConjunctionDisjunctio
   AArch64CC::CondCode RHSCC;
   SDValue CmpR = emitConjunctionDisjunctionTree(DAG, RHS, RHSCC, PushNegate,
                                                 CCOp, Predicate, Depth+1);
+  assert(CmpR && "Transform legality should have been checked already!");
   if (NegateOperands && !PushNegate)
     RHSCC = AArch64CC::getInvertedCondCode(RHSCC);
   // Emit LHS. We must push the negate through if we need to negate it.
   SDValue CmpL = emitConjunctionDisjunctionTree(DAG, LHS, OutCC, NegateOperands,
                                                 CmpR, RHSCC, Depth+1);
+  assert(CmpL && "Transform legality should have been checked already!");
   // If we transformed an OR to and AND then we have to negate the result
   // (or absorb a PushNegate resulting in a double negation).
   if (Opcode == ISD::OR && !PushNegate)




More information about the llvm-commits mailing list