mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-23 02:32:11 +00:00
Use std::vector<DFCalculateWorkObject> instead of
std::vector<DFCalculateWorkObject *> to reduce malloc/free traffic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35368 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f589ef25cc
commit
9be98dd9c0
@ -455,13 +455,12 @@ DominanceFrontier::calculate(const DominatorTree &DT,
|
|||||||
BasicBlock *BB = Node->getBlock();
|
BasicBlock *BB = Node->getBlock();
|
||||||
DomSetType *Result = NULL;
|
DomSetType *Result = NULL;
|
||||||
|
|
||||||
std::vector<DFCalculateWorkObject *> workList;
|
std::vector<DFCalculateWorkObject> workList;
|
||||||
std::set<BasicBlock *> visited;
|
std::set<BasicBlock *> visited;
|
||||||
|
|
||||||
DFCalculateWorkObject *W = new DFCalculateWorkObject(BB, NULL, Node, NULL);
|
workList.push_back(DFCalculateWorkObject(BB, NULL, Node, NULL));
|
||||||
workList.push_back(W);
|
|
||||||
do {
|
do {
|
||||||
DFCalculateWorkObject *currentW = workList.back();
|
DFCalculateWorkObject *currentW = &workList.back();
|
||||||
assert (currentW && "Missing work object.");
|
assert (currentW && "Missing work object.");
|
||||||
|
|
||||||
BasicBlock *currentBB = currentW->currentBB;
|
BasicBlock *currentBB = currentW->currentBB;
|
||||||
@ -494,9 +493,7 @@ DominanceFrontier::calculate(const DominatorTree &DT,
|
|||||||
DominatorTree::Node *IDominee = *NI;
|
DominatorTree::Node *IDominee = *NI;
|
||||||
BasicBlock *childBB = IDominee->getBlock();
|
BasicBlock *childBB = IDominee->getBlock();
|
||||||
if (visited.count(childBB) == 0) {
|
if (visited.count(childBB) == 0) {
|
||||||
DFCalculateWorkObject *newW =
|
workList.push_back(DFCalculateWorkObject(childBB, currentBB, IDominee, currentNode));
|
||||||
new DFCalculateWorkObject(childBB, currentBB, IDominee, currentNode);
|
|
||||||
workList.push_back(newW);
|
|
||||||
visitChild = true;
|
visitChild = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user