[llvm-commits] PATCH: Add InlineCost class

Chris Lattner clattner at apple.com
Tue Oct 28 22:54:39 PDT 2008


On Oct 28, 2008, at 8:05 PM, Daniel Dunbar wrote:

> The attached patch adds an InlineCost value class to wrap the costs  
> returned by Inliner::getInlineCost. The motivation is that it  
> encodes whether the cost equates to "always" inline or "never"  
> inline, instead of returning the magic constants -2000000000 and  
> 2000000000 respectively.
>
> Previously there were cases where always functions were not inlined  
> (in fact, it looked to me like the always inliner would almost never  
> work). Additionally, I am worried about cases where the fudge factor  
> computation overflows when using the large magic constants. With  
> this change the inliner is guaranteed to respect the "always" and  
> "never" requests.

Looks great to me!

-Chris



More information about the llvm-commits mailing list