MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
sccp.h
Go to the documentation of this file.
1#pragma once
2
3#include "mim/phase.h"
4
5namespace mim {
6
7/// Sparse Conditional Constant Propagation.
8class SCCP : public RWPhase {
9public:
12
13private:
14 bool analyze() final;
15 const Def* init(Def*);
16 const Def* init(const Def*);
17
18 std::pair<const Def*, bool> concr2abstr(const Def*, const Def*);
19 const Def* concr2abstr(const Def*);
20 const Def* concr2abstr_impl(const Def*);
21 const Def* join(const Def*, const Def*, const Def*);
22
23 const Def* rewrite_imm_App(const App*) final;
24
25 DefSet visited_;
26 Def2Def concr2abstr_;
27 Lam2Lam lam2lam_;
28 bool todo_ = true;
29};
30
31} // namespace mim
Base class for all Defs.
Definition def.h:251
RWPhase(World &world, std::string name)
Definition phase.h:71
World & world()=delete
Hides both and forbids direct access.
SCCP(World &world, flags_t annex)
Definition sccp.h:10
const Def * rewrite_imm_App(const App *) final
Definition sccp.cpp:118
bool analyze() final
You can do an optional fixed-point loop on the RWPhase::old_world before rewriting.
Definition sccp.cpp:7
flags_t annex() const
Definition pass.h:68
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition world.h:31
Definition ast.h:14
DefMap< const Def * > Def2Def
Definition def.h:75
u64 flags_t
Definition types.h:45
LamMap< Lam * > Lam2Lam
Definition lam.h:222
GIDSet< const Def * > DefSet
Definition def.h:74
Definition span.h:122