[LLVMbugs] [Bug 2981] New: Vector logic does not get optimized

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Oct 29 18:22:19 PDT 2008


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

           Summary: Vector logic does not get optimized
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicolas at capens.net
                CC: llvmbugs at cs.uiuc.edu


The attached testcase contains a logical and operation that does not get
optimized away. Here's the code in 'pseudo vector C':

void foo(int4 *in, int count, int4 *out)
{
    int4 x = *in;
    int4 a[1];
    a[0] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};

    int t = 0;

    for(int i = 0; i < count; i++)
    {
        x = x & a[t];   // Optimize me

        *out = x;
    }
}

The combination of the array and the loop somehow stop LLVM from eliminating
the and operation. Replacing the vectors by scalars does optimize it away
though. So possibly some code isn't treating scalars and vectors equally for
this type of optimization. I suspect that several other vector operations don't
get fully optimized either.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list