https://bugs.llvm.org/show_bug.cgi?id=34313
Bug ID: 34313
Summary: Unswitching does not catch opportunity with
-fexperimental-new-pass-manager
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Loop Optimizer
Assignee: chandl...@gmail.com
Reporter: stef...@ca.ibm.com
CC: llvm-bugs@lists.llvm.org
With the following test code:
int has_utf8 = 1;
const char AA[] = {
0, 1, 2, 3, 156, 9, 134, 17
};
int main() {
long i, count=0, num=22;
for (i=0; i<100000000; i++) {
num = i % 7;
if (!has_utf8 && AA[num] < 0x4)
count+=AA[num+1];
}
return count;
}
we can move the "if (!has_utf8)" outside of the loop and not run the loop at
all when has_utf8 = 1.
The opportunity is caught correctly with the old pass manager but not with the
new one.
Found with these options:
-m64 -mcpu=power8 -O3
Not found with these ones:
-m64 -mcpu=power8 -O3 -fexperimental-new-pass-manager
I did try the new unswitching pass from this patch:
https://reviews.llvm.org/D34200
but the compiler still did not find the opportunity.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs