http://llvm.org/bugs/show_bug.cgi?id=14567
Bug #: 14567
Summary: Regression in LLVM 3.2 RC2 on primes benchmark
Product: tools
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: opt
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
On this primes benchmark,
#include<stdio.h>
#include<math.h>
int main() {
int primes = 0, curri = 2;
while (primes < 100000) {
int ok = true;
for (int j = 2; j < sqrtf(curri); j++) {
if (curri % j == 0) {
ok = false;
break;
}
}
if (ok) {
primes++;
}
curri++;
}
printf("lastprime: %d.\\n", curri-1);
return 0;
}
LLVM 3.2 RC2 is more than twice as slow as LLVM 3.1 (both using -O2).
Looking at the IR, in LLVM 3.1 the sqrt is done outside of the loop it appears
in, but not in LLVM 3.2, so 3.2 ends up doing a lot more work.
--
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