<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div><br></div>This patch is to replace sub+cmp with X86ISD::SUB when possible, it does not touch the decision of whether we should use 'cmp+jmp' or 'cmov'.<div>I don't recall having discussions on performance of 'cmp+jmp' vs. 'cmov' :)</div><div><br></div><div>Thanks,</div><div>Manman</div><div><br><div><div>On May 29, 2012, at 11:41 AM, Chandler Carruth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Tue, May 29, 2012 at 11:33 AM, 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-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<br>
Hi All,<br>
<br>
This patch is to generalize an earlier patch (r155919), it will handle the following cases where we can remove a CMP:<br></blockquote><div><br></div><div>Forgive me, but my memory has failed me: did we ever resolve the issue of having a system to predicate this on whether the 'cmp+jmp' is actually faster than cmov? I know we discussed the problems surrounding this with your last patch, but I don't recall seeing any real solutions being put in place.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  (a >|>=|<|<= b) ? (a-b) : any<br>
  (a >|>=|<|<= b) ? any : (a-b)<br>
  (b >|>=|<|<= a) ? (a-b) : any<br>
  (b >|>=|<|<= a) ? any : (a-b)<br>
<br>
A corresponding optimization on ARM was implemented in peephole pass.<br>
<br>
Thanks,<br>
Manman<br>
<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>
<br></blockquote></div><br>
</blockquote></div><br></div></body></html>