<div dir="ltr"><div class="gmail_quote">On Wed, Apr 15, 2015 at 2:13 AM Nick Lewycky <<a href="mailto:nicholas@mxc.ca">nicholas@mxc.ca</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  So the criterial<br>
> deciding whether to do the merging for a case is to see whether<br>
> merging is beneficial. We want to find out all the important cases for<br>
> which gep merging is beneficial.<br>
<br>
My default assumption is that gep merging is beneficial; the cost<br>
metrics all assume that fewer instructions is better, your .bc will be<br>
smaller, your optimizations have fewer instructions to look through,<br>
some optimizations have limits on how many instructions they will look<br>
through, etc. We want to find out all the important cases for which gep<br>
merging is harmful, or find out which cases should have gep splitting.<br>
<br>
Put another way, if having these GEPs split apart is better then why<br>
doesn't the optimizer turn a single GEP into two when that's better?<br>
Only removing the optimization here can't be the right answer.<br></blockquote><div><br></div><div>I agree. As Hal said, I'm pretty worried about blocking merging in an ad-hoc way. It seems really likely to create limitations in every part of the optimizer that wants to look through things.</div><div><br></div><div>Unless we have a sufficiently strong heuristic to *split* GEPs, my suspicion is that we don't have the correct heuristic.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> Quentin mentioned the beneficial addressing mode case I didn't think<br>
> of before. And it is possible that I can filter out some testcases<br>
> from internal benchmarks. working on it right now.<br>
<br>
Sounds good! I've heard the addressing mode matching code is a pain, but<br>
if we could make it smarter I think that would be better. If you have a<br>
testcase where GEP merging causes a loss of performance then you also<br>
have a testcase where the addressing mode matcher is missing something,<br>
right?<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">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>
</blockquote></div></div>