forked from OSchip/llvm-project
NewGVN: Kill unneeded DFSDomMap, cleanup a few comments.
llvm-svn: 291981
This commit is contained in:
parent
b8344ce668
commit
b66164ca34
|
@ -238,7 +238,6 @@ class NewGVN : public FunctionPass {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// DFS info.
|
// DFS info.
|
||||||
DenseMap<const BasicBlock *, std::pair<int, int>> DFSDomMap;
|
|
||||||
DenseMap<const Value *, unsigned> InstrDFS;
|
DenseMap<const Value *, unsigned> InstrDFS;
|
||||||
SmallVector<Value *, 32> DFSToInstr;
|
SmallVector<Value *, 32> DFSToInstr;
|
||||||
|
|
||||||
|
@ -1422,7 +1421,6 @@ void NewGVN::cleanupTables() {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
ProcessedCount.clear();
|
ProcessedCount.clear();
|
||||||
#endif
|
#endif
|
||||||
DFSDomMap.clear();
|
|
||||||
InstrDFS.clear();
|
InstrDFS.clear();
|
||||||
InstructionsToErase.clear();
|
InstructionsToErase.clear();
|
||||||
|
|
||||||
|
@ -1887,10 +1885,9 @@ void NewGVN::convertDenseToDFSOrdered(
|
||||||
assert(BB && "Should have figured out a basic block for value");
|
assert(BB && "Should have figured out a basic block for value");
|
||||||
ValueDFS VD;
|
ValueDFS VD;
|
||||||
|
|
||||||
std::pair<int, int> DFSPair = DFSDomMap[BB];
|
DomTreeNode *DomNode = DT->getNode(BB);
|
||||||
assert(DFSPair.first != -1 && DFSPair.second != -1 && "Invalid DFS Pair");
|
VD.DFSIn = DomNode->getDFSNumIn();
|
||||||
VD.DFSIn = DFSPair.first;
|
VD.DFSOut = DomNode->getDFSNumOut();
|
||||||
VD.DFSOut = DFSPair.second;
|
|
||||||
VD.Val = D;
|
VD.Val = D;
|
||||||
// If it's an instruction, use the real local dfs number.
|
// If it's an instruction, use the real local dfs number.
|
||||||
if (auto *I = dyn_cast<Instruction>(D))
|
if (auto *I = dyn_cast<Instruction>(D))
|
||||||
|
@ -1900,7 +1897,7 @@ void NewGVN::convertDenseToDFSOrdered(
|
||||||
|
|
||||||
DFSOrderedSet.emplace_back(VD);
|
DFSOrderedSet.emplace_back(VD);
|
||||||
|
|
||||||
// Now add the users.
|
// Now add the uses.
|
||||||
for (auto &U : D->uses()) {
|
for (auto &U : D->uses()) {
|
||||||
if (auto *I = dyn_cast<Instruction>(U.getUser())) {
|
if (auto *I = dyn_cast<Instruction>(U.getUser())) {
|
||||||
ValueDFS VD;
|
ValueDFS VD;
|
||||||
|
@ -1915,9 +1912,9 @@ void NewGVN::convertDenseToDFSOrdered(
|
||||||
IBlock = I->getParent();
|
IBlock = I->getParent();
|
||||||
VD.LocalNum = InstrDFS[I];
|
VD.LocalNum = InstrDFS[I];
|
||||||
}
|
}
|
||||||
std::pair<int, int> DFSPair = DFSDomMap[IBlock];
|
DomTreeNode *DomNode = DT->getNode(IBlock);
|
||||||
VD.DFSIn = DFSPair.first;
|
VD.DFSIn = DomNode->getDFSNumIn();
|
||||||
VD.DFSOut = DFSPair.second;
|
VD.DFSOut = DomNode->getDFSNumOut();
|
||||||
VD.U = &U;
|
VD.U = &U;
|
||||||
DFSOrderedSet.emplace_back(VD);
|
DFSOrderedSet.emplace_back(VD);
|
||||||
}
|
}
|
||||||
|
@ -2081,9 +2078,6 @@ bool NewGVN::eliminateInstructions(Function &F) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DomTreeNode *Node = DT->getNode(&B);
|
|
||||||
if (Node)
|
|
||||||
DFSDomMap[&B] = {Node->getDFSNumIn(), Node->getDFSNumOut()};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (CongruenceClass *CC : CongruenceClasses) {
|
for (CongruenceClass *CC : CongruenceClasses) {
|
||||||
|
|
Loading…
Reference in New Issue