<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, May 11, 2016 at 4:13 PM, Justin Bogner via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:</div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: bogner<br>
Date: Wed May 11 16:13:17 2016<br>
New Revision: 269236<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=269236&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=269236&view=rev</a><br>
Log:<br>
SDAG: Add a helper to replace and remove a node during ISel<br>
<br>
It's very common to want to replace a node and then remove it since<br>
it's dead, especially as we port backends from the SDNode *Select API<br>
to the void Select one. This helper makes this sequence a bit less<br>
verbose.<br></blockquote><div><br></div><div>I don't fully understand the context, but ...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-    ReplaceUses(SDValue(Node, 0), SDValue(CNode, 0));<br>
-    ReplaceUses(SDValue(Node, 1), SDValue(CNode, 1));<br>
+    ReplaceNode(Node, CNode);<br></blockquote><div><br></div><div>... this replaced sequence and ....</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
@@ -2152,9 +2150,7 @@ void X86DAGToDAGISel::Select(SDNode *Nod<br>
     SDValue Ops[] = {N1, InFlag};<br>
     SDNode *CNode = CurDAG->getMachineNode(Opc, dl, VTs, Ops);<br>
<br>
-    ReplaceUses(SDValue(Node, 0), SDValue(CNode, 0));<br>
-    ReplaceUses(SDValue(Node, 1), SDValue(CNode, 1));<br>
-    ReplaceUses(SDValue(Node, 2), SDValue(CNode, 2));<br>
+    ReplaceUses(Node, CNode);<br></blockquote><div><br></div><div>... this replaced sequence seem the same, but the latter wasn't</div><div>modified to use `ReplaceNode`.  Should it have been?</div></div><br><div>-- Meador</div>
</div></div>