<div dir="ltr">On 10 November 2013 06:48, 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>This is still strange: Why is this the only IR where 256 bit
      vectors are found and for all other functions it finds 128 bit
      vectors. This should be independent of the IR, right? So far I
      have tested a bunch of about 20 functions generated and vectorized
      with this method. When processing all but this one the loop
      vectorizer finds 128 bit vectors as the widest. Only for this IR
      the loop vectorizer 'sees' the 256 bit version. Any idea?</div></div></blockquote><div></div></div><br></div><div class="gmail_extra">Hi Frank,</div><div class="gmail_extra"><br></div><div class="gmail_extra">
The vectorization factor is computed depending on the type size and the ability to use instructions on the varying vector sizes, and that depends not only on the register width, but also on the available instructions on the target. Furthermore, the cost of operations is taken into account, so if the cost of shuffling/scattering 8 lanes might be twice as much as 4 lanes, and that might stop/redirect vectorization.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I don't know AVX that well, but it's possible that some operations are not available on 256-bit width vectors, so the vectorizer uses the least requirement, which in your other examples, was 128-bit.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">cheers,</div><div class="gmail_extra">--renato</div></div>