MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
tail_rec_elim.h
Go to the documentation of this file.
1#pragma once
2
3#include "mim/pass.h"
4
5namespace mim {
6
7class EtaRed;
8
9class TailRecElim : public FPPass<TailRecElim, Lam> {
10public:
13
14 void init(PassMan*) final;
15
16private:
17 /// @name PassMan hooks
18 ///@{
19 const Def* rewrite(const Def*) override;
20 undo_t analyze(const Def*) override;
21 ///@}
22
23 EtaRed* eta_red_;
24 LamMap<std::pair<Lam*, Lam*>> old2rec_loop_;
25 Lam2Lam rec2loop_;
26};
27
28} // namespace mim
Base class for all Defs.
Definition def.h:251
Performs η-reduction.
Definition eta_red.h:9
FPPass(World &world, std::string name)
Definition pass.h:323
An optimizer that combines several optimizations in an optimal way.
Definition pass.h:172
World & world()
Definition pass.h:64
flags_t annex() const
Definition pass.h:68
undo_t analyze(const Def *) override
void init(PassMan *) final
const Def * rewrite(const Def *) override
TailRecElim(World &world, flags_t annex)
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:32
Definition ast.h:14
u64 flags_t
Definition types.h:45
LamMap< Lam * > Lam2Lam
Definition lam.h:222
GIDMap< Lam *, To > LamMap
Definition lam.h:220
size_t undo_t
Definition pass.h:21