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/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:
16 : RWPass(man, "lower_matrix_highlevel") {}
17
18 /// custom rewrite function
19 /// memoized version of rewrite_
20 Ref rewrite(Ref) override;
22
23private:
24 Def2Def rewritten;
25};
26
27} // namespace mim::plug::matrix
An optimizer that combines several optimizations in an optimal way.
Definition pass.h:107
PassMan & man()
Definition pass.h:30
Inherit from this class using CRTP, if your Pass does not need state and a fixed-point iteration.
Definition pass.h:220
Helper class to retrieve Infer::arg if present.
Definition def.h:86
Resolves lowering of high level operations into medium/other high-level operations.
Ref rewrite(Ref) override
custom rewrite function memoized version of rewrite_
The matrix Plugin
Definition matrix.h:9
DefMap< const Def * > Def2Def
Definition def.h:60