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
8
namespace
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
17
class
LowerMatrixLowLevel
:
public
RWPhase
{
18
public
:
19
LowerMatrixLowLevel
(
World
&
world
)
20
:
RWPhase
(
world
,
"lower_matrix_lowlevel"
) {}
21
22
const
Def
*
rewrite_imm
(
const
Def
*)
override
;
23
24
private
:
25
Def2Def
rewritten;
26
};
27
28
}
// namespace mim::plug::matrix
mim::Def
Base class for all Defs.
Definition
def.h:198
mim::RWPhase::RWPhase
RWPhase(World &world, std::string_view name)
Definition
phase.h:58
mim::RWPhase::world
World & world()
Definition
phase.h:62
mim::World
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition
world.h:33
mim::plug::matrix::LowerMatrixLowLevel::LowerMatrixLowLevel
LowerMatrixLowLevel(World &world)
Definition
lower_matrix_lowlevel.h:19
mim::plug::matrix::LowerMatrixLowLevel::rewrite_imm
const Def * rewrite_imm(const Def *) override
Definition
lower_matrix_lowlevel.cpp:59
def.h
mim::plug::matrix
The matrix Plugin
Definition
matrix.h:9
mim::Def2Def
DefMap< const Def * > Def2Def
Definition
def.h:48
pass.h
phase.h
include
mim
plug
matrix
pass
lower_matrix_lowlevel.h
Generated by
1.13.2