[llvm-commits] PATCH: Add InlineCost class

Daniel Dunbar daniel at zuster.org
Tue Oct 28 20:05:28 PDT 2008


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.

 - Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081028/91aed14e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InlineCost.patch
Type: application/octet-stream
Size: 8741 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081028/91aed14e/attachment.obj>


More information about the llvm-commits mailing list