[LLVMbugs] [Bug 21065] New: Similar loops are not always vectorized

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 25 01:07:17 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21065

            Bug ID: 21065
           Summary: Similar loops are not always vectorized
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: calixte.denizet at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The generated IR (with clang -O3) from this code:

#include <stdlib.h>

void foo(double * d, unsigned int size)
{
    for (unsigned int i = 0; i < size; ++i)
    {
    d[i] += 1; 
    }
}

void bar(unsigned int size)
{
    double * d = malloc(size * sizeof(double));
    for (unsigned int i = 0; i < size; ++i)
    {
    d[i] += 1; 
    }
    foobar(d);
}

void oof(unsigned int size)
{
    double * d = malloc(size * sizeof(double));
    foo(d, size);
    foobar(d);
}

shows that the loop in foo is vectorized but not in bar.
The call to foo in oof has been inlined but the vectorization has been removed.

-- 
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/20140925/5ffc21e7/attachment.html>


More information about the llvm-bugs mailing list