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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to