At the moment CallPenalty is fixed to the value 25.
The patch introduces a knob '-call-penalty' to provide custom values to CallPenalty.
Details
Diff Detail
- Build Status
Buildable 4735 Build 4735: arc lint + arc unit
Event Timeline
include/llvm/Analysis/InlineCost.h | ||
---|---|---|
80 | It seems kind of weird to return the CallPenalty here... but I guess you need it in lib/Transforms/IPO/Inliner.cpp? | |
92 | Using INT_MIN and INT_MAX seems like it's just asking for trouble with overflow... but I guess we don't actually use it in that case? Seems better to just use 0. | |
lib/Analysis/InlineCost.cpp | ||
1235 | The call penalty should be the same for every callsite; we shouldn't need to update it here... unless you're planning to change that? |
include/llvm/Analysis/InlineCost.h | ||
---|---|---|
80 | Yes, this is because of Inliner.cpp.
What about having it in TTI? | |
92 | I used zeros in the initial version. Then I thought if I could use some values which could protect from incorrect uses. Like -infinity penalty means no penalty and no inline. +infinity means a lot of penalty and always inline. | |
lib/Analysis/InlineCost.cpp | ||
1235 | As I wrote above if the penalty is a part of InlineParams it can be different per a call. So we need to update the current value based on the value passed through InlineParams. |
lib/Transforms/IPO/Inliner.cpp | ||
---|---|---|
292 | r286814 subtracts CallPenalty while computing the inline cost (which is returned by IC.getCost()), but this code is not updated to reflect that. I think CandidateCost should be IC.getCost() - 1, which will eliminate the need for IC.getCallPenalty(). |
lib/Transforms/IPO/Inliner.cpp | ||
---|---|---|
292 | Thank you for information. It makes things simpler. I'll have a look at this. |
It seems kind of weird to return the CallPenalty here... but I guess you need it in lib/Transforms/IPO/Inliner.cpp?