[llvm-commits] Trampoline changes

Duncan Sands baldrick at free.fr
Mon Sep 17 03:45:31 PDT 2007


Hi Chris,

> > My hope was that some of these trampoline calls could be eliminated  
> > using this optimization.  But for
> > that to happen, the routines in the container library have to be  
> > small enough to be inlined.  They are
> > not.  In fact they're rather small in terms of lines of code, but  
> > exception handling etc really bulks
> > up the LLVM bitcode making the inliner pass them over.
> 
> It would be pretty straight-forward to implement an IPO pass that  
> turns trampoline pointers into fat pointers in cases like this.

that's a very interesting idea.  It sounds hard to an LLVM minnow like
myself though :)

> It sounds like it could be a big win for the container library, because  
> the container (if the routines get marked internal) would  
> automatically be converted to take fat pointers, even if there are  
> multiple different trampolines being passed in.

Yes, it would be pretty nice.  But how feasible is it?  Surely it will
only work well if we can find out all or at least most of the places that
the trampoline function pointer gets passed to.  This requires effective
alias analysis, but currently alias analysis doesn't seem up to it.  For
example, the use of exception handling blows away alias info (due to the
eh intrinsics using IntrWriteMem) but almost all Ada code has eh in it.
Likewise, the init_trampoline intrinsic itself blocks effective alias
analysis.

Best wishes,

Duncan.



More information about the llvm-commits mailing list