|
MimIR 0.1
MimIR is my Intermediate Representation
|
An optimizer that combines several optimizations in an optimal way. More...
#include <mim/pass.h>
Public Member Functions | |
| PassMan (World &world, flags_t annex) | |
| void | apply (Passes &&) |
| void | apply (const App *app) final |
| Invoked if your Stage has additional args. | |
| void | apply (Stage &stage) final |
| Dito, but invoked by Stage::recreate. | |
| void | init (PassMan *) final |
| bool | inspect () const final |
| Should the PassMan even consider this pass? | |
Getters | |
| bool | empty () const |
| const auto & | passes () const |
| bool | fixed_point () const |
| Def * | curr_mut () const |
Create and run Passes | |
| void | run () |
| Run all registered passes on the whole World. | |
| Pass * | find (std::type_index key) |
| template<class P> | |
| P * | find () |
| void | add (std::unique_ptr< Pass > &&pass) |
Public Member Functions inherited from mim::Pass | |
| Pass (World &world, std::string name) | |
| Pass (World &world, flags_t annex) | |
| PassMan & | man () |
| const PassMan & | man () const |
| size_t | index () const |
| virtual const Def * | rewrite (const Var *var) |
| virtual const Def * | rewrite (const Proxy *proxy) |
| virtual undo_t | analyze (const Var *) |
| virtual undo_t | analyze (const Proxy *) |
| virtual void | enter () |
| Invoked just before Pass::rewriteing PassMan::curr_mut's body. | |
| virtual void | prepare () |
| Invoked once before entering the main rewrite loop. | |
| const Proxy * | proxy (const Def *type, Defs ops, u32 tag=0) |
| const Proxy * | isa_proxy (const Def *def, u32 tag=0) |
Check whether given def is a Proxy whose Proxy::pass matches this Pass's IPass::index. | |
| const Proxy * | as_proxy (const Def *def, u32 tag=0) |
Public Member Functions inherited from mim::Stage | |
| World & | world () |
| Driver & | driver () |
| Log & | log () const |
| std::string_view | name () const |
| flags_t | annex () const |
| Stage (World &world, std::string name) | |
| Stage (World &world, flags_t annex) | |
| virtual | ~Stage ()=default |
| virtual std::unique_ptr< Stage > | recreate () |
| Creates a new instance; needed by a fixed-point PhaseMan. | |
Friends | |
| template<class P, class M> | |
| class | FPPass |
Additional Inherited Members | |
| static auto | create (const Flags2Stages &stages, const Def *def) |
| template<class A, class P> | |
| static void | hook (Flags2Stages &stages) |
Protected Attributes inherited from mim::Stage | |
| std::string | name_ |
An optimizer that combines several optimizations in an optimal way.
This is loosely based upon: "Composing dataflow analyses and transformations" by Lerner, Grove, Chambers.
Definition at line 174 of file pass.h.
References mim::Stage::annex(), mim::Pass::Pass(), and mim::Stage::world().
|
inline |
|
finalvirtual |
Invoked if your Stage has additional args.
Reimplemented from mim::Stage.
Definition at line 44 of file pass.cpp.
References apply(), mim::Stage::create(), mim::Stage::driver(), mim::Pass::Pass(), and passes().
| void mim::PassMan::apply | ( | Passes && | passes | ) |
|
inlinefinalvirtual |
Dito, but invoked by Stage::recreate.
Reimplemented from mim::Stage.
Definition at line 179 of file pass.h.
References apply(), and PassMan().
Referenced by apply().
|
inline |
Definition at line 189 of file pass.h.
Referenced by mim::RWPass< P, M >::curr_mut(), and mim::RWPass< P, M >::inspect().
|
inline |
|
inline |
Definition at line 196 of file pass.h.
References mim::Pass::Pass().
|
inlinevirtual |
|
inlinefinalvirtual |
|
inlinefinalvirtual |
|
inline |
| void mim::PassMan::run | ( | ) |
Run all registered passes on the whole World.
Definition at line 81 of file pass.cpp.
References mim::World::debug_dump(), mim::Def::deps(), DLOG, ILOG, mim::No_Undo, passes(), mim::pop(), mim::Phase::run(), mim::World::verify(), VLOG, and mim::Stage::world().