[LLVMdev] A faster instruction selector?[MESSAGE NOT SCANNED]

Dan Gohman gohman at apple.com
Thu Dec 18 11:24:55 PST 2008


On Dec 17, 2008, at 4:53 AM, Mark Shannon wrote:
> Choosing the fast selector does speed code-generation by almost  
> double,
> when using llc, but the reduction in final code speed is obviously a
> downside.
[...]
>
> Since my toolkit generates an interpreter, I am able to just compile
> hotspots, so final speed of compiled code is quite important.

I recommend doing some measurements here rather than
guessing.  I note that you've posted several numbers comparing
compile times with lcc, but no numbers comparing the quality of
the generated code yet :-).

>
>> Do you have time to do more detailed profiling? It might be  
>> interesting
>> to see which parts of codegen are hot in your use cases.
>
> Unfortunately I could get any meaningful information from valgrind  
> as to
> where llc is spending its time (Unknown code: 45%), but I suspect the
> relative slowness is caused by the number of intermediate data
> structures required and the time spent in creating them.

On some hosts LLVM defaults to being built with -fomit-frame-pointer,
and this interferes with some performance tools, so that's something
worth checking.

This would also be a good time to sanity check that you're using an
optimized build of LLVM, which can make a tremendous difference.
FWIW, the default mode for LLVM Makefiles is non-optimized.

> Finally, it must be possible to select the register allocator for the
> JIT using the API, but I am unable to find out how to do this, any  
> ideas?

See RegAllocRegistry.h and RegisterRegAlloc::setDefault.

Dan




More information about the llvm-dev mailing list