<div dir="ltr">Are you taking into account critical path length? Because e.g. for:<div><br></div><div><div>%0:i64 = var</div><div>%1:i1 = slt 18446744073709551615:i64, %0</div><div>%2:i64 = subnsw 0:i64, %0</div><div>%3:i64 = select %1, %0, %2</div><div>infer %3</div><div>%4:i64 = ashr %0, 63:i64</div><div>%5:i64 = add %0, %4</div><div>%6:i64 = xor %5, %4</div><div>result %6</div></div><div><br></div><div>In the former case, the cmp and sub are independent, so can be executed in parallel, while in the latter case all 3 instructions are dependent. So the former case can execute in 2 cycles while the latter takes 3. Modern OoO chips do in fact exploit this kind of thing.</div><div><br></div><div>-- Sean Silva</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 22, 2015 at 10:15 AM, John Regehr <span dir="ltr"><<a href="mailto:regehr@cs.utah.edu" target="_blank">regehr@cs.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We (the folks working on Souper) would appreciate any feedback on these IR-level superoptimizer results:<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__blog.regehr.org_extra-5Ffiles_souper-2Djul-2D15.html&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=6De0yJXeg6TS2X1EdGaDqR44yS1CRqY6hHxOzzfrZ3U&s=UkFLJ5VNlSoUL1Ksh2cyIi282wJ2VuZsumc7-jl_x5A&e=" rel="noreferrer" target="_blank">http://blog.regehr.org/extra_files/souper-jul-15.html</a><br>
<br>
My impression is that while there's clearly plenty of material in here that doesn't want to get implemented in an opt pass, there are a number of gems hiding in there that are worth implementing.<br>
<br>
Blog post containing additional explanation and caveats is here:<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__blog.regehr.org_archives_1252&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=6De0yJXeg6TS2X1EdGaDqR44yS1CRqY6hHxOzzfrZ3U&s=_uj40d91fdAIeBhhLIvW9FkAaJXcjzYNjy95h4r8ENo&e=" rel="noreferrer" target="_blank">http://blog.regehr.org/archives/1252</a><br>
<br>
Thanks!<br>
<br>
John<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>