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#include <mim/pass/pass.h>
5#include <mim/phase/phase.h>
6
7namespace mim::plug::matrix {
8
9/// In this phase, we lower all matrix operations and types to the low-level representation using pointers.
10/// The matrix type is replaced by a pointer to n nested arrays.
11/// - `init` is replaced with `alloc`
12/// - `read` becomes `lea+load`
13/// - `insert` becomes `lea+store`
14/// - `constMat` becomes `alloc+pack+store`
15
17public:
19 : RWPhase(world, "lower_matrix_lowlevel") {}
20
21 Ref rewrite_imm(Ref) override;
22
23private:
24 Def2Def rewritten;
25};
26
27} // namespace mim::plug::matrix
Visits the current Phase::world and constructs a new RWPhase::world along the way.
Definition phase.h:52
World & world()
Definition phase.h:58
Helper class to retrieve Infer::arg if present.
Definition def.h:85
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:33
In this phase, we lower all matrix operations and types to the low-level representation using pointer...
The matrix Plugin
Definition matrix.h:8
DefMap< const Def * > Def2Def
Definition def.h:59