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