MimIR
0.4-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
lower.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
mim/phase.h
>
4
5
namespace
mim::plug::tensor::phase
{
6
7
/// Lowers the high-level tensor axioms into the low-level tensor axioms (`map_reduce`, …).
8
/// Each high-level axiom comes with a matching `*_impl` annex (a
9
/// `lam` with the same signature as the axiom); the lowering simply re-applies the args
10
/// to the `_impl` annex. Each `_impl` body references the `_impl` variants of its
11
/// dependencies, so the chain of beta-reductions bottoms out at the low-level axioms in
12
/// one step. The resulting low-level axioms are then lowered to primitives by
13
/// `LowerMapReduce`.
14
class
Lower
:
public
RWPhase
{
15
public
:
16
Lower
(
World
&
world
,
flags_t
annex
)
17
:
RWPhase
(
world
,
annex
) {}
18
19
private
:
20
const
Def
*
rewrite_imm_App
(
const
App
*)
final
;
21
22
const
Def
* lower_via_impl(
const
App
*,
const
Def
* impl_annex);
23
/// `tensor.fastest_axis` applied to the dot family's right operand (of the given rank):
24
/// the reflection the dot `_impl`s take as their leading argument, pre-applied here because the
25
/// operand is only concrete at this staging point. The schedule decision built on the answer
26
/// stays in the `_impl`'s IR (see tensor.dot_product_impl).
27
const
Def
* fastest_axis_2(
const
App
*,
const
Def
* rank);
28
};
29
30
}
// namespace mim::plug::tensor::phase
mim::App
Definition
lam.h:224
mim::Def
Base class for all Defs.
Definition
def.h:273
mim::Phase::annex
flags_t annex() const
Definition
phase.h:81
mim::RWPhase::RWPhase
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition
phase.h:431
mim::RWPhase::world
World & world()=delete
Hides both and forbids direct access.
mim::World
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition
world.h:40
mim::plug::tensor::phase::Lower::rewrite_imm_App
const Def * rewrite_imm_App(const App *) final
Definition
lower.cpp:35
mim::plug::tensor::phase::Lower::Lower
Lower(World &world, flags_t annex)
Definition
lower.h:16
mim::plug::tensor::phase
Definition
constraints.h:5
mim::flags_t
u64 flags_t
Definition
types.h:39
phase.h
include
mim
plug
tensor
phase
lower.h
Generated by
1.18.0