<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>True, the relative order is the same, but the code that sorts the availability list (src_ls_rr_sort::operator()) is sensitive to base 0.</div><div><br></div><div><font face="Courier New">// Prefer an ordering where the lower the non-zero order number, the higher</font></div><div><font face="Courier New">// the preference.<br>if ((LOrder || ROrder) && LOrder != ROrder)<br> return LOrder != 0 && (LOrder < ROrder || ROrder == 0);</font></div><div><br></div><div>LOrder and/or ROrder can be 0 if the IR Order is 0 or if there is no SDNode associated with the scheduling unit. Considering that 0 seems to indicate a special case, reseting IR Order to 0 doesn’t seem to be a good idea and maybe it should be reset to 1. Another solution would be to change the above code to be insensitive to base 0. What do you think?</div><div><br></div><div>In general resting IR base still seems to be a good for the reason you mentioned before.</div><div><br></div><div>-Juergen</div><div><br></div><br><div><div>On Nov 17, 2013, at 5:09 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">----- Original Message -----<br><blockquote type="cite">From: "Juergen Ributzka" <<a href="mailto:juergen@apple.com">juergen@apple.com</a>><br>To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>><br>Cc: "LLVM Commits" <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>><br>Sent: Sunday, November 17, 2013 1:02:37 AM<br>Subject: Re: [PATCH][DAG] Fix non-deterministic code generation<br><br>Hi Hal,<br><br>the availability queue in the list scheduler returns the nodes in IR<br>order. If there is more than one node ready to schedule, then the<br>difference in the IR order will produce different schedules.<br></blockquote><br>Maybe I'm missing something, but that does not seem to explain the problem. The relative order of the nodes should be the same whether the first node starts with 0 or 29348.<br><br>It seems like we should do this anyway (or make the counter 64 bits). For one thing, on really large inputs, the current 32-bit counter could wrap (which would certainly produce this problem). But you're seeing some other issue here.<br><br>-Hal<br><br><blockquote type="cite"><br>-Juergen<br><br>On Nov 16, 2013, at 10:40 PM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br><br><blockquote type="cite">Juergen,<br><br>Do you happen to know what in CodeGen is sensitive to the absolute<br>value of the node order?<br><br>-Hal<br><br>----- Original Message -----<br><blockquote type="cite">From: "Juergen Ributzka" <<a href="mailto:juergen@apple.com">juergen@apple.com</a>><br>To: "LLVM Commits" <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>><br>Sent: Saturday, November 16, 2013 11:04:29 PM<br>Subject: [PATCH][DAG] Fix non-deterministic code generation<br><br><br><br>Hi @ll,<br><br>this patch resets SDNodeOrder in the SelectionDAGBuilder before<br>processing the IR of a new function. This is required to obtain<br>deterministic code generation for a function regardless of its<br>location in the source file.<br><br>Cheers,<br>Juergen<br><br><br><br><br><br><br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br><br></blockquote><br>--<br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<br></blockquote><br><br></blockquote><br>--<span class="Apple-converted-space"> </span><br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory</div></blockquote></div><br></body></html>