"with constant values");
namespace {
struct VISIBILITY_HIDDEN GCSE : public FunctionPass {
- static const char ID; // Pass identifcation, replacement for typeid
+ static char ID; // Pass identification, replacement for typeid
GCSE() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F);
// This transformation requires dominator and immediate dominator info
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesCFG();
- AU.addRequired<ETForest>();
AU.addRequired<DominatorTree>();
AU.addRequired<ValueNumbering>();
}
};
- const char GCSE::ID = 0;
+ char GCSE::ID = 0;
RegisterPass<GCSE> X("gcse", "Global Common Subexpression Elimination");
}
bool Changed = false;
// Get pointers to the analysis results that we will be using...
- ETForest &EF = getAnalysis<ETForest>();
- ValueNumbering &VN = getAnalysis<ValueNumbering>();
DominatorTree &DT = getAnalysis<DominatorTree>();
+ ValueNumbering &VN = getAnalysis<ValueNumbering>();
std::vector<Value*> EqualValues;
// Traverse the CFG of the function in dominator order, so that we see each
// instruction after we see its operands.
- for (df_iterator<DominatorTree::Node*> DI = df_begin(DT.getRootNode()),
+ for (df_iterator<DomTreeNode*> DI = df_begin(DT.getRootNode()),
E = df_end(DT.getRootNode()); DI != E; ++DI) {
BasicBlock *BB = DI->getBlock();
if (OtherI->getParent() == BB)
Dominates = BlockInsts.count(OtherI);
else
- Dominates = EF.dominates(OtherI->getParent(), BB);
+ Dominates = DT.dominates(OtherI->getParent(), BB);
if (Dominates) {
// Okay, we found an instruction with the same value as this one