summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-04-18 05:25:43 +0000
committerOwen Anderson <resistor@mac.com>2007-04-18 05:25:43 +0000
commitfb4b3d117f66643a23bb086a7f5d5b3fcea9e482 (patch)
tree2459f0a7b0df42d41e6d247366405242f8a596ad /lib/Transforms
parent9e7919785ee375540a67622fa19f7d10592c3351 (diff)
downloadllvm-fb4b3d117f66643a23bb086a7f5d5b3fcea9e482.tar.gz
llvm-fb4b3d117f66643a23bb086a7f5d5b3fcea9e482.tar.bz2
llvm-fb4b3d117f66643a23bb086a7f5d5b3fcea9e482.tar.xz
Use ETForest instead of DominatorTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/CorrelatedExprs.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Transforms/Scalar/CorrelatedExprs.cpp b/lib/Transforms/Scalar/CorrelatedExprs.cpp
index 9a28c5e8ef..d42dd9a7e2 100644
--- a/lib/Transforms/Scalar/CorrelatedExprs.cpp
+++ b/lib/Transforms/Scalar/CorrelatedExprs.cpp
@@ -224,14 +224,12 @@ namespace {
std::map<Value*, unsigned> RankMap;
std::map<BasicBlock*, RegionInfo> RegionInfoMap;
ETForest *EF;
- DominatorTree *DT;
public:
virtual bool runOnFunction(Function &F);
// We don't modify the program, so we preserve all analyses
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<ETForest>();
- AU.addRequired<DominatorTree>();
AU.addRequiredID(BreakCriticalEdgesID);
};
@@ -302,7 +300,6 @@ bool CEE::runOnFunction(Function &F) {
// tree. Note that our traversal will not even touch unreachable basic
// blocks.
EF = &getAnalysis<ETForest>();
- DT = &getAnalysis<DominatorTree>();
std::set<BasicBlock*> VisitedBlocks;
bool Changed = TransformRegion(&F.getEntryBlock(), VisitedBlocks);
@@ -349,14 +346,16 @@ bool CEE::TransformRegion(BasicBlock *BB, std::set<BasicBlock*> &VisitedBlocks){
// blocks that are dominated by this one, we can safely propagate the
// information down now.
//
- DominatorTree::Node *BBN = (*DT)[BB];
- if (!RI.empty()) // Time opt: only propagate if we can change something
- for (unsigned i = 0, e = BBN->getChildren().size(); i != e; ++i) {
- BasicBlock *Dominated = BBN->getChildren()[i]->getBlock();
- assert(RegionInfoMap.find(Dominated) == RegionInfoMap.end() &&
+ std::vector<BasicBlock*> children;
+ EF->getChildren(BB, children);
+ if (!RI.empty()) { // Time opt: only propagate if we can change something
+ for (std::vector<BasicBlock*>::iterator CI = children.begin(), E = children.end();
+ CI != E; ++CI) {
+ assert(RegionInfoMap.find(*CI) == RegionInfoMap.end() &&
"RegionInfo should be calculated in dominanace order!");
- getRegionInfo(Dominated) = RI;
+ getRegionInfo(*CI) = RI;
}
+ }
// Now that all of our successors have information if they deserve it,
// propagate any information our terminator instruction finds to our
@@ -379,8 +378,9 @@ bool CEE::TransformRegion(BasicBlock *BB, std::set<BasicBlock*> &VisitedBlocks){
}
// Now that all of our successors have information, recursively process them.
- for (unsigned i = 0, e = BBN->getChildren().size(); i != e; ++i)
- Changed |= TransformRegion(BBN->getChildren()[i]->getBlock(),VisitedBlocks);
+ for (std::vector<BasicBlock*>::iterator CI = children.begin(), E = children.end();
+ CI != E; ++CI)
+ Changed |= TransformRegion(*CI, VisitedBlocks);
return Changed;
}