summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-09 11:56:01 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-09 11:56:01 +0000
commit93ff2447ecc8eda32052f160df790e8de5251e1c (patch)
tree5a3521ea7aff8cceaad508ebe55f647a60a2519e /llvm
parent6bb5c06e170f803659c14e91614801fce0fc7ef4 (diff)
downloadbcm5719-llvm-93ff2447ecc8eda32052f160df790e8de5251e1c.tar.gz
bcm5719-llvm-93ff2447ecc8eda32052f160df790e8de5251e1c.zip
Switch SROA to pop Uses off the back of its visitors' queues.
This will more closely match the behavior of the new PtrUseVisitor that I am adding. Hopefully this will not change the actual behavior in any way, but by making the processing order more similar help in debugging. llvm-svn: 169697
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Transforms/Scalar/SROA.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp
index cb9838ef674..a4b8b47a674 100644
--- a/llvm/lib/Transforms/Scalar/SROA.cpp
+++ b/llvm/lib/Transforms/Scalar/SROA.cpp
@@ -522,11 +522,10 @@ public:
/// \brief Run the builder over the allocation.
bool operator()() {
- // Note that we have to re-evaluate size on each trip through the loop as
- // the queue grows at the tail.
- for (unsigned Idx = 0; Idx < Queue.size(); ++Idx) {
- U = Queue[Idx].U;
- Offset = Queue[Idx].Offset;
+ while (!Queue.empty()) {
+ U = Queue.back().U;
+ Offset = Queue.back().Offset;
+ Queue.pop_back();
if (!visit(cast<Instruction>(U->getUser())))
return false;
}
@@ -851,11 +850,10 @@ public:
/// \brief Run the builder over the allocation.
void operator()() {
- // Note that we have to re-evaluate size on each trip through the loop as
- // the queue grows at the tail.
- for (unsigned Idx = 0; Idx < Queue.size(); ++Idx) {
- U = Queue[Idx].U;
- Offset = Queue[Idx].Offset;
+ while (!Queue.empty()) {
+ U = Queue.back().U;
+ Offset = Queue.back().Offset;
+ Queue.pop_back();
this->visit(cast<Instruction>(U->getUser()));
}
}
OpenPOWER on IntegriCloud