Thorin 1.9.0
The Higher ORder INtermediate representation
|
All Passes that want to be registered in the PassMan must implement this interface. More...
#include <thorin/pass/pass.h>
Public Member Functions | |
Pass (PassMan &, std::string_view name) | |
virtual | ~Pass ()=default |
Getters | |
World & | world () |
PassMan & | man () |
const PassMan & | man () const |
std::string_view | name () const |
size_t | index () const |
Rewrite Hook for the PassMan | |
Rewrites an immutable
| |
virtual Ref | rewrite (Ref def) |
virtual Ref | rewrite (const Var *var) |
virtual Ref | rewrite (const Proxy *proxy) |
Analyze Hook for the PassMan | |
Invoked after the PassMan has finished Pass::rewriteing PassMan::curr_mut to analyze the Def. Will only be invoked if Pass::fixed_point() yields
| |
virtual undo_t | analyze (Ref) |
virtual undo_t | analyze (const Var *) |
virtual undo_t | analyze (const Proxy *) |
Further Hooks for the PassMan | |
virtual bool | fixed_point () const |
virtual bool | inspect () const =0 |
Should the PassMan even consider this pass? | |
virtual void | enter () |
Invoked just before Pass::rewriteing PassMan::curr_mut's body. | |
virtual void | prepare () |
Invoked once before entering the main rewrite loop. | |
proxy | |
const Proxy * | proxy (Ref type, Defs ops, u32 tag=0) |
const Proxy * | isa_proxy (Ref def, u32 tag=0) |
Check whether given def is a Proxy whose Proxy::pass matches this Pass's IPass::index . | |
const Proxy * | as_proxy (Ref def, u32 tag=0) |
Private Member Functions | |
Memory Management | |
virtual void * | alloc () |
Default constructor. | |
virtual void * | copy (const void *) |
Copy constructor. | |
virtual void | dealloc (void *) |
Destructor. | |
All Passes that want to be registered in the PassMan must implement this interface.
|
virtualdefault |
|
inlineprivatevirtual |
Default constructor.
Reimplemented in thorin::FPPass< P, M >, thorin::FPPass< BetaRed, Def >, thorin::FPPass< CopyProp, Lam >, thorin::FPPass< EtaExp, Lam >, thorin::FPPass< EtaRed, Def >, thorin::FPPass< LowerTypedClosPrep, Lam >, thorin::FPPass< SSAConstr, Lam >, and thorin::FPPass< TailRecElim, Lam >.
Reimplemented in thorin::BetaRed, thorin::EtaExp, thorin::plug::mem::CopyProp, and thorin::plug::mem::SSAConstr.
Definition at line 52 of file pass.h.
References thorin::No_Undo.
Reimplemented in thorin::BetaRed, thorin::EtaExp, thorin::TailRecElim, thorin::plug::clos::LowerTypedClosPrep, and thorin::plug::mem::SSAConstr.
Definition at line 50 of file pass.h.
References thorin::No_Undo.
Definition at line 82 of file pass.h.
References index(), thorin::Proxy::pass(), proxy(), and thorin::Proxy::tag().
Referenced by thorin::plug::mem::SSAConstr::rewrite().
|
inlineprivatevirtual |
Copy constructor.
Reimplemented in thorin::FPPass< P, M >, thorin::FPPass< BetaRed, Def >, thorin::FPPass< CopyProp, Lam >, thorin::FPPass< EtaExp, Lam >, thorin::FPPass< EtaRed, Def >, thorin::FPPass< LowerTypedClosPrep, Lam >, thorin::FPPass< SSAConstr, Lam >, and thorin::FPPass< TailRecElim, Lam >.
|
inlineprivatevirtual |
|
inlinevirtual |
Invoked just before Pass::rewriteing PassMan::curr_mut's body.
Reimplemented in thorin::RetWrap, thorin::plug::clos::Clos2SJLJ, thorin::plug::clos::ClosConvPrep, thorin::plug::compile::DebugPrint, thorin::plug::compile::InternalCleanup, thorin::plug::direct::CPS2DS, thorin::plug::mem::Reshape, and thorin::plug::mem::SSAConstr.
|
inlinevirtual |
|
inline |
Definition at line 33 of file pass.h.
Referenced by as_proxy(), thorin::plug::autodiff::AutoDiffEval::augment_(), thorin::plug::autodiff::AutoDiffEval::augment_extract(), thorin::FPPass< P, M >::data(), isa_proxy(), proxy(), and thorin::plug::clos::BranchClosElim::rewrite().
|
pure virtual |
Should the PassMan even consider this pass?
Implemented in thorin::RWPass< P, M >, thorin::RWPass< Alloc2Malloc, Lam >, thorin::RWPass< AutoDiffEval, Lam >, thorin::RWPass< AutoDiffZero, Lam >, thorin::RWPass< AutoDiffZeroCleanup, Lam >, thorin::RWPass< BetaRed, Def >, thorin::RWPass< BranchClosElim, Lam >, thorin::RWPass< Clos2SJLJ, Lam >, thorin::RWPass< ClosConvPrep, Lam >, thorin::RWPass< CopyProp, Lam >, thorin::RWPass< CPS2DS, Lam >, thorin::RWPass< DebugDump, Lam >, thorin::RWPass< DebugPrint, Lam >, thorin::RWPass< DS2CPS, Lam >, thorin::RWPass< EtaExp, Lam >, thorin::RWPass< EtaRed, Def >, thorin::RWPass< InternalCleanup, Lam >, thorin::RWPass< LamSpec, Lam >, thorin::RWPass< LowerFor, Lam >, thorin::RWPass< LowerMatrixHighLevelMapRed, Lam >, thorin::RWPass< LowerMatrixMediumLevel, Lam >, thorin::RWPass< LowerRegex, Lam >, thorin::RWPass< LowerTypedClosPrep, Lam >, thorin::RWPass< P, Def >, thorin::RWPass< RememElim, Lam >, thorin::RWPass< RemoveDbgPerm, Lam >, thorin::RWPass< Reshape, Lam >, thorin::RWPass< RetWrap, Lam >, thorin::RWPass< Scalerize, Lam >, thorin::RWPass< SSAConstr, Lam >, and thorin::RWPass< TailRecElim, Lam >.
Check whether given def
is a Proxy whose Proxy::pass matches this Pass's IPass::index
.
Definition at line 77 of file pass.h.
References index(), thorin::Proxy::pass(), proxy(), and thorin::Proxy::tag().
Referenced by thorin::plug::mem::SSAConstr::rewrite().
|
inline |
Definition at line 30 of file pass.h.
Referenced by thorin::RWPass< P, M >::curr_mut(), thorin::FPPass< P, M >::curr_undo(), thorin::RWPass< P, M >::inspect(), thorin::FPPass< P, M >::states(), thorin::FPPass< P, M >::states(), thorin::FPPass< P, M >::undo_visit(), and world().
|
inlinevirtual |
Definition at line 75 of file pass.h.
References index(), thorin::World::proxy(), and world().
Referenced by thorin::BetaRed::analyze(), thorin::plug::mem::CopyProp::analyze(), thorin::plug::mem::SSAConstr::analyze(), as_proxy(), isa_proxy(), thorin::EtaExp::proxy(), thorin::plug::mem::SSAConstr::rewrite(), rewrite(), thorin::BetaRed::rewrite(), thorin::plug::mem::CopyProp::rewrite(), and thorin::plug::mem::SSAConstr::rewrite().
Reimplemented in thorin::plug::mem::SSAConstr.
Definition at line 42 of file pass.h.
References proxy().
Reimplemented in thorin::BetaRed, thorin::EtaExp, thorin::EtaRed, thorin::LamSpec, thorin::Scalerize, thorin::TailRecElim, thorin::plug::affine::LowerFor, thorin::plug::autodiff::AutoDiffEval, thorin::plug::autodiff::AutoDiffZero, thorin::plug::autodiff::AutoDiffZeroCleanup, thorin::plug::clos::BranchClosElim, thorin::plug::clos::Clos2SJLJ, thorin::plug::clos::ClosConvPrep, thorin::plug::clos::LowerTypedClosPrep, thorin::plug::direct::DS2CPS, thorin::plug::matrix::LowerMatrixHighLevelMapRed, thorin::plug::matrix::LowerMatrixMediumLevel, thorin::plug::mem::Alloc2Malloc, thorin::plug::mem::CopyProp, thorin::plug::mem::RememElim, thorin::plug::mem::SSAConstr, thorin::plug::refly::RemoveDbgPerm, and thorin::plug::regex::LowerRegex.
|
inline |
Definition at line 296 of file pass.h.
References man(), and thorin::PassMan::world().
Referenced by thorin::BetaRed::analyze(), thorin::EtaExp::analyze(), thorin::plug::mem::CopyProp::analyze(), thorin::plug::mem::SSAConstr::analyze(), thorin::EtaRed::analyze(), thorin::BetaRed::analyze(), thorin::EtaExp::analyze(), thorin::TailRecElim::analyze(), thorin::plug::clos::LowerTypedClosPrep::analyze(), thorin::plug::mem::SSAConstr::analyze(), thorin::plug::autodiff::AutoDiffEval::augment_(), thorin::plug::autodiff::AutoDiffEval::augment_app(), thorin::plug::autodiff::AutoDiffEval::augment_extract(), thorin::plug::autodiff::AutoDiffEval::augment_lam(), thorin::plug::autodiff::AutoDiffEval::augment_pack(), thorin::plug::autodiff::AutoDiffEval::augment_tuple(), thorin::plug::autodiff::AutoDiffEval::derive_(), thorin::RetWrap::enter(), thorin::plug::clos::ClosConvPrep::enter(), thorin::plug::compile::DebugPrint::enter(), thorin::plug::compile::InternalCleanup::enter(), thorin::plug::clos::ClosConvPrep::eta_wrap(), DebugDump::prepare(), proxy(), thorin::plug::mem::SSAConstr::rewrite(), thorin::BetaRed::rewrite(), thorin::EtaRed::rewrite(), thorin::LamSpec::rewrite(), thorin::TailRecElim::rewrite(), thorin::plug::affine::LowerFor::rewrite(), thorin::plug::autodiff::AutoDiffEval::rewrite(), thorin::plug::autodiff::AutoDiffZero::rewrite(), thorin::plug::autodiff::AutoDiffZeroCleanup::rewrite(), thorin::plug::clos::BranchClosElim::rewrite(), thorin::plug::clos::LowerTypedClosPrep::rewrite(), thorin::plug::direct::DS2CPS::rewrite(), thorin::plug::mem::CopyProp::rewrite(), thorin::plug::mem::SSAConstr::rewrite(), thorin::plug::refly::RemoveDbgPerm::rewrite(), thorin::plug::matrix::LowerMatrixHighLevelMapRed::rewrite_(), thorin::plug::matrix::LowerMatrixMediumLevel::rewrite_(), thorin::plug::clos::ClosConvPrep::rewrite_arg(), and thorin::plug::clos::ClosConvPrep::rewrite_callee().