Please ping within the same thread... Pretty sure we already talked about this patch on another thread, but hard to remember.<div><br></div><div><br></div><div>Anyways, I'm not an x86 backend expert, but from my limited experience, I have some concerns with the patch as currently implemented. At a high level, it seems overly focused on the 'sub' instruction. Given the model of the EFLAGS set by each instruction, could you turn this into a generic optimization which tries to remove 'cmp' instructions (which have no side-effects other than to set EFLAGS) by using those flags set by arbitrary preceding instructions?</div>
<div><br></div><div>Also, I wonder if the backend should have a model for equivalent instruction forms where one does set EFLAGS and the other doesn't so that we can flip instructions back and forth as needed.</div><div>
<br></div><div>Finally, I feel like a lot of the large switches over instructions could be simplified by querying the nature of the EFLAGS usage, or some other shared aspect embedded in the instruction via the tablegen file.</div>
<div><br></div><div><br></div><div>A minor style nit-pick: the coding guidelines recommend 'camelCase' function and method names, not 'CamelCase'.</div><div><br></div><div><br><br><div class="gmail_quote">
On Wed, May 30, 2012 at 8:55 PM, Manman Ren <span dir="ltr"><<a href="mailto:mren@apple.com" target="_blank">mren@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
PING<br>
<div><div class="h5"><br>
On May 30, 2012, at 11:30 AM, Manman Ren wrote:<br>
<br>
><br>
> Hi All,<br>
><br>
> This patch optimizes away the redundant cmp instruction if there exists a sub instruction which produces the same EFLAGS.<br>
><br>
> Please review and provide feedback.<br>
><br>
> Thanks,<br>
> Manman<br>
><br>
</div></div>> <peephole_x86.patch><br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>