[LLVMdev] Why the same code is much slower in JIT compared to separate executable?

Óscar Fuentes ofv at wanadoo.es
Thu Apr 29 13:08:46 PDT 2010


Yuri <yuri at tsoft.com> writes:

>> With
>>
>> time lli -O3 fib.bc 45
>>
>> you are measuring the time lli takes optimizing the LLVM code,
>> generating the native code and, finally, executing it. If you add to
>> this the debug asserts, it is not surprising that lli ends being quite a
>> bit slower than directly executing the native code
>
> You can see that this is not true running 'time lli -O3 fib.bc 4',
> which has exactly the same code. Compiler still compiles the same way,
> and it takes 0.00 user seconds.

You are right. The code is small enough to have any impact on the total
required time.

Try passing -print-machineinstrs to lli and compare the output with the
assembler generated by llc.



More information about the llvm-dev mailing list