[LLVMbugs] [Bug 15077] New: Should not vectorize variable shifts when no instructions for it are available

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jan 26 11:33:49 PST 2013


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

             Bug #: 15077
           Summary: Should not vectorize variable shifts when no
                    instructions for it are available
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: benny.kra at gmail.com
                CC: llvmbugs at cs.uiuc.edu, nrotem at apple.com
    Classification: Unclassified


We vectorize (and then scalarize) the following loop:

void test(unsigned *codes, const char *lens, unsigned num) {
  for (unsigned i = 0; i < num; i++)
    codes[i] = codes[i] >> lens[i];
}

TTI thinks the shift is cheap because constant shifts are cheap on X86. It has
no way of knowing that variable shifts are in fact very expensive operations.

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