[PATCH] Propagate DAG node ordering during legalization and instruction selection

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Mar 18 13:04:51 PDT 2013


On Mar 15, 2013, at 10:51 AM, Justin Holewinski <justin.holewinski at gmail.com> wrote:

> Thanks Jakob!
> 
> Modified patch attached.  Anyone adverse to this change?

+
+  // Propagate ordering
+  unsigned Order = DAG.GetOrdering(Op.getNode());
+  DAG.AssignOrdering(Lo.getNode(), Order);
+  DAG.AssignOrdering(Hi.getNode(), Order);
 
Did you consider what happens when CSE kicks in? The new nodes may not be new, they could have been CSE'ed with an existing expression.

When that happens, the ordering should be the earlier of the two.

I think it would make sense to teach the SDNodeOrdering class about this.

/jakob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130318/96a936f2/attachment.html>


More information about the llvm-commits mailing list