projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes
[oota-llvm.git]
/
lib
/
Transforms
/
Utils
/
PromoteMemoryToRegister.cpp
diff --git
a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index 6f220f8604239af963c08035074d8421332f70c6..bbb131fabfb7a39920f0734432bd85694be0d899 100644
(file)
--- a/
lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/
lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@
-29,9
+29,6
@@
using namespace std;
using namespace std;
-
-using cfg::DominanceFrontier;
-
namespace {
//instance of the promoter -- to keep all the local function data.
namespace {
//instance of the promoter -- to keep all the local function data.
@@
-141,8
+138,8
@@
bool PromoteInstance::PromoteFunction(Function *F, DominanceFrontier & DF) {
DominanceFrontier::DomSetType s = (*it).second;
for (DominanceFrontier::DomSetType::iterator p = s.begin();p!=s.end(); ++p)
{
DominanceFrontier::DomSetType s = (*it).second;
for (DominanceFrontier::DomSetType::iterator p = s.begin();p!=s.end(); ++p)
{
- if (queuePhiNode(
(BasicBlock *)
*p, i))
-
PhiNodes[i].push_back((BasicBlock *)
*p);
+ if (queuePhiNode(*p, i))
+
PhiNodes[i].push_back(
*p);
}
}
// perform iterative step
}
}
// perform iterative step
@@
-152,8
+149,8
@@
bool PromoteInstance::PromoteFunction(Function *F, DominanceFrontier & DF) {
DominanceFrontier::DomSetType s = it->second;
for (DominanceFrontier::DomSetType::iterator p = s.begin(); p!=s.end(); ++p)
{
DominanceFrontier::DomSetType s = it->second;
for (DominanceFrontier::DomSetType::iterator p = s.begin(); p!=s.end(); ++p)
{
- if (queuePhiNode(
(BasicBlock *)
*p,i))
- PhiNodes[i].push_back(
(BasicBlock*)
*p);
+ if (queuePhiNode(*p,i))
+ PhiNodes[i].push_back(*p);
}
}
}
}
}
}
@@
-309,22
+306,20
@@
bool PromoteInstance::queuePhiNode(BasicBlock *bb, int i /*the alloca*/)
namespace {
namespace {
- struct PromotePass : public
Method
Pass {
+ struct PromotePass : public
Function
Pass {
- // runOn
Method
- To run this pass, first we calculate the alloca
+ // runOn
Function
- To run this pass, first we calculate the alloca
// instructions that are safe for promotion, then we promote each one.
//
// instructions that are safe for promotion, then we promote each one.
//
- virtual bool runOn
Method
(Function *F) {
+ virtual bool runOn
Function
(Function *F) {
return (bool)PromoteInstance(F, getAnalysis<DominanceFrontier>());
}
return (bool)PromoteInstance(F, getAnalysis<DominanceFrontier>());
}
- // getAnalysisUsage
Info
- We need dominance frontiers
+ // getAnalysisUsage - We need dominance frontiers
//
//
- virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Requires,
- Pass::AnalysisSet &Destroyed,
- Pass::AnalysisSet &Provided) {
- Requires.push_back(DominanceFrontier::ID);
+ virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.addRequired(DominanceFrontier::ID);
}
};
}
}
};
}