Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/passes/RedundantSetElimination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
//

#include <cfg/cfg-traversal.h>
#include <cfg/rpo.h>
#include <ir/literal-utils.h>
#include <ir/numbering.h>
#include <ir/properties.h>
#include <ir/utils.h>
#include <pass.h>
#include <support/small_set.h>
#include <support/unique_deferring_queue.h>
#include <wasm-builder.h>
#include <wasm.h>

Expand All @@ -58,6 +58,10 @@ namespace {

// information in a basic block
struct Info {
// For RPOQueue
bool inQueue;
Index index;

LocalValues start, end; // the local values at the start and end of the block
std::vector<Expression**> items;
};
Expand Down Expand Up @@ -221,11 +225,9 @@ struct RedundantSetElimination
end[i] = unseenValue;
}
}
// keep working while stuff is flowing. we use a unique deferred queue
// which ensures both FIFO and that we don't do needless work - if
// A and B reach C, and both queue C, we only want to do C at the latest
// time, when we have information from all those reaching it.
UniqueDeferredQueue<BasicBlock*> work;
// Keep working while stuff is flowing, in reverse-postorder so that we
// reach code after its predecessors, avoiding wasted recomputation.
RPOQueue<RedundantSetElimination> work(*this);
work.push(entry);
while (!work.empty()) {
auto* curr = work.pop();
Expand Down
Loading