<div dir="ltr">Seems hard in CostModel. I cannot come up with any instruction (e.g. GEP) that triggers negative scales (unless element sizes can be negative). <div><br></div><div>This bug was triggered at <a href="http://llvm.org/docs/doxygen/html/LoopStrengthReduce_8cpp_source.html#l01022">http://llvm.org/docs/doxygen/html/LoopStrengthReduce_8cpp_source.html#l01022</a>. isAMCompletelyFolded considered some SCEV in the form "reg - reg" free. LSR seems the only place that computes addressing mode from SCEV where negative scales are possible. I am trying to write an LSR test that can expose this bug. </div><div><br></div><div>Jingyue</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 6, 2015 at 11:52 AM, <a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a> <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Re: Testing, it might be nice to put this into lib/Analysis/CostModel.cpp and then add a test in test/Analysis/CostModel/no_info.ll<br>
<br>
<br>
<a href="http://reviews.llvm.org/D9536" target="_blank">http://reviews.llvm.org/D9536</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</blockquote></div><br></div></div>