https://bugs.llvm.org/show_bug.cgi?id=43924
Bug ID: 43924
Summary: Loop peeling from the end of the loop
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Loop Optimizer
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
As noted in https://bugs.llvm.org/show_bug.cgi?id=43892
we currently only peel from the front of the loop.
But we could also peel from the end:
https://godbolt.org/z/bcVXc_
void sink();
void cleanup();
void bad(int num) {
for(int i = 0; i < num; ++i) {
if(i+1 == num)
cleanup();
sink();
}
}
void good(int num) {
if(num <= 0)
return;
for(int i = 0; i < num; ++i)
sink();
cleanup();
}
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs