MimIR 0.1
MimIR is my Intermediate Representation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
lower_matrix_highlevel.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/def.h>
4
5#include <mim/pass/pass.h>
6
7namespace mim::plug::matrix {
8
9/// Resolves lowering of high level operations into medium/other high-level operations.
10/// Some of these transformations could be done as normalizer.
11/// We rewrite matrix operations like sum, transpose, and product into `map_reduce` operations.
12/// The corresponding `map_reduce` operation is looked up as `internal_mapRed_matrix_[name]`.
13
14class LowerMatrixHighLevelMapRed : public RWPass<LowerMatrixHighLevelMapRed, Lam> {
15public:
17 : RWPass(man, "lower_matrix_highlevel") {}
18
19 /// custom rewrite function
20 /// memoized version of rewrite_
21 const Def* rewrite(const Def*) override;
22 const Def* rewrite_(const Def*);
23
24private:
25 Def2Def rewritten;
26};
27
28} // namespace mim::plug::matrix
Base class for all Defs.
Definition def.h:197
PassMan & man()
Definition pass.h:30
friend class PassMan
Definition pass.h:101
RWPass(PassMan &man, std::string_view name)
Definition pass.h:222
const Def * rewrite(const Def *) override
custom rewrite function memoized version of rewrite_
The matrix Plugin
Definition matrix.h:9
DefMap< const Def * > Def2Def
Definition def.h:47