http://llvm.org/bugs/show_bug.cgi?id=19157
Bug ID: 19157
Summary: Bad O2,O3 optimization in some cases
Product: new-bugs
Version: 3.3
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
I have two almost similar programs 1.bc and 2.bc which generated by crystal:
https://gist.github.com/kostya/c1748e5dde4aefa4cb14
and perfomance for both should be the same, but:
/usr/lib/llvm-3.3/bin/opt 1.bc -o 1.obc -O3 && /usr/lib/llvm-3.3/bin/llc 1.obc
-o 1.s && gcc -c 1.s -o 1.o && gcc 1.o -o 1 -lm -lpcre -lgc -lrt -lunwind &&
./1
1.42804
/usr/lib/llvm-3.3/bin/opt 2.bc -o 2.obc -O3 && /usr/lib/llvm-3.3/bin/llc 2.obc
-o 2.s && gcc -c 2.s -o 2.o && gcc 2.o -o 2 -lm -lpcre -lgc -lrt -lunwind &&
./2
0.321645
1.bc 4.4 times slower than 2.bc with O3.
But if i add: -scalarrepl -instcombine, it became the same:
/usr/lib/llvm-3.3/bin/opt 1.bc -o 1.obc -O3 -scalarrepl -instcombine &&
/usr/lib/llvm-3.3/bin/llc 1.obc -o 1.s && gcc -c 1.s -o 1.o && gcc 1.o -o 1
-lm -lpcre -lgc -lrt -lunwind && ./1
0.310694
/usr/lib/llvm-3.3/bin/opt 2.bc -o 2.obc -O3 -scalarrepl -instcombine &&
/usr/lib/llvm-3.3/bin/llc 2.obc -o 2.s && gcc -c 2.s -o 2.o && gcc 2.o -o 2
-lm -lpcre -lgc -lrt -lunwind && ./2
0.317292
--
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