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(const Def*) override;
23
24private:
25 Def2Def rewritten;
26};
27
28} // namespace mim::plug::matrix
Base class for all Defs.
Definition def.h:198
RWPhase(World &world, std::string_view name)
Definition phase.h:58
World & world()
Definition phase.h:62
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:33
const Def * rewrite_imm(const Def *) override
The matrix Plugin
Definition matrix.h:9
DefMap< const Def * > Def2Def
Definition def.h:48