MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::Phase Class Referenceabstract

Unlike a Pass, a Phase performs one self-contained task and does not interleave with other phases. More...

#include <mim/phase.h>

Inheritance diagram for mim::Phase:
[legend]

Public Member Functions

Construction & Destruction
 Phase (World &world, std::string name)
 Phase (World &world, flags_t annex)
Fixed-Point Handling
bool todo () const
void invalidate (bool todo=true)
 Signals that another round of fixed-point iteration is required, either as part of.
Public Member Functions inherited from mim::Stage
Worldworld ()
Driverdriver ()
Loglog () 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< 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.

Friends

class Analysis

run

virtual void run ()
 Entry point and generates some debug output; invokes Phase::start.
virtual void start ()=0
 Actual entry.
template<class P, class... Args>
static void run (Args &&... args)
 Runs a single Phase.

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_

Detailed Description

Unlike a Pass, a Phase performs one self-contained task and does not interleave with other phases.

Phases are intended to run in a classical sequence, one after another.

See also
Phase

Definition at line 27 of file phase.h.

Constructor & Destructor Documentation

◆ Phase() [1/2]

◆ Phase() [2/2]

mim::Phase::Phase ( World & world,
flags_t annex )
inline

Definition at line 33 of file phase.h.

References mim::Stage::annex(), mim::Stage::Stage(), and mim::Stage::world().

Member Function Documentation

◆ invalidate()

void mim::Phase::invalidate ( bool todo = true)
inline

Signals that another round of fixed-point iteration is required, either as part of.

  • a pipeline managed by PhaseMan, or
  • the optional pre-analysis of an RWPhase.

Calling invalidate(todo) bitwise-ORs todo into the internal todo_ flag.

Definition at line 48 of file phase.h.

References todo().

Referenced by mim::BetaRedPhase::rewrite_imm_App(), mim::SymExprOpt::rewrite_imm_App(), and mim::PhaseMan::start().

◆ run() [1/2]

void mim::Phase::run ( )
virtual

Entry point and generates some debug output; invokes Phase::start.

Definition at line 13 of file phase.cpp.

References mim::Stage::name(), start(), mim::World::verify(), and mim::Stage::world().

Referenced by mim::ll::emit(), mim::sexpr::emit(), mim::sexpr::emit_slotted(), main(), and mim::PassMan::run().

◆ run() [2/2]

template<class P, class... Args>
void mim::Phase::run ( Args &&... args)
inlinestatic

Runs a single Phase.

Definition at line 58 of file phase.h.

◆ start()

◆ todo()

bool mim::Phase::todo ( ) const
inline

◆ Analysis

friend class Analysis
friend

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