mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
Change std::deque => std::vector. No functionality change.
There is no reason to use std::deque here over std::vector. Thus given the performance differences inbetween the two it makes sense to change deque to vector. llvm-svn: 196524
This commit is contained in:
parent
f3138b60c3
commit
f2e7969964
@ -26,7 +26,7 @@
|
|||||||
#include "llvm/Support/RecyclingAllocator.h"
|
#include "llvm/Support/RecyclingAllocator.h"
|
||||||
#include "llvm/Target/TargetLibraryInfo.h"
|
#include "llvm/Target/TargetLibraryInfo.h"
|
||||||
#include "llvm/Transforms/Utils/Local.h"
|
#include "llvm/Transforms/Utils/Local.h"
|
||||||
#include <deque>
|
#include <vector>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
STATISTIC(NumSimplify, "Number of instructions simplified or DCE'd");
|
STATISTIC(NumSimplify, "Number of instructions simplified or DCE'd");
|
||||||
@ -552,7 +552,7 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
|
|||||||
|
|
||||||
|
|
||||||
bool EarlyCSE::runOnFunction(Function &F) {
|
bool EarlyCSE::runOnFunction(Function &F) {
|
||||||
std::deque<StackNode *> nodesToProcess;
|
std::vector<StackNode *> nodesToProcess;
|
||||||
|
|
||||||
TD = getAnalysisIfAvailable<DataLayout>();
|
TD = getAnalysisIfAvailable<DataLayout>();
|
||||||
TLI = &getAnalysis<TargetLibraryInfo>();
|
TLI = &getAnalysis<TargetLibraryInfo>();
|
||||||
@ -570,7 +570,7 @@ bool EarlyCSE::runOnFunction(Function &F) {
|
|||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
|
|
||||||
// Process the root node.
|
// Process the root node.
|
||||||
nodesToProcess.push_front(
|
nodesToProcess.push_back(
|
||||||
new StackNode(AvailableValues, AvailableLoads, AvailableCalls,
|
new StackNode(AvailableValues, AvailableLoads, AvailableCalls,
|
||||||
CurrentGeneration, DT->getRootNode(),
|
CurrentGeneration, DT->getRootNode(),
|
||||||
DT->getRootNode()->begin(),
|
DT->getRootNode()->begin(),
|
||||||
@ -583,7 +583,7 @@ bool EarlyCSE::runOnFunction(Function &F) {
|
|||||||
while (!nodesToProcess.empty()) {
|
while (!nodesToProcess.empty()) {
|
||||||
// Grab the first item off the stack. Set the current generation, remove
|
// Grab the first item off the stack. Set the current generation, remove
|
||||||
// the node from the stack, and process it.
|
// the node from the stack, and process it.
|
||||||
StackNode *NodeToProcess = nodesToProcess.front();
|
StackNode *NodeToProcess = nodesToProcess.back();
|
||||||
|
|
||||||
// Initialize class members.
|
// Initialize class members.
|
||||||
CurrentGeneration = NodeToProcess->currentGeneration();
|
CurrentGeneration = NodeToProcess->currentGeneration();
|
||||||
@ -597,7 +597,7 @@ bool EarlyCSE::runOnFunction(Function &F) {
|
|||||||
} else if (NodeToProcess->childIter() != NodeToProcess->end()) {
|
} else if (NodeToProcess->childIter() != NodeToProcess->end()) {
|
||||||
// Push the next child onto the stack.
|
// Push the next child onto the stack.
|
||||||
DomTreeNode *child = NodeToProcess->nextChild();
|
DomTreeNode *child = NodeToProcess->nextChild();
|
||||||
nodesToProcess.push_front(
|
nodesToProcess.push_back(
|
||||||
new StackNode(AvailableValues,
|
new StackNode(AvailableValues,
|
||||||
AvailableLoads,
|
AvailableLoads,
|
||||||
AvailableCalls,
|
AvailableCalls,
|
||||||
@ -607,7 +607,7 @@ bool EarlyCSE::runOnFunction(Function &F) {
|
|||||||
// It has been processed, and there are no more children to process,
|
// It has been processed, and there are no more children to process,
|
||||||
// so delete it and pop it off the stack.
|
// so delete it and pop it off the stack.
|
||||||
delete NodeToProcess;
|
delete NodeToProcess;
|
||||||
nodesToProcess.pop_front();
|
nodesToProcess.pop_back();
|
||||||
}
|
}
|
||||||
} // while (!nodes...)
|
} // while (!nodes...)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user