<div dir="ltr">On 31 October 2013 08:01, Frank Winter <span dir="ltr"><<a href="mailto:fwinter@jlab.org" target="_blank">fwinter@jlab.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div><pre>With current trunk I tried the following on the above example:

clang++ -emit-llvm -S loop_minimal.cc -std=c++11
opt -O3 -vectorize-slp -S loop_minimal.ll
opt -O3 -loop-vectorize -S loop_minimal.ll
opt -O3 -bb-vectorize -S loop_minimal.ll

All optimization passes miss the opportunity. It seems the SCEV AA pass doesn't understand modulo arithmetic.</pre></div></div></blockquote><div><br></div><div>Hi Frank,</div><div><br></div><div>IIRC, opt -O3 will already pass all three, so you don't have to add it to the command line.</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><div><pre>How can the SCEV AA pass be extended to handle this type of arithmetic?</pre>
</div></div></blockquote><div></div></div><br></div><div class="gmail_extra">I'm not an SCEV expert, so it might be possible that it does understand, but the loop vectorizer is not understanding the evolution info, or whatever.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">What I recommend is to step through the loop vectorizer (canVectorize) and see what the SCEV returns to the vectorizer. If the info is there, but not accounted for, it's a vectorizer bug. If the SCEV gets lost, than you need to add it into the SCEV logic.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">cheers,</div><div class="gmail_extra">--renato</div></div>