summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-01-21 12:05:16 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-01-21 12:05:16 +0000
commitb5da8a4ae1fbd8e4ffab06cfeb5b32a94d0381bb (patch)
treed180625087829332453519f20f4be11ddfff3985 /lib
parent8d6c0f4deeb0f2ff671df7ae92b75ee1e39acd37 (diff)
downloadexternal_llvm-b5da8a4ae1fbd8e4ffab06cfeb5b32a94d0381bb.zip
external_llvm-b5da8a4ae1fbd8e4ffab06cfeb5b32a94d0381bb.tar.gz
external_llvm-b5da8a4ae1fbd8e4ffab06cfeb5b32a94d0381bb.tar.bz2
Move the inline cost analysis's primary cost query to TTI instead of the
old CodeMetrics system. TTI has the specific advantage of being extensible and customizable by targets to reflect target-specific cost metrics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173032 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/InlineCost.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp
index 5c4e702..cd211c4 100644
--- a/lib/Analysis/InlineCost.cpp
+++ b/lib/Analysis/InlineCost.cpp
@@ -422,7 +422,7 @@ bool CallAnalyzer::visitPtrToInt(PtrToIntInst &I) {
if (lookupSROAArgAndCost(I.getOperand(0), SROAArg, CostIt))
SROAArgValues[&I] = SROAArg;
- return isInstructionFree(&I, TD);
+ return TargetTransformInfo::TCC_Free == TTI.getUserCost(&I);
}
bool CallAnalyzer::visitIntToPtr(IntToPtrInst &I) {
@@ -452,7 +452,7 @@ bool CallAnalyzer::visitIntToPtr(IntToPtrInst &I) {
if (lookupSROAArgAndCost(Op, SROAArg, CostIt))
SROAArgValues[&I] = SROAArg;
- return isInstructionFree(&I, TD);
+ return TargetTransformInfo::TCC_Free == TTI.getUserCost(&I);
}
bool CallAnalyzer::visitCastInst(CastInst &I) {
@@ -469,7 +469,7 @@ bool CallAnalyzer::visitCastInst(CastInst &I) {
// Disable SROA in the face of arbitrary casts we don't whitelist elsewhere.
disableSROA(I.getOperand(0));
- return isInstructionFree(&I, TD);
+ return TargetTransformInfo::TCC_Free == TTI.getUserCost(&I);
}
bool CallAnalyzer::visitUnaryInstruction(UnaryInstruction &I) {
@@ -782,7 +782,7 @@ bool CallAnalyzer::visitCallSite(CallSite CS) {
bool CallAnalyzer::visitInstruction(Instruction &I) {
// Some instructions are free. All of the free intrinsics can also be
// handled by SROA, etc.
- if (isInstructionFree(&I, TD))
+ if (TargetTransformInfo::TCC_Free == TTI.getUserCost(&I))
return true;
// We found something we don't understand or can't handle. Mark any SROA-able