From: Craig Topper Date: Sun, 13 Jan 2019 19:33:30 +0000 (+0000) Subject: [LegalizeDAG] Remove 'NeedInvert' code from expansion of BR_CC. Replace with an assert. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7f753b17fdc22f9c5babea3e8d7a7dc355e7bef;p=llvm [LegalizeDAG] Remove 'NeedInvert' code from expansion of BR_CC. Replace with an assert. I accidentally triggered this code while doing some experiments and it doesn't look lke it could possibly work. It calls 'getNOT' on a node that should be a CondCode. I think to do this right we would need to swap the branch target and the fallthrough target. But that's not easy to do. Or we could create an explicit SetCC and feed that into a new BR_CC? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351022 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 9ac626c55f5..d3aea37f944 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -3685,10 +3685,7 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) { (void)Legalized; assert(Legalized && "Can't legalize BR_CC with legal condition!"); - // If we expanded the SETCC by inverting the condition code, then wrap - // the existing SETCC in a NOT to restore the intended condition. - if (NeedInvert) - Tmp4 = DAG.getNOT(dl, Tmp4, Tmp4->getValueType(0)); + assert(!NeedInvert && "Don't know how to invert BR_CC!"); // If we expanded the SETCC by swapping LHS and RHS, create a new BR_CC // node.