http://llvm.org/bugs/show_bug.cgi?id=16332
Bug ID: 16332
Summary: Vectorize loops with multiple exits
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Loop Optimizer
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
ICC can vectorize this loop, and this kind of loop is not uncommon:
int foo(int max, int *arr) {
int i;
for (i = 0; i < max; i++)
if (arr[i] != 0) break;
return i;
}
Looks simple but is quite impressive. I'm not sure how it decides that
widenening the load in the loop is legal.
The kernel becomes a pcmpeqd + movmskps + testl, with a bsf on the exit to get
the right return value.
--
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