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

             Bug #: 14719
           Summary: LoopVectorizer does not detect that calloc and one of
                    the parameters don't alias
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


The function below does not get vectorized because the loop vectorizer does not
detect that the calloc and the 'bytes' argument do not alias. The code in
"canvectorizememory" does not check for the case that one of the object is
identified while the other is not.  The bug was reported by gribozavr on irc. 

#include "stdint.h"

uint8_t *hexit(const uint8_t *bytes, uint64_t length)
{
    uint8_t *hexRep = calloc(sizeof(uint8_t), (length << 1) + 1);

    for (uint64_t i = 0; i < (length << 1); ++i) {
        uint8_t nibble = ((bytes[i >> 1] & (0x0F << (4 & ~((i & 0x1) << 2))))
>> (4 & ~((i & 0x1) << 2)));

        hexRep[i] = nibble + (nibble > 9 ? 'a' - 10 : '0');
    }
    return hexRep;
}

-- 
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