|
MimIR 0.1
MimIR is my Intermediate Representation
|
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 *) |
| void | emit_epilogue (Lam *) |
| std::string | emit_bb (BB &, const Def *) |
| std::string | prepare () |
| void | finalize () |
| 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) | |
| NestPhase (World &world, flags_t annex, bool elide_empty) | |
| const Nest & | nest () const |
Public Member Functions inherited from mim::ClosedMutPhase< Lam > | |
| ClosedMutPhase (World &world, std::string name, bool elide_empty) | |
| ClosedMutPhase (World &world, flags_t annex, 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 | |
| World & | world () |
| Driver & | driver () |
| Log & | log () 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< 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. | |
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 |
| 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 |
| 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 > | |
| Lam * | root () const |
Protected Attributes inherited from mim::Emitter< std::string, std::string, BB, Emitter > | |
| Lam * | curr_lam_ |
| std::ostream & | ostream_ |
| Scheduler | scheduler_ |
| DefMap< std::string > | locals_ |
| DefMap< std::string > | globals_ |
| DefMap< std::string > | types_ |
| LamMap< BB > | lam2bb_ |
| Lam * | curr_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 current your fixed-point PhaseMan. | |
Protected Attributes inherited from mim::Stage | |
| std::string | name_ |
| using mim::ll::Emitter::Super = mim::Emitter<std::string, std::string, BB, Emitter> |
|
inline |
Definition at line 117 of file ll.cpp.
References mim::Emitter< std::string, std::string, BB, Emitter >::ostream(), and mim::Stage::world().
|
inline |
Definition at line 129 of file ll.cpp.
References mim::print().
Referenced by emit_bb(), and emit_epilogue().
Definition at line 455 of file ll.cpp.
References mim::Axm::as(), mim::Lit::as(), mim::ll::BB::assign(), mim::Annex::base(), mim::bitcast(), mim::ll::BB::body(), declare(), mim::Emitter< std::string, std::string, BB, Emitter >::emit(), mim::Emitter< std::string, std::string, BB, Emitter >::emit_unsafe(), mim::error(), mim::Emitter< std::string, std::string, BB, Emitter >::globals_, mim::Axm::isa(), mim::Idx::isa(), mim::Lit::isa(), mim::Emitter< std::string, std::string, BB, Emitter >::lam2bb_, mim::Stage::name(), mim::print(), mim::Def::proj(), mim::Def::projs(), mim::ClosedMutPhase< Lam >::root(), mim::Idx::size2bitwidth(), mim::ll::BB::tail(), and mim::Def::type().
| void mim::ll::Emitter::emit_epilogue | ( | Lam * | lam | ) |
Definition at line 314 of file ll.cpp.
References mim::Lam::body(), declare(), mim::Emitter< std::string, std::string, BB, Emitter >::emit(), mim::Emitter< std::string, std::string, BB, Emitter >::emit_unsafe(), mim::Axm::isa(), mim::Pi::isa_basicblock(), mim::Lam::isa_mut_basicblock(), mim::Pi::isa_returning(), mim::Emitter< std::string, std::string, BB, Emitter >::lam2bb_, mim::Emitter< std::string, std::string, BB, Emitter >::locals_, mim::Stage::name(), mim::Def::num_vars(), mim::print(), mim::ClosedMutPhase< Lam >::root(), and mim::Stage::world().
| void mim::ll::Emitter::emit_imported | ( | Lam * | lam | ) |
Definition at line 255 of file ll.cpp.
References mim::Axm::isa(), mim::print(), mim::Pi::ret_pi(), and mim::Lam::type().
| void mim::ll::Emitter::finalize | ( | ) |
Definition at line 285 of file ll.cpp.
References mim::Emitter< std::string, std::string, BB, Emitter >::lam2bb_, mim::NestPhase< Lam >::nest(), mim::print(), mim::Scheduler::schedule(), and mim::Emitter< std::string, std::string, BB, Emitter >::tab.
| std::string mim::ll::Emitter::prepare | ( | ) |
Definition at line 269 of file ll.cpp.
References mim::Axm::isa(), mim::Emitter< std::string, std::string, BB, Emitter >::locals_, mim::Stage::name(), mim::print(), mim::ClosedMutPhase< Lam >::root(), mim::Def::unique_name(), and mim::Def::vars().
|
overridevirtual |
Actual entry.
Reimplemented from mim::ClosedMutPhase< Lam >.
Definition at line 244 of file ll.cpp.
References mim::Emitter< std::string, std::string, BB, Emitter >::ostream(), and mim::Phase::start().