aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/IPA/InlineCost.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-01-22 11:26:02 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-01-22 11:26:02 +0000
commit0ba8db45c63fc82279aefe0def2bc8d95429620b (patch)
tree6395a5644fb1eb42db62cd8054437484022090b8 /llvm/lib/Analysis/IPA/InlineCost.cpp
parent1e63b085757a47d2180f8acb4c0ce4ce40b233db (diff)
downloadllvm-0ba8db45c63fc82279aefe0def2bc8d95429620b.zip
llvm-0ba8db45c63fc82279aefe0def2bc8d95429620b.tar.gz
llvm-0ba8db45c63fc82279aefe0def2bc8d95429620b.tar.bz2
Begin fleshing out an interface in TTI for modelling the costs of
generic function calls and intrinsics. This is somewhat overlapping with an existing intrinsic cost method, but that one seems targetted at vector intrinsics. I'll merge them or separate their names and use cases in a separate commit. This sinks the test of 'callIsSmall' down into TTI where targets can control it. The whole thing feels very hack-ish to me though. I've left a FIXME comment about the fundamental design problem this presents. It isn't yet clear to me what the users of this function *really* care about. I'll have to do more analysis to figure that out. Putting this here at least provides it access to proper analysis pass tools and other such. It also allows us to more cleanly implement the baseline cost interfaces in TTI. With this commit, it is now theoretically possible to simplify much of the inline cost analysis's handling of calls by calling through to this interface. That conversion will have to happen in subsequent commits as it requires more extensive restructuring of the inline cost analysis. The CodeMetrics class is now really only in the business of running over a block of code and aggregating the metrics on that block of code, with the actual cost evaluation done entirely in terms of TTI. llvm-svn: 173148
Diffstat (limited to 'llvm/lib/Analysis/IPA/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/InlineCost.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/IPA/InlineCost.cpp b/llvm/lib/Analysis/IPA/InlineCost.cpp
index cd211c4..3292e00 100644
--- a/llvm/lib/Analysis/IPA/InlineCost.cpp
+++ b/llvm/lib/Analysis/IPA/InlineCost.cpp
@@ -736,7 +736,7 @@ bool CallAnalyzer::visitCallSite(CallSite CS) {
return false;
}
- if (!callIsSmall(CS)) {
+ if (TTI.isLoweredToCall(F)) {
// We account for the average 1 instruction per call argument setup
// here.
Cost += CS.arg_size() * InlineConstants::InstrCost;