[LLVMdev] is this code really JITed and/or optimized ? ..

Valery A.Khamenya khamenya at mail.ru
Fri Aug 13 15:18:21 PDT 2004


Hi all,

(thanks to Reid, who gave nice advice) the fibonacci function code 
works now. Please find attached file.

but... the performance is adequate, say, for byte-code 
interpretation mode and not for optimized JITing.
fibonacci function of 35 from attached file is more
then 100 times slower then the following code compiled 
with "gcc -O2" :
-----------
#include <iostream>
int fib(int x) {
if(x<=2) return 1;
return fib(x-1)+fib(x-2);
}

int main(int argc, char**argv) {
  int n = argc > 1 ? atol(argv[1]) : 10;
  std::cout << fib(n) << "\n";
}
-----------

Where's the rake I step at?..

I guess the JIT was not really invoked or code was not optimized..

P.S. My best wishes to all countries at Olympiad 2004.
---
Valery A.Khamenya


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fibonacci.cpp
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040814/53a5746c/attachment.ksh>


More information about the llvm-dev mailing list