MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
lower_matrix_lowlevel.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#include <mim/phase/phase.h>
7
8namespace mim::plug::matrix {
9
10/// In this phase, we lower all matrix operations and types to the low-level representation using pointers.
11/// The matrix type is replaced by a pointer to n nested arrays.
12/// - `init` is replaced with `alloc`
13/// - `read` becomes `lea+load`
14/// - `insert` becomes `lea+store`
15/// - `constMat` becomes `alloc+pack+store`
16
18public:
20 : RWPhase(world, "lower_matrix_lowlevel") {}
21
22 const Def* rewrite_imm_App(const App*) override;
23
24private:
25 Def2Def rewritten;
26};
27
28} // namespace mim::plug::matrix
Base class for all Defs.
Definition def.h:251
RWPhase(World &world, std::string name)
Definition phase.h:73
World & world()=delete
Hides both and forbids direct access.
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:36
const Def * rewrite_imm_App(const App *) override
The matrix Plugin
Definition matrix.h:7
DefMap< const Def * > Def2Def
Definition def.h:75