[llvm-bugs] [Bug 40946] New: Missed Loop vectorization for global loop variants

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 4 01:52:29 PST 2019


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

            Bug ID: 40946
           Summary: Missed Loop vectorization for global loop variants
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: opt
          Assignee: unassignedbugs at nondot.org
          Reporter: balarishi.bhogadi at amd.com
                CC: llvm-bugs at lists.llvm.org

If the loop variant variables are functional parameters of point type, then
loop vectorizations happens.

But, When loop variant variables are global, loop vectorization is not taking
place.

===========

// Flag: -O3  -fno-unroll-loops -c 

char *a, *b, *c;

void loop_not_vectorized()
{
        for (int i = 0; i < 1800; i++) // Loop not vectorized
        {
                a[i] = b[i] * c[i];
        }

}

===========

// Flag: -O3  -fno-unroll-loops -c 

void loop_vectorized(char *a, char *b, char *c)
{
        for (int i = 0; i < 1800; i++) // Loop vectorized
        {
                a[i] = b[i] * c[i];
        }

}

===========

-- 
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/20190304/43161b4b/attachment.html>


More information about the llvm-bugs mailing list