<div dir="ltr">Hi Joerg,<div><br></div><div>That's worth considering too. Right now this optimization is being conservative about the length of branch instructions (implicitly, since it's considering them prior to branch relaxation). Your scheme would allow us to take the exact length into account. This would reduce code size, though it won't effect the dynamic instruction count (since padding for shadows that cross control flow instructions is emitted after the control flow, and so is never executed).</div>
<div><br></div><div>Cheers,</div><div>Lang.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 25, 2014 at 1:34 AM, Joerg Sonnenberger <span dir="ltr"><<a href="mailto:joerg@britannica.bec.de" target="_blank">joerg@britannica.bec.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Thu, Jul 24, 2014 at 04:47:36PM -0700, Lang Hames wrote:<br>
> Oh - I remember now: Branch relaxation only runs during object emission. If<br>
> we waited until relaxation to fix the shadows, then the shadow optimization<br>
> wouldn't run when you're outputting assembly files. The idea that you could<br>
> get different output by passing -S vs -c seemed too non-obvious, so I came<br>
> up with the current solution.<br>
<br>
</div>One approach for that would be to introduce a pseudo op for this<br>
purpose. Given that any branch instruction on x86 is likely to depend on<br>
branch relaxation to be computed correctly, this might be the smallest<br>
evil. Put it under an option to just use the largest size when dealing<br>
with external assemblers?<br>
<div class="HOEnZb"><div class="h5"><br>
Joerg<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>
</div></div></blockquote></div><br></div>