MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
lower_map_reduce.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/phase.h>
4
6
7/// Lowers the low-level tensor axioms (`map_reduce`, `get`, `set`, `broadcast`)
8/// directly to their underlying primitives (loops, `extract`, `insert`, `pack`, …).
9/// High-level axioms like `broadcast_in_dim` or `product_2d` are expected to have
10/// been desugared to these low-level axioms by an earlier `Lower` phase.
11class LowerMapReduce : public RWPhase {
12public:
15
16private:
17 const Def* rewrite_imm_App(const App*) final;
18
19 const Def* lower_get(const App*);
20 const Def* lower_set(const App*);
21 const Def* lower_broadcast(const App*);
22 const Def* lower_map_reduce(const App*);
23 const Def* lower_map_reduce_aff(const App*);
24
25 const Def* rec_broadcast(const Def* s_in, const Def* s_out, const Def* input, u64 r, u64 i);
26};
27
28} // namespace mim::plug::tensor::phase
Base class for all Defs.
Definition def.h:246
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition phase.h:194
World & world()=delete
Hides both and forbids direct access.
flags_t annex() const
Definition pass.h:81
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:36
const Def * rewrite_imm_App(const App *) final
LowerMapReduce(World &world, flags_t annex)
u64 flags_t
Definition types.h:39
uint64_t u64
Definition types.h:27