[LLVMdev] inlining hint

Dale Johannesen dalej at apple.com
Wed Aug 26 11:30:37 PDT 2009


On Aug 26, 2009, at 11:18 AMPDT, Dan Gohman wrote:
> For this reason, I'm actually somewhat surprised that you're adding
> this hint, because you'll still need heuristics to find functions to
> inline that aren't hinted, and to ignore hints on functions which
> aren't good candidates. Are you aiming to create inlining heuristics
> modeled after those of another compiler? If so, should the answer be
> "whatever that other compiler does?"

Not necessarily, I'm going to be experimenting.  A compiler can't  
possibly do optimal inlining without help, since the right inlining  
choices depend heavily on which calls and functions actually get  
executed, and the compiler can't know that.  The inline hint is there  
in the languages so the inliner can give higher priority to inlining  
functions so marked; it seems advisable to make it available to our  
inliner.  It may be that people misuse it so badly that it's  
ineffective, although I doubt that.




More information about the llvm-dev mailing list