MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
lower.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/phase.h>
4
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`.
14class Lower : public RWPhase {
15public:
18
19private:
20 const Def* rewrite_imm_App(const App*) final;
21
22 const Def* lower_via_impl(const App*, const Def* impl_annex);
23};
24
25} // namespace mim::plug::tensor::phase
Base class for all Defs.
Definition def.h:261
flags_t annex() const
Definition phase.h:81
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition phase.h:316
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 *) final
Definition lower.cpp:33
Lower(World &world, flags_t annex)
Definition lower.h:16
u64 flags_t
Definition types.h:39