OSDN Git Service

SDAG: Replace some unreachable code with an assert. NFC
authorJustin Bogner <mail@justinbogner.com>
Fri, 3 Jun 2016 18:09:53 +0000 (18:09 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 3 Jun 2016 18:09:53 +0000 (18:09 +0000)
The current node shouldn't be (and isn't) removed partway through
selection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271699 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index bd0c992..359919e 100644 (file)
@@ -3365,13 +3365,10 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
                                                              nullptr));
         }
 
-      } else if (NodeToMatch->getOpcode() != ISD::DELETED_NODE) {
-        Res = MorphNode(NodeToMatch, TargetOpc, VTList, Ops, EmitNodeInfo);
       } else {
-        // NodeToMatch was eliminated by CSE when the target changed the DAG.
-        // We will visit the equivalent node later.
-        DEBUG(dbgs() << "Node was eliminated by CSE\n");
-        return;
+        assert(NodeToMatch->getOpcode() != ISD::DELETED_NODE &&
+               "NodeToMatch was removed partway through selection");
+        Res = MorphNode(NodeToMatch, TargetOpc, VTList, Ops, EmitNodeInfo);
       }
 
       // If the node had chain/glue results, update our notion of the current