[llvm] r271699 - SDAG: Replace some unreachable code with an assert. NFC

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 11:09:53 PDT 2016


Author: bogner
Date: Fri Jun  3 13:09:53 2016
New Revision: 271699

URL: http://llvm.org/viewvc/llvm-project?rev=271699&view=rev
Log:
SDAG: Replace some unreachable code with an assert. NFC

The current node shouldn't be (and isn't) removed partway through
selection.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=271699&r1=271698&r2=271699&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Jun  3 13:09:53 2016
@@ -3365,13 +3365,10 @@ void SelectionDAGISel::SelectCodeCommon(
                                                              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




More information about the llvm-commits mailing list