<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Sep 3, 2014 at 1:24 PM, Tilmann Scheller <span dir="ltr"><<a href="mailto:t.scheller@samsung.com" target="_blank">t.scheller@samsung.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
attached is the following patch:<br>
<br>
[PATCH] [InstCombine] Attempt to eliminate redundant loads whose addresses are dependent on the result of a select instruction.<br>
<br>
If both values have already been loaded into registers the load becomes redundant and can be replaced with a select on the two values instead, e.g. we can do the following transformation:<br>
<br>
a = (load (gep idx_a))<br>
b = (load (gep idx_b))<br>
c = (load (gep (select (cond, idx_a, idx_b))))<br>
  --><br>
a = (load (gep idx_a))<br>
b = (load (gep idx_b))<br>
c = (select (cond, a, b))<br>
<br>
<br>
<br>
This particular pattern occurs in the hottest loop of 175.vpr from SPEC CPU2000. Haven't done any measurements yet but I would assume it improves performance (GCC is doing the above optimization and is ~10% faster on ARM)<br>

<br>
This is my first patch for InstCombine, feedback welcome :)<br></blockquote><div><br></div><div>Hi Tilmann,</div><div><br></div><div>I don't think this a natural place to do this, I'm of the opinion that we should try to get GVN to do this sort of thing.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Regards,<br>
<br>
Tilmann<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></div></div>