http://llvm.org/bugs/show_bug.cgi?id=6931

           Summary: Substandard performance of fibonacci example code
           Product: new-bugs
           Version: 2.6
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


I compiled this simple example:

#include <stdlib.h>
#include <stdio.h>

int fib(int AnArg) {
 if (AnArg <= 2) return (1);
 return (fib(AnArg-1)+fib(AnArg-2));
}

int main(int argc, char* argv[]) {
 int n = atoi(argv[1]);
 printf("fib(%i)=%i\n", n, fib(n));
}

with llvm-2.6 with gcc frontend.

Runtime with argument 45 is ~4.3sec.
Runtime of mainstream gcc compiled code is always below 4 sec (3.4-3.9sec).

This is a very basic example and should produce a very optimal code.

Intel(R) Core(TM) i7 CPU       @ 9200 @ 2.67GHz

-- 
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

Reply via email to