<div class="gmail_quote">On Tue, May 29, 2012 at 12:27 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">
<div style="word-wrap:break-word"><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>
</blockquote><div><br></div><div>Hmm, the oddity is that you do directly produce the CMOV ISD node. It looks like this will only fire on 'sub+cmp+cmov', not 'sub+cmp+jmp'. I suppose this is an artifact of this transform happening deep inside of the x86 backend, and so the decision of whether or not to use a branch vs. cmov has long since happened? Making sure I understand what you're doing here...</div>
<div><br></div><div>If I've understood this correctly, wouldn't that mean that the same logic will be needed again for code that emits the 'sub+cmp+jmp'? Is that already handled somewhere?</div><div><br></div>
<div>All in all, I'm agreeing with a comment on this bit of code: should this really be so specific? I'm seeing the possibility for a third copy of the core functionality here, it would be great if there were a way to put this into the dag-combine step, maybe even the target-independent dag-combine? Haven't thought much about the feasibility of that though...</div>
</div>