Common base for Phase and Pass. More...
#include <mim/pass.h>
Public Member Functions | |
Construction & Destruction | |
| 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. | |
| virtual void | apply (const App *) |
| Invoked if your Stage has additional args. | |
| virtual void | apply (Stage &) |
| Dito, but invoked by Stage::recreate. | |
Redirection | |
A Stage may resolve to a different Stage (or to nothing) after Stage::apply. This is used by the %compile.named_* stages that resolve a string to another plugin's annex. | |
| virtual bool | redirects () const |
| If true, Stage::create uses take_resolved(). | |
| virtual std::unique_ptr< Stage > | take_resolved () |
| The Stage to use instead; nullptr means elide. | |
Getters | |
| World & | world () |
| Driver & | driver () |
| Log & | log () const |
| std::string_view | name () const |
| flags_t | annex () const |
Static Public Member Functions | |
| static std::unique_ptr< Stage > | create (const Flags2Stages &stages, const Def *def) |
| template<class A, class P> | |
| static void | hook (Flags2Stages &stages) |
Protected Attributes | |
| std::string | name_ |
|
inline |
Definition at line 30 of file pass.h.
References name(), name_, and world().
Referenced by mim::plug::mem::pass::CopyProp::apply(), mim::plug::mem::pass::Reshape::apply(), apply(), Named::Named(), mim::Pass::Pass(), mim::Pass::Pass(), mim::Phase::Phase(), mim::Phase::Phase(), and mim::Repl::Repl().
|
virtualdefault |
|
inline |
Definition at line 81 of file pass.h.
Referenced by mim::plug::mem::phase::AddMem::AddMem(), mim::Analysis::Analysis(), mim::PassManPhase::apply(), mim::ReplManPhase::apply(), Named::apply(), mim::plug::autodiff::Eval::augment_pack(), mim::BetaRed::BetaRed(), mim::BetaRedPhase::BetaRedPhase(), mim::plug::clos::BranchClosElim::BranchClosElim(), mim::BranchNormalizePhase::BranchNormalizePhase(), mim::Cleanup::Cleanup(), mim::plug::clos::Clos2SJLJ::Clos2SJLJ(), mim::plug::clos::ClosConv::ClosConv(), mim::plug::clos::ClosConvPrep::ClosConvPrep(), mim::ClosedMutPhase< M >::ClosedMutPhase(), mim::plug::mem::pass::CopyProp::CopyProp(), mim::plug::direct::CPS2DSPhase::CPS2DSPhase(), mim::plug::direct::DS2CPS::DS2CPS(), mim::plug::ll::Emit::Emit(), mim::EtaExp::EtaExp(), mim::EtaExpPhase::EtaExpPhase(), mim::EtaRed::EtaRed(), mim::EtaRedPhase::EtaRedPhase(), mim::plug::autodiff::Eval::Eval(), mim::FPPass< P, M >::FPPass(), mim::plug::tensor::phase::Fuse::Fuse(), mim::LamSpec::LamSpec(), mim::plug::tensor::phase::Lower::Lower(), mim::plug::affine::phase::LowerFor::LowerFor(), mim::plug::affine::phase::LowerIndex::LowerIndex(), mim::plug::tensor::phase::LowerMapReduce::LowerMapReduce(), mim::plug::matrix::LowerMatrixHighLevelMapRed::LowerMatrixHighLevelMapRed(), mim::plug::matrix::LowerMatrixLowLevel::LowerMatrixLowLevel(), mim::plug::matrix::LowerMatrixMediumLevel::LowerMatrixMediumLevel(), mim::plug::regex::LowerRegex::LowerRegex(), mim::plug::clos::LowerTypedClos::LowerTypedClos(), mim::plug::clos::LowerTypedClosPrep::LowerTypedClosPrep(), mim::NestPhase< M >::NestPhase(), mim::Pass::Pass(), mim::PassMan::PassMan(), mim::PassManPhase::PassManPhase(), mim::Phase::Phase(), mim::PhaseMan::PhaseMan(), mim::PrefixCleanup::PrefixCleanup(), recreate(), mim::Repl::Repl(), mim::ReplMan::ReplMan(), mim::ReplManPhase::ReplManPhase(), mim::plug::mem::pass::Reshape::Reshape(), mim::RetWrap::RetWrap(), mim::plug::matrix::LowerMatrixMediumLevel::rewrite_(), mim::RWPass< P, M >::RWPass(), mim::RWPhase::RWPhase(), mim::Scalarize::Scalarize(), mim::plug::mem::pass::SSA::SSA(), Stage(), mim::SymExprOpt::SymExprOpt(), and mim::TailRecElim::TailRecElim().
|
inlinevirtual |
Invoked if your Stage has additional args.
Reimplemented in mim::EtaRed, mim::PassMan, mim::PassManPhase, mim::PhaseMan, mim::plug::mem::pass::CopyProp, mim::plug::mem::pass::Reshape, mim::PrefixCleanup, mim::ReplMan, mim::ReplManPhase, and Named.
Definition at line 37 of file pass.h.
Referenced by mim::optimize().
|
inlinevirtual |
Dito, but invoked by Stage::recreate.
Reimplemented in mim::EtaRed, mim::PassMan, mim::PassManPhase, mim::PhaseMan, mim::plug::mem::pass::CopyProp, mim::plug::mem::pass::Reshape, mim::PrefixCleanup, mim::ReplMan, and mim::ReplManPhase.
Definition at line 38 of file pass.h.
References Stage().
|
inlinestatic |
Definition at line 50 of file pass.h.
References mim::error(), mim::App::uncurry_callee(), mim::Def::world(), and world().
Referenced by mim::PassMan::apply(), mim::PassManPhase::apply(), mim::PhaseMan::apply(), mim::ReplMan::apply(), mim::ReplManPhase::apply(), and Named::apply().
|
inline |
Definition at line 78 of file pass.h.
References mim::World::driver(), and world().
Referenced by mim::PassMan::apply(), mim::PassManPhase::apply(), mim::PhaseMan::apply(), mim::ReplMan::apply(), mim::ReplManPhase::apply(), Named::apply(), and recreate().
|
inlinestatic |
Definition at line 70 of file pass.h.
References mim::assert_emplace(), and mim::Annex::base().
Referenced by mim::plug::tensor::reg_stages(), reg_stages(), and reg_stages().
|
inline |
Definition at line 79 of file pass.h.
References mim::Log::log().
|
inline |
Definition at line 80 of file pass.h.
References name_.
Referenced by mim::Analysis::Analysis(), mim::ClosedMutPhase< M >::ClosedMutPhase(), mim::plug::ll::Emitter::emit_bb(), mim::plug::ll::Emitter::emit_epilogue(), mim::Emitter< std::string, std::string, BB, Emitter >::Emitter(), mim::FPPass< P, M >::FPPass(), mim::NestPhase< M >::NestPhase(), mim::Pass::Pass(), mim::Phase::Phase(), mim::plug::ll::Emitter::prepare(), mim::Phase::run(), mim::RWPass< P, M >::RWPass(), mim::RWPhase::RWPhase(), Stage(), and mim::plug::ll::Emit::start().
|
virtual |
|
inlinevirtual |
If true, Stage::create uses take_resolved().
Reimplemented in Named.
|
inlinevirtual |
|
inline |
Definition at line 77 of file pass.h.
Referenced by mim::plug::mem::phase::AddMem::AddMem(), mim::TailRecElim::analyze(), mim::PassManPhase::apply(), Named::apply(), mim::plug::autodiff::Eval::augment_(), mim::plug::autodiff::Eval::augment_app(), mim::plug::autodiff::Eval::augment_extract(), mim::plug::autodiff::Eval::augment_lam(), mim::plug::autodiff::Eval::augment_pack(), mim::plug::autodiff::Eval::augment_tuple(), mim::BetaRed::BetaRed(), mim::plug::clos::BranchClosElim::BranchClosElim(), mim::plug::clos::Clos2SJLJ::Clos2SJLJ(), mim::plug::clos::ClosConv::ClosConv(), mim::plug::clos::ClosConvPrep::ClosConvPrep(), mim::ClosedMutPhase< M >::ClosedMutPhase(), mim::ClosedMutPhase< M >::ClosedMutPhase(), mim::plug::mem::pass::CopyProp::CopyProp(), mim::plug::direct::CPS2DSPhase::CPS2DSPhase(), create(), mim::plug::autodiff::Eval::derive_(), driver(), mim::plug::ll::Emit::Emit(), mim::sexpr::Emitter::emit_decl(), mim::plug::ll::Emitter::emit_epilogue(), mim::Emitter< std::string, std::string, BB, Emitter >::Emitter(), mim::plug::ll::Emitter::Emitter(), mim::sexpr::Emitter::Emitter(), mim::plug::clos::Clos2SJLJ::enter(), mim::plug::clos::ClosConvPrep::eta_wrap(), mim::EtaExp::EtaExp(), mim::EtaRed::EtaRed(), mim::plug::autodiff::Eval::Eval(), mim::FPPass< P, M >::FPPass(), mim::FPPass< P, M >::FPPass(), mim::LamSpec::LamSpec(), mim::plug::matrix::LowerMatrixHighLevelMapRed::LowerMatrixHighLevelMapRed(), mim::plug::matrix::LowerMatrixMediumLevel::LowerMatrixMediumLevel(), mim::plug::regex::LowerRegex::LowerRegex(), mim::plug::clos::LowerTypedClos::LowerTypedClos(), mim::plug::clos::LowerTypedClosPrep::LowerTypedClosPrep(), mim::NestPhase< M >::NestPhase(), mim::NestPhase< M >::NestPhase(), mim::RWPhase::old_world(), mim::Pass::Pass(), mim::Pass::Pass(), mim::PassMan::PassMan(), mim::PassManPhase::PassManPhase(), mim::PassManPhase::PassManPhase(), mim::Phase::Phase(), mim::Phase::Phase(), mim::PhaseMan::PhaseMan(), mim::Pass::proxy(), recreate(), mim::Repl::Repl(), mim::ReplMan::ReplMan(), mim::plug::mem::pass::Reshape::Reshape(), mim::LamSpec::rewrite(), mim::plug::clos::BranchClosElim::rewrite(), mim::plug::clos::Clos2SJLJ::rewrite(), mim::plug::clos::LowerTypedClosPrep::rewrite(), mim::plug::mem::pass::CopyProp::rewrite(), mim::plug::mem::pass::SSA::rewrite(), mim::plug::regex::LowerRegex::rewrite(), mim::Scalarize::rewrite(), mim::TailRecElim::rewrite(), mim::plug::matrix::LowerMatrixHighLevelMapRed::rewrite_(), mim::plug::matrix::LowerMatrixMediumLevel::rewrite_(), mim::plug::clos::ClosConvPrep::rewrite_arg(), mim::PassMan::run(), mim::Phase::run(), mim::RWPass< P, M >::RWPass(), mim::RWPass< P, M >::RWPass(), mim::Scalarize::Scalarize(), mim::plug::mem::pass::SSA::SSA(), Stage(), Stage(), mim::ClosedMutPhase< M >::start(), mim::plug::clos::ClosConv::start(), mim::plug::clos::LowerTypedClos::start(), mim::plug::direct::CPS2DSPhase::start(), mim::plug::ll::Emit::start(), mim::TailRecElim::TailRecElim(), and mim::Analysis::world().
|
protected |
Definition at line 89 of file pass.h.
Referenced by mim::EtaRed::apply(), mim::PhaseMan::apply(), mim::plug::mem::pass::CopyProp::apply(), mim::plug::mem::pass::Reshape::apply(), mim::PrefixCleanup::apply(), name(), Stage(), and Stage().