MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::ll::Emitter Class Reference

#include <mim/plug/core/be/ll.h>

Inheritance diagram for mim::ll::Emitter:
[legend]

Public Types

using Super = mim::Emitter<std::string, std::string, BB, Emitter>

Public Member Functions

 Emitter (World &world, std::ostream &ostream)
bool is_valid (std::string_view s)
void start () override
 Actual entry.
void emit_imported (Lam *)
virtual void emit_epilogue (Lam *)
std::string emit_bb (BB &, const Def *)
virtual std::string prepare ()
void finalize ()
virtual std::optional< std::string > isa_targetspecific_intrinsic (BB &, const Def *)
std::string as_targetspecific_intrinsic (BB &bb, const Def *def)
template<class... Args>
void declare (const char *s, Args &&... args)
Public Member Functions inherited from mim::NestPhase< Lam >
 NestPhase (World &world, std::string name, bool elide_empty)
const Nestnest () const
Public Member Functions inherited from mim::ClosedMutPhase< Lam >
 ClosedMutPhase (World &world, std::string name, bool elide_empty)
bool elide_empty () const
Public Member Functions inherited from mim::Phase
 Phase (World &world, std::string name)
 Phase (World &world, flags_t annex)
bool todo () const
virtual void run ()
 Entry point and generates some debug output; invokes Phase::start.
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.

Additional Inherited Members

template<class P, class... Args>
static void run (Args &&... args)
 Runs a single Phase.
static auto create (const Flags2Stages &stages, const Def *def)
template<class A, class P>
static void hook (Flags2Stages &stages)
Public Attributes inherited from mim::Emitter< std::string, std::string, BB, Emitter >
Tab tab
Protected Member Functions inherited from mim::Emitter< std::string, std::string, BB, Emitter >
 Emitter (World &world, std::string name, std::ostream &ostream)
std::ostream & ostream () const
std::string emit (const Def *def)
 Recursively emits code.
std::string emit_unsafe (const Def *def)
 As above but returning !child().is_valid(value) is permitted.
void visit (const Nest &nest) override
Protected Member Functions inherited from mim::ClosedMutPhase< Lam >
virtual void visit (Lam *)=0
Lamroot () const
Protected Attributes inherited from mim::Emitter< std::string, std::string, BB, Emitter >
Lamcurr_lam_
std::ostream & ostream_
Scheduler scheduler_
DefMap< std::string > locals_
DefMap< std::string > globals_
DefMap< std::string > types_
LamMap< BB > lam2bb_
Protected Attributes inherited from mim::Phase
bool todo_ = false
 Set to true to indicate that you want to rerun all Phasees in your current fixed-point PhaseMan.
Protected Attributes inherited from mim::Stage
std::string name_

Detailed Description

Definition at line 115 of file ll.h.

Member Typedef Documentation

◆ Super

using mim::ll::Emitter::Super = mim::Emitter<std::string, std::string, BB, Emitter>

Definition at line 117 of file ll.h.

Constructor & Destructor Documentation

◆ Emitter()

mim::ll::Emitter::Emitter ( World & world,
std::ostream & ostream )
inline

Member Function Documentation

◆ as_targetspecific_intrinsic()

std::string mim::ll::Emitter::as_targetspecific_intrinsic ( BB & bb,
const Def * def )
inline

Definition at line 131 of file ll.h.

References mim::error(), isa_targetspecific_intrinsic(), and mim::Def::type().

◆ declare()

template<class... Args>
void mim::ll::Emitter::declare ( const char * s,
Args &&... args )
inline

Definition at line 137 of file ll.h.

References mim::print().

Referenced by emit_bb(), and emit_epilogue().

◆ emit_bb()

◆ emit_epilogue()

◆ emit_imported()

void mim::ll::Emitter::emit_imported ( Lam * lam)
inline

Definition at line 301 of file ll.h.

References mim::Axm::isa(), mim::print(), mim::Pi::ret_pi(), and mim::Lam::type().

◆ finalize()

◆ is_valid()

bool mim::ll::Emitter::is_valid ( std::string_view s)
inline

Definition at line 122 of file ll.h.

◆ isa_targetspecific_intrinsic()

virtual std::optional< std::string > mim::ll::Emitter::isa_targetspecific_intrinsic ( BB & ,
const Def *  )
inlinevirtual

Definition at line 130 of file ll.h.

Referenced by as_targetspecific_intrinsic(), and emit_bb().

◆ prepare()

◆ start()

void mim::ll::Emitter::start ( )
inlineoverridevirtual

Actual entry.

Reimplemented from mim::ClosedMutPhase< Lam >.

Definition at line 290 of file ll.h.

References mim::Emitter< std::string, std::string, BB, Emitter >::ostream(), and mim::Phase::start().


The documentation for this class was generated from the following file:
  • include/mim/plug/core/be/ll.h