<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Vectorization of a group of interleaved-stores with gaps using masked-vector-store is not supported"
   href="https://bugs.llvm.org/show_bug.cgi?id=50566">50566</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Vectorization of a group of interleaved-stores with gaps using masked-vector-store is not supported
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Loop Optimizer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dorit.nuzman@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Compiling the following:

void test(short *p, int n, int xoffset, int yoffset) {
    #pragma clang loop vectorize(enable)
     for( int i=0;i<n;i++){
       p[i*4] += xoffset;
       p[i*4 + 1] += yoffset;
     }
}

with: 
Clang -O2 -mllvm -enable-interleaved-mem-accesses -mllvm
-enable-masked-interleaved-mem-accesses

The vectorizer identifies the interleaved-loads-group and
interleaved-stores-group:

LV: We can vectorize this loop!
LV: Analyzing interleaved accesses...
LV: Creating an interleave group with:  store i16 %conv7, i16 * %arrayidx4,
align 2
LV: Inserted:  store i16 %conv1, i16 * %arrayidx, align 2
    into the interleave group with  store i16 %conv7, i16 )* %arrayidx4, align
2
LV: Creating an interleave group with:  %3 = load i16, i16 * %arrayidx4, align
2
LV: Inserted:  %2 = load i16, i16 * %arrayidx, align 2
    into the interleave group with  %3 = load i16, i16 * %arrayidx4, align 2

…but while it can support the loads as an interleaved-group, it cannot support
the stores as an interleaved-group:

LV: Invalidate candidate interleaved store group due to gaps.
LV: Interleaved group requires epilogue iteration.

…and so we have to resort to vectorizing the loop using scatter /
scalarization. 

At the time <a href="https://reviews.llvm.org/D53668">https://reviews.llvm.org/D53668</a> added support for vectorizing a
group of interleaved-loads with gaps using a masked wide-load, but support for
the symmetric case of stores is still missing.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>