[LLVMbugs] [Bug 14719] New: LoopVectorizer does not detect that calloc and one of the parameters don't alias

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 26 11:39:49 PST 2012


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: unassignedbugs at nondot.org
        ReportedBy: nrotem at apple.com
                CC: llvmbugs at cs.uiuc.edu
    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.



More information about the llvm-bugs mailing list