Skip to content

Commit

Permalink
Use const ref for list of stores to remove
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunderberg committed Aug 5, 2022
1 parent 5733fe7 commit 6bc63cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tir/transforms/remove_store_undef.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ class StoreUndefRemover : public StmtExprMutator {
public:
static Stmt Apply(Stmt stmt) {
auto to_remove = StoreUndefLocator::Locate(stmt);
StoreUndefRemover mutator(std::move(to_remove));
StoreUndefRemover mutator(to_remove);
return mutator(std::move(stmt));
}

private:
using Parent = StmtExprMutator;

explicit StoreUndefRemover(std::unordered_set<const BufferStoreNode*> to_remove)
explicit StoreUndefRemover(const std::unordered_set<const BufferStoreNode*>& to_remove)
: to_remove_(to_remove) {}

Stmt VisitStmt_(const BufferStoreNode* op) final {
Expand All @@ -114,7 +114,7 @@ class StoreUndefRemover : public StmtExprMutator {
}
}

std::unordered_set<const BufferStoreNode*> to_remove_;
const std::unordered_set<const BufferStoreNode*>& to_remove_;
};

// Remove any BufferStores whose value depends on T.undef
Expand Down

0 comments on commit 6bc63cb

Please sign in to comment.