[llvm-bugs] [Bug 50566] New: Vectorization of a group of interleaved-stores with gaps using masked-vector-store is not supported

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 3 00:29:19 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50566

            Bug ID: 50566
           Summary: Vectorization of a group of interleaved-stores with
                    gaps using masked-vector-store is not supported
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: dorit.nuzman at intel.com
                CC: llvm-bugs at lists.llvm.org

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 https://reviews.llvm.org/D53668 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210603/ac196cb7/attachment-0001.html>


More information about the llvm-bugs mailing list