<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 7, 2014 at 2:24 PM, Quentin Colombet <span dir="ltr"><<a href="mailto:qcolombet@apple.com" target="_blank">qcolombet@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>I agree with Andy and Jim.</div><div>Actually, I have prototyped a compiler that does exactly this kind of promotion in CodeGenPrepare.</div>
<div>Basically, I have updated the addressing mode matcher so that it moves a sext that is in a way of an addressing mode (i.e., it promotes the operand of the sext, let us call this operand def, if it is legal to do so, and sign extends the operands of def). When the matcher does not manage to absorb more computation after promoting def, it can revert the promotion.</div>
<div><br></div><div>I am currently benchmarking this solution and I’ll update this thread with the results.</div></blockquote></div><br>Very cool. Could you share the patch? I can also run some benchmarks.</div></div>