MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches

Common base for Phase and Pass. More...

#include <mim/pass.h>

Inheritance diagram for mim::Stage:
[legend]

Public Member Functions

Construction & Destruction
 Stage (World &world, std::string name)
 Stage (World &world, flags_t annex)
virtual ~Stage ()=default
virtual std::unique_ptr< Stagerecreate ()
 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< Stagetake_resolved ()
 The Stage to use instead; nullptr means elide.
Getters
Worldworld ()
Driverdriver ()
Loglog () const
std::string_view name () const
flags_t annex () const

Static Public Member Functions

static std::unique_ptr< Stagecreate (const Flags2Stages &stages, const Def *def)
template<class A, class P>
static void hook (Flags2Stages &stages)

Protected Attributes

std::string name_

Detailed Description

Common base for Phase and Pass.

Definition at line 26 of file pass.h.

Constructor & Destructor Documentation

◆ Stage() [1/2]

◆ Stage() [2/2]

mim::Stage::Stage ( World & world,
flags_t annex )

Definition at line 18 of file pass.cpp.

References annex(), name_, and world().

◆ ~Stage()

virtual mim::Stage::~Stage ( )
virtualdefault

Member Function Documentation

◆ annex()

flags_t mim::Stage::annex ( ) const
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().

◆ apply() [1/2]

virtual void mim::Stage::apply ( const App * )
inlinevirtual

◆ apply() [2/2]

virtual void mim::Stage::apply ( Stage & )
inlinevirtual

◆ create()

std::unique_ptr< Stage > mim::Stage::create ( const Flags2Stages & stages,
const Def * def )
inlinestatic

◆ driver()

◆ hook()

template<class A, class P>
void mim::Stage::hook ( Flags2Stages & stages)
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().

◆ log()

Log & mim::Stage::log ( ) const
inline

Definition at line 79 of file pass.h.

References mim::Log::log().

◆ name()

◆ recreate()

std::unique_ptr< Stage > mim::Stage::recreate ( )
virtual

Creates a new instance; needed by a fixed-point PhaseMan.

Definition at line 23 of file pass.cpp.

References annex(), driver(), mim::Driver::stage(), and world().

◆ redirects()

virtual bool mim::Stage::redirects ( ) const
inlinevirtual

If true, Stage::create uses take_resolved().

Reimplemented in Named.

Definition at line 44 of file pass.h.

◆ take_resolved()

virtual std::unique_ptr< Stage > mim::Stage::take_resolved ( )
inlinevirtual

The Stage to use instead; nullptr means elide.

Reimplemented in Named.

Definition at line 45 of file pass.h.

◆ world()

World & mim::Stage::world ( )
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().

Member Data Documentation

◆ name_


The documentation for this class was generated from the following files: