1#ifndef FREE_TENSOR_ALL_USES_H
2#define FREE_TENSOR_ALL_USES_H
4#include <unordered_set>
24 bool noRecurseIdx_, noRecurseSubStmt_;
25 bool inFirstStmt_ =
false;
26 std::unordered_set<std::string> uses_;
30 : type_(type), noRecurseIdx_(noRecurseIdx),
31 noRecurseSubStmt_(noRecurseSubStmt) {}
33 const std::unordered_set<std::string> &
uses()
const {
return uses_; }
58std::unordered_set<std::string>
62 bool noRecurseIdx =
false,
bool noRecurseSubStmt =
false);
63inline std::unordered_set<std::string>
67 bool noRecurseIdx =
false) {
68 std::unordered_set<std::string> ret;
70 for (
auto &&use :
allUses(stmt, type, noRecurseIdx,
true)) {
84 bool noRecurseIdx =
false,
85 bool noRecurseSubStmt =
false) {
88inline std::unordered_set<std::string>
99inline std::unordered_set<std::string>
101 bool noRecurseSubStmt =
false) {
103 noRecurseIdx, noRecurseSubStmt);
105inline std::unordered_set<std::string>
118 bool noRecurseIdx =
false,
119 bool noRecurseSubStmt =
false) {
122inline std::unordered_set<std::string>
135 bool noRecurseIdx =
false,
136 bool noRecurseSubStmt =
false) {
140 noRecurseIdx, noRecurseSubStmt);
142inline std::unordered_set<std::string>
Definition: all_uses.h:14
static constexpr AllUsesType CHECK_REDUCE
Definition: all_uses.h:19
void visitStmt(const Stmt &s) override
Definition: all_uses.cc:5
AllUses(AllUsesType type, bool noRecurseIdx, bool noRecurseSubStmt)
Definition: all_uses.h:29
const std::unordered_set< std::string > & uses() const
Definition: all_uses.h:33
static constexpr AllUsesType CHECK_STORE
Definition: all_uses.h:18
int AllUsesType
Definition: all_uses.h:16
static constexpr AllUsesType CHECK_VAR
Definition: all_uses.h:20
void visit(const Load &op) override
Definition: all_uses.cc:14
static constexpr AllUsesType CHECK_LOAD
Definition: all_uses.h:17
Definition: allocator.h:9
std::unordered_set< std::string > allIters(const AST &op, bool noRecurseIdx=false, bool noRecurseSubStmt=false)
Definition: all_uses.h:117
std::unordered_set< std::string > allWrites(const AST &op, bool noRecurseIdx=false, bool noRecurseSubStmt=false)
Definition: all_uses.h:100
std::vector< T > filter(const std::vector< T > &vec, const U &callback)
Definition: container_utils.h:131
Ref< ASTNode > AST
Definition: ast.h:149
std::unordered_set< std::string > allUses(const AST &op, AllUses::AllUsesType type=AllUses::CHECK_LOAD|AllUses::CHECK_STORE|AllUses::CHECK_REDUCE, bool noRecurseIdx=false, bool noRecurseSubStmt=false)
Definition: all_uses.cc:52
std::unordered_set< std::string > allReads(const AST &op, bool noRecurseIdx=false, bool noRecurseSubStmt=false)
Definition: all_uses.h:83
std::unordered_set< std::string > allNames(const AST &op, bool noRecurseIdx=false, bool noRecurseSubStmt=false)
Definition: all_uses.h:134
std::vector< Stmt > findAllStmt(const Stmt &ast, const ID &id)
Definition: find_stmt.cc:32