MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
pipelinebuilder.cpp
Go to the documentation of this file.
2
3#include "mim/def.h"
4#include "mim/lattice.h"
5#include "mim/plugin.h"
6
7#include "mim/pass/beta_red.h"
8#include "mim/pass/eta_exp.h"
9#include "mim/pass/eta_red.h"
10#include "mim/pass/pass.h"
11#include "mim/pass/ret_wrap.h"
12#include "mim/pass/scalarize.h"
14#include "mim/phase/phase.h"
15
16namespace mim {
17
18void PipelineBuilder::def2pass(const Def* def, Pass* p) {
19 def->world().DLOG("associating {} with {}", def->gid(), p);
20 def2pass_[def] = p;
21}
22Pass* PipelineBuilder::pass(const Def* def) { return def2pass_[def]; }
23
24void PipelineBuilder::begin_pass_phase() { man = std::make_unique<PassMan>(world_); }
26 std::unique_ptr<mim::PassMan>&& pass_man_ref = std::move(man);
27 pipe->add<PassManPhase>(std::move(pass_man_ref));
28 man = nullptr;
29}
30
31void PipelineBuilder::run_pipeline() { pipe->run(); }
32
33} // namespace mim
Base class for all Defs.
Definition def.h:223
World & world() const
Definition def.cpp:415
u32 gid() const
Definition def.h:239
Wraps a PassMan pipeline as a Phase.
Definition phase.h:100
All Passes that want to be registered in the PassMan must implement this interface.
Definition pass.h:22
void def2pass(const Def *, Pass *p)
Pass * pass(const Def *)
Definition cfg.h:11