summaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-09-26 23:51:19 +0000
committerDevang Patel <dpatel@apple.com>2008-09-26 23:51:19 +0000
commit2c9c3e73682749016d5885b67ff719f634b37d58 (patch)
treeee745b3e5a1a68cb4e954c3fdfe482b355be0d8f /lib/Transforms
parente7261863c56240a55c6f57062f0e1e028dc27dba (diff)
downloadexternal_llvm-2c9c3e73682749016d5885b67ff719f634b37d58.zip
external_llvm-2c9c3e73682749016d5885b67ff719f634b37d58.tar.gz
external_llvm-2c9c3e73682749016d5885b67ff719f634b37d58.tar.bz2
Implement function notes as function attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/IPO/InlineAlways.cpp2
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp2
-rw-r--r--lib/Transforms/IPO/Inliner.cpp3
-rw-r--r--lib/Transforms/Scalar/LoopUnswitch.cpp2
-rw-r--r--lib/Transforms/Utils/InlineCost.cpp2
5 files changed, 6 insertions, 5 deletions
diff --git a/lib/Transforms/IPO/InlineAlways.cpp b/lib/Transforms/IPO/InlineAlways.cpp
index 448f246..1079c4a 100644
--- a/lib/Transforms/IPO/InlineAlways.cpp
+++ b/lib/Transforms/IPO/InlineAlways.cpp
@@ -63,7 +63,7 @@ bool AlwaysInliner::doInitialization(CallGraph &CG) {
for (Module::iterator I = M.begin(), E = M.end();
I != E; ++I)
- if (!I->isDeclaration() && !I->hasNote(Attribute::AlwaysInline))
+ if (!I->isDeclaration() && !I->hasFnAttr(Attribute::AlwaysInline))
NeverInline.insert(I);
return false;
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index b19494a..02cae2a 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/lib/Transforms/IPO/InlineSimple.cpp
@@ -65,7 +65,7 @@ bool SimpleInliner::doInitialization(CallGraph &CG) {
for (Module::iterator I = M.begin(), E = M.end();
I != E; ++I)
- if (!I->isDeclaration() && I->hasNote(Attribute::NoInline))
+ if (!I->isDeclaration() && I->hasFnAttr(Attribute::NoInline))
NeverInline.insert(I);
// Get llvm.noinline
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index abc1094..c267272 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -141,7 +141,8 @@ bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) {
int CurrentThreshold = InlineThreshold;
Function *Fn = CS.getCaller();
- if (Fn && !Fn->isDeclaration() && Fn->hasNote(Attribute::OptimizeForSize)
+ if (Fn && !Fn->isDeclaration()
+ && Fn->hasFnAttr(Attribute::OptimizeForSize)
&& InlineThreshold != 50) {
CurrentThreshold = 50;
}
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp
index 15eaa78..fbfe297 100644
--- a/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -430,7 +430,7 @@ bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val){
Function *F = loopHeader->getParent();
// Do not unswitch if the function is optimized for size.
- if (!F->isDeclaration() && F->hasNote(Attribute::OptimizeForSize))
+ if (!F->isDeclaration() && F->hasFnAttr(Attribute::OptimizeForSize))
return false;
// Check to see if it would be profitable to unswitch current loop.
diff --git a/lib/Transforms/Utils/InlineCost.cpp b/lib/Transforms/Utils/InlineCost.cpp
index 55755c1..d0b5185 100644
--- a/lib/Transforms/Utils/InlineCost.cpp
+++ b/lib/Transforms/Utils/InlineCost.cpp
@@ -222,7 +222,7 @@ int InlineCostAnalyzer::getInlineCost(CallSite CS,
if (CalleeFI.NeverInline)
return 2000000000;
- if (!Callee->isDeclaration() && Callee->hasNote(Attribute::AlwaysInline))
+ if (!Callee->isDeclaration() && Callee->hasFnAttr(Attribute::AlwaysInline))
return -2000000000;
// Add to the inline quality for properties that make the call valuable to