<div dir="ltr"><div><div><div>I wrote a pass that does exactly that a few days ago. Maybe a small difference in my pass is that I kill all definitions with store instructions right before the terminator instruction.<br><br>

</div>Another problem with my pass is that some optimizations right before ISel can introduce a few instructions between the stores. I solved that with a machine function pass that reorders the instructions.<br><br></div>

<div>This is the original thread in the llvm-dev list: <a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-April/072024.html">http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-April/072024.html</a><br></div><div><br></div>

Just out of curiosity, what is your target architecture?<br><br></div>ronaldo<br><div><div><div><br><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-30 17:03 GMT+02:00 Francois Pichet <span dir="ltr"><<a href="mailto:pichet2000@gmail.com" target="_blank">pichet2000@gmail.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>On my target, grouping load/store together almost always gives better performance even if it increases register pressure. </div>

<div><br></div><div>Basically I want code like this:</div>
  load r1, addr1<div>  instr r1, x, y</div><div>  store addr2 r1</div><div>  load r1, addr3<br></div><div><div>  instr r1, x, y</div><div>  store addr4 r1</div></div><div><br></div><div>to be rewritten as:</div><div>  load r1, addr1<div>


  load r2, addr3<br></div><div></div><div>  instr r1, x, y</div><div>  instr r2, x, y<br></div><div></div><div>  store addr2, r1</div><div>  store addr4, r2<br></div></div><div><br></div><div>I enabled the AggressiveAntiDepBreaker pass and it actually works for a lot of case but not always.  </div>


<div>What would be the best way to guarantee that load/store are grouped and executed together? </div><div><br></div><div>Thanks,<br></div><div>Francois Pichet, Octasic.</div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>