22 Both = Known | Unknown,
25 static Lattice join(Lattice l1, Lattice l2) {
return Lattice((
u8)l1 | (
u8)l2); }
27 void join(
const Lam* lam, Lattice l) {
28 if (
auto [i, ins] = lam2lattice_.emplace(lam, l); !ins) i->second = join(i->second, l);
31 Lattice lattice(
const Lam* lam) {
32 if (
auto i = lam2lattice_.find(lam); i != lam2lattice_.end())
return i->second;
38 void visit(const Def*, Lattice = Lattice::Unknown);
41 const Def*
rewrite(const Def*) final;
44 const Def* rewrite_no_eta(const Def* old_def) {
return Rewriter::rewrite(old_def); }
const Def * rewrite(const Def *) final
const Def * rewrite_imm_Var(const Var *) final
const Def * rewrite_imm_App(const App *) final
EtaExpPhase(World &world, flags_t annex)
void rewrite_external(Def *) final
bool analyze() final
You can do an optional fixed-point loop on the RWPhase::old_world before rewriting.
RWPhase(World &world, std::string name)
World & world()=delete
Hides both and forbids direct access.
virtual const Def * rewrite(const Def *)
The World represents the whole program and manages creation of MimIR nodes (Defs).
absl::flat_hash_map< K, V, GIDHash< K > > GIDMap
GIDSet< const Def * > DefSet