MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
lower_matrix_highlevel.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/def.h>
4#include <mim/pass.h>
5
6namespace mim::plug::matrix {
7
8/// Resolves lowering of high level operations into medium/other high-level operations.
9/// Some of these transformations could be done as normalizer.
10/// We rewrite matrix operations like sum, transpose, and product into `map_reduce` operations.
11/// The corresponding `map_reduce` operation is looked up as `internal_mapRed_matrix_[name]`.
12
13class LowerMatrixHighLevelMapRed : public RWPass<LowerMatrixHighLevelMapRed, Lam> {
14public:
17
18 /// custom rewrite function
19 /// memoized version of rewrite_
20 const Def* rewrite(const Def*) override;
21 const Def* rewrite_(const Def*);
22
23private:
24 Def2Def rewritten;
25};
26
27} // namespace mim::plug::matrix
Base class for all Defs.
Definition def.h:251
RWPass(World &world, std::string name)
Definition pass.h:295
World & world()
Definition pass.h:64
flags_t annex() const
Definition pass.h:68
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:36
const Def * rewrite(const Def *) override
custom rewrite function memoized version of rewrite_
The matrix Plugin
Definition matrix.h:7
DefMap< const Def * > Def2Def
Definition def.h:75
u64 flags_t
Definition types.h:45