MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
dispatch_normalize.h
Go to the documentation of this file.
1#pragma once
2
3#include "mim/phase.h"
4#include "mim/tuple.h"
5
6namespace mim {
7
8/// Normalizes Dispatch%es: η-expands non-Lam targets so that every target of a `(t_0, ..., t_n)#index`
9/// jump table is a Lam, as later phases and the backends expect.
10class DispatchNormalize : public RWPhase {
11public:
12 using RWPhase::RWPhase;
13
14private:
15 const Def* rewrite_mut_Lam(Lam*) final;
16 /// η-expands the targets of @p sw to Lam%s, recursively.
17 const Def* normalize(Switch sw);
18 const Def* eta_expand(const Def*);
19};
20
21} // namespace mim
Base class for all Defs.
Definition def.h:289
Normalizes Dispatches: η-expands non-Lam targets so that every target of a (t_0, ....
const Def * rewrite_mut_Lam(Lam *) final
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition phase.h:334
A function.
Definition lam.h:91
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition phase.h:334
Matches a jump table (target_0, target_1, ...)#index where index is a non-Literal Idx n and n the ari...
Definition tuple.h:408
Definition ast.h:16