[PATCH] D43198: [DAG] Enforce stricter NodeId invariant during Instruction selection

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 9 11:25:44 PST 2018


jyknight added a comment.

Looks overall reasonable. Is there any performance impact of EnforceNodeIdInvariant?



================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:985
+      if (UId > 0) {
+        U->setNodeId(-1 * UId);
+        Nodes.push_back(U);
----------------
Don't want to conflict with existing usage of -1, right? How about `(-UId) -1`?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:3028
   case ISD::AssertZext:
-    CurDAG->ReplaceAllUsesOfValueWith(SDValue(NodeToMatch, 0),
-                                      NodeToMatch->getOperand(0));
+    ReplaceUses(SDValue(NodeToMatch, 0), NodeToMatch->getOperand(0));
     CurDAG->RemoveDeadNode(NodeToMatch);
----------------
Why not ReplaceNode?


Repository:
  rL LLVM

https://reviews.llvm.org/D43198





More information about the llvm-commits mailing list