FreeTensor
Loading...
Searching...
No Matches
normalize_loops.h
Go to the documentation of this file.
1#ifndef FREE_TENSOR_NORMALIZE_LOOPS_H
2#define FREE_TENSOR_NORMALIZE_LOOPS_H
3
4#include <functional>
5#include <unordered_set>
6
8#include <mutator.h>
9
10namespace freetensor {
11
12class NormalizeLoops : public SymbolTable<Mutator> {
14
15 std::function<bool(const For &)> filter_;
16 std::unordered_set<For> filteredIn_;
17
18 public:
19 NormalizeLoops(const std::function<bool(const For &)> &filter = nullptr)
20 : filter_(filter) {}
21
22 protected:
23 using BaseClass::visit;
24 Expr visit(const Var &op) override;
25 Stmt visit(const For &op) override;
26};
27
33Stmt normalizeLoops(const Stmt &op,
34 const std::function<bool(const For &)> &filter = nullptr);
35
36} // namespace freetensor
37
38#endif // FREE_TENSOR_NORMALIZE_LOOPS_H
Definition: normalize_loops.h:12
NormalizeLoops(const std::function< bool(const For &)> &filter=nullptr)
Definition: normalize_loops.h:19
Expr visit(const Var &op) override
Definition: normalize_loops.cc:6
Definition: symbol_table.h:122
BaseClass::StmtRetType visit(const VarDef &op) override
Definition: symbol_table.h:167
Definition: allocator.h:9
Ref< ForNode > For
Definition: stmt.h:308
std::vector< T > filter(const std::vector< T > &vec, const U &callback)
Definition: container_utils.h:131
Ref< StmtNode > Stmt
Definition: ast.h:152
Stmt normalizeLoops(const Stmt &op, const std::function< bool(const For &)> &filter=nullptr)
Definition: normalize_loops.cc:31