Thorin 1.9.0
The Higher ORder INtermediate representation
|
The World represents the whole program and manages creation of Thorin nodes (Defs). More...
#include <thorin/world.h>
Classes | |
struct | Freezer |
Use to World::freeze and automatically unfreeze at the end of scope. More... | |
struct | State |
Public Member Functions | |||||
template<class Id , class... Args> | |||||
const Def * | call (Id id, Args &&... args) | ||||
template<class Id , class... Args> | |||||
const Def * | call (Args &&... args) | ||||
template<class T , class... Args> | |||||
const Def * | call_ (Ref callee, T arg, Args &&... args) | ||||
template<class T > | |||||
const Def * | call_ (Ref callee, T arg) | ||||
C'tor and D'tor | |||||
World & | operator= (World)=delete | ||||
World (Driver *) | |||||
Inherits the state into the new World. | |||||
World (Driver *, const State &) | |||||
World (World &&other) noexcept | |||||
World | inherit () | ||||
~World () | |||||
Getters/Setters | |||||
const State & | state () const | ||||
const Driver & | driver () const | ||||
Driver & | driver () | ||||
Sym | name () const | ||||
void | set (Sym name) | ||||
void | set (std::string_view name) | ||||
u32 | curr_gid () const | ||||
Manage global identifier - a unique number for each Def. | |||||
u32 | next_gid () | ||||
Flags & | flags () | ||||
Retrive compile Flags. | |||||
Loc & | emit_loc () | ||||
Sym | |||||
Sym | sym (std::string_view) | ||||
Sym | sym (const char *) | ||||
Sym | sym (const std::string &) | ||||
Sym | append_suffix (Sym name, std::string suffix) | ||||
Appends a suffix or an increasing number if the suffix already exists. | |||||
Freeze | |||||
In frozen state the World does not create any nodes. | |||||
bool | is_frozen () const | ||||
bool | freeze (bool on=true) const | ||||
Yields old frozen state. | |||||
Debugging Features | |||||
const auto & | breakpoints () | ||||
Ref | gid2def (u32 gid) | ||||
Lookup Def by gid . | |||||
void | breakpoint (u32 gid) | ||||
Trigger breakpoint in your debugger when creating Def with Def::gid gid . | |||||
World & | verify () | ||||
Verifies that all externals() and annexes() are Def::is_closed(), if THORIN_ENABLE_CHECKS . | |||||
Manage Nodes | |||||
const auto & | annexes () const | ||||
const auto & | externals () const | ||||
void | make_external (Def *def) | ||||
void | make_internal (Def *def) | ||||
Def * | external (Sym name) | ||||
Lookup by name . | |||||
template<class Id > | |||||
const Def * | annex (Id id) | ||||
Lookup annex by Axiom::id. | |||||
template<annex_without_subs id> | |||||
const Def * | annex () | ||||
Get Axiom from a plugin. | |||||
const Def * | register_annex (flags_t f, const Def *) | ||||
Univ, Type, Var, Proxy, Infer | |||||
const Univ * | univ () | ||||
Ref | uinc (Ref op, level_t offset=1) | ||||
template<Sort = Sort::Univ> | |||||
Ref | umax (Defs) | ||||
const Type * | type (Ref level) | ||||
const Type * | type_infer_univ () | ||||
template<level_t level = 0> | |||||
const Type * | type () | ||||
Ref | var (Ref type, Def *mut) | ||||
const Proxy * | proxy (Ref type, Defs ops, u32 index, u32 tag) | ||||
Infer * | mut_infer (Ref type) | ||||
Infer * | mut_infer_univ () | ||||
Infer * | mut_infer_type () | ||||
Infer * | mut_infer_entity () | ||||
Either a value ?:?:.Type ? or a type ?:.Type ?:.Type ? . | |||||
Axiom | |||||
const Axiom * | axiom (NormalizeFn n, u8 curry, u8 trip, Ref type, plugin_t p, tag_t t, sub_t s) | ||||
const Axiom * | axiom (Ref type, plugin_t p, tag_t t, sub_t s) | ||||
const Axiom * | axiom (NormalizeFn n, u8 curry, u8 trip, Ref type) | ||||
Builds a fresh Axiom with descending Axiom::sub. | |||||
const Axiom * | axiom (Ref type) | ||||
See above. | |||||
Pi | |||||
const Pi * | pi (Ref dom, Ref codom, bool implicit=false) | ||||
const Pi * | pi (Defs dom, Ref codom, bool implicit=false) | ||||
const Pi * | pi (Ref dom, Defs codom, bool implicit=false) | ||||
const Pi * | pi (Defs dom, Defs codom, bool implicit=false) | ||||
Pi * | mut_pi (Ref type, bool implicit=false) | ||||
Cn | |||||
Pi with codom thorin::Bottom | |||||
const Pi * | cn () | ||||
const Pi * | cn (Ref dom) | ||||
const Pi * | cn (Defs dom) | ||||
const Pi * | fn (Ref dom, Ref codom) | ||||
const Pi * | fn (Defs dom, Ref codom) | ||||
const Pi * | fn (Ref dom, Defs codom) | ||||
const Pi * | fn (Defs dom, Defs codom) | ||||
Lam | |||||
Ref | filter (Lam::Filter filter) | ||||
const Lam * | lam (const Pi *pi, Lam::Filter f, Ref body) | ||||
Lam * | mut_lam (const Pi *pi) | ||||
const Lam * | con (Ref dom, Lam::Filter f, Ref body) | ||||
const Lam * | con (Defs dom, Lam::Filter f, Ref body) | ||||
const Lam * | lam (Ref dom, Ref codom, Lam::Filter f, Ref body) | ||||
const Lam * | lam (Defs dom, Ref codom, Lam::Filter f, Ref body) | ||||
const Lam * | lam (Ref dom, Defs codom, Lam::Filter f, Ref body) | ||||
const Lam * | lam (Defs dom, Defs codom, Lam::Filter f, Ref body) | ||||
const Lam * | fun (Ref dom, Ref codom, Lam::Filter f, Ref body) | ||||
const Lam * | fun (Defs dom, Ref codom, Lam::Filter f, Ref body) | ||||
const Lam * | fun (Ref dom, Defs codom, Lam::Filter f, Ref body) | ||||
const Lam * | fun (Defs dom, Defs codom, Lam::Filter f, Ref body) | ||||
Lam * | mut_con (Ref dom) | ||||
Lam * | mut_con (Defs dom) | ||||
Lam * | mut_lam (Ref dom, Ref codom) | ||||
Lam * | mut_lam (Defs dom, Ref codom) | ||||
Lam * | mut_lam (Ref dom, Defs codom) | ||||
Lam * | mut_lam (Defs dom, Defs codom) | ||||
Lam * | mut_fun (Ref dom, Ref codom) | ||||
Lam * | mut_fun (Defs dom, Ref codom) | ||||
Lam * | mut_fun (Ref dom, Defs codom) | ||||
Lam * | mut_fun (Defs dom, Defs codom) | ||||
Lam * | exit () | ||||
Used as a dummy exit node within Scope. | |||||
App | |||||
Ref | app (Ref callee, Ref arg) | ||||
Ref | app (Ref callee, Defs args) | ||||
template<bool Normalize = false> | |||||
Ref | raw_app (Ref type, Ref callee, Ref arg) | ||||
template<bool Normalize = false> | |||||
Ref | raw_app (Ref type, Ref callee, Defs args) | ||||
Sigma | |||||
Sigma * | mut_sigma (Ref type, size_t size) | ||||
template<level_t level = 0> | |||||
Sigma * | mut_sigma (size_t size) | ||||
A *mut*able Sigma of type level . | |||||
Ref | sigma (Defs ops) | ||||
const Sigma * | sigma () | ||||
The unit type within Type 0. | |||||
Arr | |||||
Arr * | mut_arr (Ref type) | ||||
template<level_t level = 0> | |||||
Arr * | mut_arr () | ||||
Ref | arr (Ref shape, Ref body) | ||||
Ref | arr (Defs shape, Ref body) | ||||
Ref | arr (u64 n, Ref body) | ||||
Ref | arr (View< u64 > shape, Ref body) | ||||
Ref | arr_unsafe (Ref body) | ||||
Tuple | |||||
Ref | tuple (Defs ops) | ||||
Ref | tuple (Ref type, Defs ops) | ||||
Ascribes type to this tuple - needed for dependently typed and mutable Sigmas. | |||||
const Tuple * | tuple () | ||||
the unit value of type [] | |||||
Ref | tuple (Sym sym) | ||||
Converts sym to a tuple of type '«n; I8»'. | |||||
Pack | |||||
Pack * | mut_pack (Ref type) | ||||
Ref | pack (Ref arity, Ref body) | ||||
Ref | pack (Defs shape, Ref body) | ||||
Ref | pack (u64 n, Ref body) | ||||
Ref | pack (View< u64 > shape, Ref body) | ||||
Extract | |||||
| |||||
Ref | extract (Ref d, Ref i) | ||||
Ref | extract (Ref d, u64 a, u64 i) | ||||
Ref | extract (Ref d, u64 i) | ||||
Ref | select (Ref cond, Ref t, Ref f) | ||||
Builds (f, t)#cond . | |||||
Insert | |||||
| |||||
Ref | insert (Ref d, Ref i, Ref val) | ||||
Ref | insert (Ref d, u64 a, u64 i, Ref val) | ||||
Ref | insert (Ref d, u64 i, Ref val) | ||||
Lit | |||||
const Lit * | lit (Ref type, u64 val) | ||||
const Lit * | lit_univ (u64 level) | ||||
const Lit * | lit_univ_0 () | ||||
const Lit * | lit_univ_1 () | ||||
const Lit * | lit_nat (nat_t a) | ||||
const Lit * | lit_nat_0 () | ||||
const Lit * | lit_nat_1 () | ||||
const Lit * | lit_nat_max () | ||||
const Lit * | lit_0_1 () | ||||
const Lit * | lit_i1 () | ||||
const Lit * | lit_i8 () | ||||
const Lit * | lit_i16 () | ||||
const Lit * | lit_i32 () | ||||
const Lit * | lit_i64 () | ||||
const Lit * | lit_idx (nat_t size, u64 val) | ||||
Constructs a Lit of type Idx of size size . | |||||
template<class I > | |||||
const Lit * | lit_idx (I val) | ||||
const Lit * | lit_int (nat_t width, u64 val) | ||||
Constructs a Lit of type Idx of size $2^width$. | |||||
const Lit * | lit_i1 (bool val) | ||||
const Lit * | lit_i2 (u8 val) | ||||
const Lit * | lit_i4 (u8 val) | ||||
const Lit * | lit_i8 (u8 val) | ||||
const Lit * | lit_i16 (u16 val) | ||||
const Lit * | lit_i32 (u32 val) | ||||
const Lit * | lit_i64 (u64 val) | ||||
const Lit * | lit_idx_mod (nat_t mod, u64 val) | ||||
Constructs a Lit of type Idx of size mod . | |||||
const Lit * | lit_bool (bool val) | ||||
const Lit * | lit_ff () | ||||
const Lit * | lit_tt () | ||||
Lattice | |||||
template<bool Up> | |||||
Ref | ext (Ref type) | ||||
Ref | bot (Ref type) | ||||
Ref | top (Ref type) | ||||
Ref | Bot () | ||||
Ref | top_nat () | ||||
template<bool Up> | |||||
TBound< Up > * | mut_bound (Ref type, size_t size) | ||||
template<bool Up, level_t l = 0> | |||||
TBound< Up > * | mut_bound (size_t size) | ||||
A *mut*able Bound of Type level . | |||||
template<bool Up> | |||||
Ref | bound (Defs ops) | ||||
Join * | mut_join (Ref type, size_t size) | ||||
Meet * | mut_meet (Ref type, size_t size) | ||||
template<level_t l = 0> | |||||
Join * | mut_join (size_t size) | ||||
template<level_t l = 0> | |||||
Meet * | mut_meet (size_t size) | ||||
Ref | join (Defs ops) | ||||
Ref | meet (Defs ops) | ||||
Ref | ac (Ref type, Defs ops) | ||||
Ref | ac (Defs ops) | ||||
Infers the type using an immutable Meet. | |||||
Ref | vel (Ref type, Ref value) | ||||
Ref | pick (Ref type, Ref value) | ||||
Ref | test (Ref value, Ref probe, Ref match, Ref clash) | ||||
Ref | singleton (Ref inner_type) | ||||
Globals | |||||
| |||||
Global * | global (Ref type, bool is_mutable=true) | ||||
Types | |||||
const Nat * | type_nat () | ||||
const Idx * | type_idx () | ||||
Ref | type_idx (Ref size) | ||||
Ref | type_idx (nat_t size) | ||||
Ref | type_int (nat_t width) | ||||
Constructs a type Idx of size $2^width$. | |||||
Ref | type_bool () | ||||
Ref | type_i1 () | ||||
Ref | type_i2 () | ||||
Ref | type_i4 () | ||||
Ref | type_i8 () | ||||
Ref | type_i16 () | ||||
Ref | type_i32 () | ||||
Ref | type_i64 () | ||||
Cope with implicit Arguments | |||||
Ref | iapp (Ref callee, Ref arg) | ||||
Places Infer arguments as demanded by Pi::implicit and then apps arg . | |||||
Ref | iapp (Ref callee, Defs args) | ||||
Ref | iapp (Ref callee, nat_t arg) | ||||
template<class E > requires std::is_enum_v<E> && std::is_same_v<std::underlying_type_t<E>, nat_t> | |||||
Ref | iapp (Ref callee, E arg) | ||||
Vars & Muts | |||||
Manges sets of Vars and Muts. | |||||
Vars | vars (const Var *var) | ||||
Muts | muts (Def *mut) | ||||
Vars | merge (Vars a, Vars b) | ||||
Muts | merge (Muts a, Muts b) | ||||
Vars | insert (Vars vars, const Var *var) | ||||
Muts | insert (Muts muts, Def *mut) | ||||
Vars | erase (Vars vars, const Var *var) | ||||
Muts | erase (Muts muts, Def *mut) | ||||
bool | has_intersection (Vars v1, Vars v2) | ||||
bool | has_intersection (Muts m1, Muts m2) | ||||
Helpers | |||||
Ref | iinfer (Ref def) | ||||
dump/log | |||||
Log & | log () | ||||
void | dummy () | ||||
void | dump (std::ostream &os) | ||||
Dump to os . | |||||
void | dump () | ||||
Dump to std::cout . | |||||
void | debug_dump () | ||||
Dump in Debug build if World::log::level is Log::Level::Debug. | |||||
void | write (const char *file) | ||||
Write to a file named file . | |||||
void | write () | ||||
Same above but file name defaults to World::name. | |||||
dot | |||||
Dumps DOT to
| |||||
void | dot (std::ostream &os, bool annexes=false, bool types=false) const | ||||
void | dot (const char *file=nullptr, bool annexes=false, bool types=false) const | ||||
Same as above but write to file or std::cout if file is nullptr . | |||||
The World represents the whole program and manages creation of Thorin nodes (Defs).
Defs are hashed into an internal HashSet. The World's factory methods just calculate a hash and lookup the Def, if it is already present, or create a new one otherwise. This corresponds to value numbering.
You can create several worlds. All worlds are completely independent from each other.
Note that types are also just Defs and will be hashed as well.
|
explicit |
Definition at line 38 of file world.cpp.
References Bot(), cn(), lit_idx(), lit_nat(), lit_univ(), lit_univ_0(), lit_univ_1(), mut_lam(), pi(), thorin::Lam::set(), sigma(), sym(), type(), type_idx(), and type_nat().
|
inlinenoexcept |
|
inline |
|
inline |
Lookup annex by Axiom::id.
Definition at line 167 of file world.h.
References thorin::Annex::demangle(), thorin::error(), and flags().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_pack(), and thorin::plug::matrix::LowerMatrixMediumLevel::rewrite_().
|
inline |
Definition at line 149 of file world.h.
Referenced by dot(), dot(), thorin::RWPhase::start(), thorin::Cleanup::start(), and verify().
Definition at line 183 of file world.cpp.
References thorin::Check::assignable(), thorin::Lam::body(), DLOG, thorin::Pi::dom(), thorin::Infer::eliminate(), thorin::error(), thorin::Lam::filter(), thorin::Def::is_set(), thorin::Def::isa_imm(), thorin::Def::isa_mut(), lam(), lit_ff(), lit_tt(), pi(), thorin::Def::reduce(), thorin::Rewriter::rewrite(), type(), thorin::Def::type(), and thorin::Def::var().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_app(), thorin::plug::autodiff::AutoDiffEval::augment_pack(), iapp(), thorin::plug::autodiff::op_sum(), thorin::LamSpec::rewrite(), thorin::TailRecElim::rewrite(), thorin::plug::affine::LowerFor::rewrite(), thorin::plug::direct::DS2CPS::rewrite(), thorin::plug::mem::CopyProp::rewrite(), thorin::plug::matrix::LowerMatrixHighLevelMapRed::rewrite_(), thorin::plug::matrix::LowerMatrixMediumLevel::rewrite_(), and type_idx().
Sym thorin::World::append_suffix | ( | Sym | name, |
std::string | suffix | ||
) |
Definition at line 378 of file world.cpp.
References arr(), thorin::error(), extract(), thorin::Lit::isa(), thorin::Def::ops(), pack(), sigma(), tuple(), and thorin::Def::unfold_type().
Referenced by arr(), arr(), arr(), arr_unsafe(), thorin::plug::autodiff::AutoDiffEval::augment_pack(), ext(), extract(), pack(), and sigma().
|
inline |
Builds a fresh Axiom with descending Axiom::sub.
This is useful during testing to come up with some entitiy of a specific type. It uses the plugin Axiom::Global_Plugin and starts with 0
for Axiom::sub and counts up from there. The Axiom::tag is set to 0
and the Axiom::normalizer to nullptr
.
Definition at line 225 of file world.h.
References axiom(), thorin::World::State::POD::curr_sub, thorin::Annex::Global_Plugin, thorin::World::State::pod, and type().
|
inline |
Definition at line 414 of file world.h.
References type().
Referenced by thorin::plug::autodiff::AutoDiffZeroCleanup::rewrite(), and thorin::plug::clos::LowerTypedClos::start().
void thorin::World::breakpoint | ( | u32 | gid | ) |
|
inline |
Definition at line 136 of file world.h.
References thorin::World::State::breakpoints.
|
inline |
|
inline |
Definition at line 497 of file world.h.
References annex(), and call_().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_extract(), thorin::plug::autodiff::AutoDiffEval::augment_lam(), thorin::plug::clos::ClosConvPrep::eta_wrap(), thorin::plug::compile::normalize_single_pass_phase(), thorin::plug::affine::LowerFor::rewrite(), thorin::plug::clos::LowerTypedClosPrep::rewrite(), thorin::plug::matrix::LowerMatrixMediumLevel::rewrite_(), and thorin::plug::matrix::LowerMatrixLowLevel::rewrite_imm().
|
inline |
|
inline |
|
inline |
|
inline |
Manage global identifier - a unique number for each Def.
Definition at line 91 of file world.h.
References thorin::World::State::POD::curr_gid, and thorin::World::State::pod.
Referenced by dump().
void thorin::World::debug_dump | ( | ) |
Dump in Debug build if World::log::level is Log::Level::Debug.
Definition at line 458 of file dump.cpp.
References thorin::Log::Debug, dump(), and log().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_app(), DebugDump::prepare(), and thorin::PassMan::run().
void thorin::World::dot | ( | const char * | file = nullptr , |
bool | annexes = false , |
||
bool | types = false |
||
) | const |
void thorin::World::dot | ( | std::ostream & | os, |
bool | annexes = false , |
||
bool | types = false |
||
) | const |
Definition at line 144 of file dot.cpp.
References annex(), annexes(), dot(), external(), and externals().
|
inline |
Definition at line 83 of file world.h.
Referenced by thorin::Parser::driver(), dump(), flags(), inherit(), log(), thorin::optimize(), register_annex(), sym(), sym(), and sym().
void thorin::World::dump | ( | ) |
void thorin::World::dump | ( | std::ostream & | os | ) |
Dump to os
.
Definition at line 436 of file dump.cpp.
References assertf, curr_gid(), driver(), externals(), flags(), thorin::Driver::imports(), thorin::Driver::is_loaded(), name(), and thorin::print().
Referenced by main().
|
inline |
Definition at line 97 of file world.h.
References thorin::World::State::POD::loc, and thorin::World::State::pod.
|
inline |
|
inline |
Lookup by name
.
Definition at line 164 of file world.h.
References thorin::lookup(), and name().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_(), dot(), thorin::optimize(), and thorin::plug::matrix::LowerMatrixHighLevelMapRed::rewrite_().
|
inline |
Definition at line 150 of file world.h.
Referenced by dot(), dump(), thorin::optimize(), thorin::PassMan::run(), thorin::RWPhase::start(), thorin::Cleanup::start(), thorin::ScopePhase::start(), thorin::ClosedMutPhase< M >::start(), and verify().
Definition at line 278 of file world.cpp.
References thorin::Check::alpha(), thorin::Def::arity(), arr(), thorin::Lit::as(), thorin::Def::as_lit_arity(), thorin::error(), extract(), insert(), thorin::Lit::isa(), thorin::Def::isa_mut(), mut_sigma(), thorin::Def::num_ops(), thorin::Def::op(), thorin::Def::ops(), pack(), thorin::Def::reduce(), thorin::Rewriter::rewrite(), sigma(), thorin::Idx::size(), tuple(), type(), thorin::Def::type(), thorin::Def::var(), and WLOG.
Referenced by arr(), thorin::plug::autodiff::AutoDiffEval::augment_extract(), thorin::plug::autodiff::AutoDiffEval::augment_pack(), extract(), select(), and tuple().
|
inline |
Flags & thorin::World::flags | ( | ) |
Retrive compile Flags.
Definition at line 74 of file world.cpp.
References driver(), and thorin::Driver::flags().
Referenced by annex(), dump(), thorin::plug::compile::handle_optimization_part(), insert(), and thorin::Def::num_tprojs().
|
inline |
Yields old frozen state.
Definition at line 115 of file world.h.
References thorin::World::State::POD::frozen, and thorin::World::State::pod.
Referenced by thorin::World::Freezer::~Freezer().
|
inline |
|
inline |
|
inline |
|
inline |
Places Infer arguments as demanded by Pi::implicit and then apps arg
.
Definition at line 162 of file world.cpp.
References app(), thorin::Check::assignable(), thorin::decurry(), thorin::Pi::dom(), thorin::Pi::is_implicit(), mut_infer(), pi(), thorin::Ref::refer(), and thorin::Def::type().
Definition at line 506 of file world.h.
References thorin::Idx::size(), and thorin::Def::type().
|
inline |
Definition at line 75 of file world.h.
References driver(), and state().
Referenced by thorin::Cleanup::start().
Definition at line 340 of file world.cpp.
References thorin::Check::alpha(), thorin::Def::arity(), thorin::Check::assignable(), thorin::error(), flags(), insert(), thorin::Lit::isa(), thorin::Def::isa_lit_arity(), pack(), thorin::Def::proj(), thorin::Flags::scalerize_threshold, thorin::Idx::size(), tuple(), type(), and thorin::Def::type().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_extract(), extract(), insert(), and thorin::VarRewriter::rewrite_mut().
|
inline |
Definition at line 112 of file world.h.
References thorin::World::State::POD::frozen, and thorin::World::State::pod.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 435 of file world.cpp.
References thorin::error(), thorin::Lit::isa(), thorin::Idx::size(), and type().
Referenced by lit_idx(), lit_nat(), lit_univ(), and thorin::plug::demo::normalize_const().
|
inline |
|
inline |
|
inline |
Definition at line 405 of file world.h.
Referenced by app(), and thorin::plug::core::normalize_pe().
|
inline |
Definition at line 373 of file world.h.
References thorin::Idx::bitwidth2size(), and lit_nat().
|
inline |
|
inline |
Definition at line 375 of file world.h.
References thorin::Idx::bitwidth2size(), and lit_nat().
|
inline |
Definition at line 376 of file world.h.
References thorin::Idx::bitwidth2size(), and lit_nat().
|
inline |
Definition at line 377 of file world.h.
References thorin::Idx::bitwidth2size(), and lit_nat().
Referenced by thorin::plug::mem::op_lea_unsafe().
|
inline |
Definition at line 374 of file world.h.
References thorin::Idx::bitwidth2size(), and lit_nat().
Referenced by tuple().
|
inline |
Definition at line 382 of file world.h.
References thorin::Idx::bitwidth2size(), and lit_idx().
Constructs a Lit of
type Idx of size $2^width$.
val = 64
will be automatically converted to size 0
- the encoding for $2^64$.
Definition at line 389 of file world.h.
References thorin::Idx::bitwidth2size(), and lit_idx().
Referenced by lit_i1(), lit_i16(), lit_i2(), lit_i32(), lit_i4(), lit_i64(), and lit_i8().
Definition at line 367 of file world.h.
References lit(), and type_nat().
Referenced by thorin::Def::arity(), arr(), iapp(), iapp(), lit_i1(), lit_i16(), lit_i32(), lit_i64(), lit_i8(), thorin::plug::refly::normalize_gid(), thorin::plug::core::normalize_trait(), pack(), type_idx(), type_int(), and World().
|
inline |
Definition at line 368 of file world.h.
Referenced by thorin::plug::matrix::LowerMatrixLowLevel::rewrite_imm(), and thorin::Pack::shape().
|
inline |
Definition at line 369 of file world.h.
Referenced by thorin::Def::arity(), and thorin::Pack::shape().
|
inline |
Definition at line 406 of file world.h.
Referenced by app(), and thorin::plug::core::normalize_ncmp().
|
inline |
|
inline |
Log & thorin::World::log | ( | ) |
Definition at line 73 of file world.cpp.
References driver(), and thorin::Driver::log().
Referenced by debug_dump().
|
inline |
Definition at line 151 of file world.h.
References thorin::assert_emplace(), thorin::Def::is_closed(), thorin::Def::is_external(), and thorin::Def::sym().
Referenced by thorin::Def::make_external().
|
inline |
Definition at line 157 of file world.h.
References thorin::Def::is_external(), and thorin::Def::sym().
Referenced by thorin::Def::make_internal().
Definition at line 486 of file world.h.
Referenced by thorin::Def::Def(), and thorin::Def::free_vars().
Definition at line 275 of file world.h.
References cn().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_lam(), and thorin::plug::affine::LowerFor::rewrite().
Definition at line 281 of file world.h.
References fn().
Referenced by thorin::plug::matrix::LowerMatrixMediumLevel::rewrite_().
Definition at line 201 of file world.h.
References type().
Referenced by iapp(), mut_infer_entity(), mut_infer_type(), and mut_infer_univ().
|
inline |
Either a value ?:?:.Type ?
or a type ?:.Type ?:.Type ?
.
Definition at line 206 of file world.h.
References mut_infer(), and type_infer_univ().
|
inline |
Definition at line 203 of file world.h.
References mut_infer(), and type_infer_univ().
Referenced by thorin::IdPtrn::type().
|
inline |
Definition at line 202 of file world.h.
References mut_infer(), and univ().
Referenced by type_infer_univ().
Definition at line 263 of file world.h.
References pi().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_app(), thorin::plug::autodiff::AutoDiffEval::augment_extract(), thorin::plug::autodiff::AutoDiffEval::augment_pack(), thorin::plug::autodiff::AutoDiffEval::augment_tuple(), thorin::plug::autodiff::AutoDiffEval::derive_(), thorin::RetWrap::enter(), and World().
Definition at line 332 of file world.h.
References type().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_pack().
Definition at line 301 of file world.h.
References type().
Referenced by extract(), and thorin::TuplePtrn::type().
A *mut*able Sigma of type level
.
Definition at line 303 of file world.h.
References mut_sigma().
Referenced by mut_sigma().
Definition at line 485 of file world.h.
Referenced by erase(), insert(), and thorin::Def::local_muts().
|
inline |
Definition at line 86 of file world.h.
References thorin::World::State::POD::name, and thorin::World::State::pod.
Referenced by append_suffix(), dump(), external(), set(), set(), and write().
|
inline |
Definition at line 92 of file world.h.
References thorin::World::State::POD::curr_gid, and thorin::World::State::pod.
Referenced by thorin::Def::Def(), and thorin::Def::Def().
Definition at line 405 of file world.cpp.
References arr(), thorin::error(), thorin::Lit::isa(), thorin::Def::ops(), pack(), tuple(), type(), and thorin::Def::type().
Referenced by arr(), thorin::plug::autodiff::AutoDiffEval::augment_pack(), ext(), extract(), insert(), pack(), pack(), pack(), and tuple().
Definition at line 205 of file world.cpp.
References axiom(), thorin::Axiom::get(), thorin::Axiom::normalizer(), thorin::Axiom::Trip_End, and type().
Referenced by thorin::plug::autodiff::normalize_ad(), thorin::plug::matrix::normalize_insert(), thorin::plug::matrix::normalize_map_reduce(), thorin::plug::regex::normalize_not(), thorin::plug::matrix::normalize_prod(), thorin::plug::mem::normalize_remem(), thorin::plug::matrix::normalize_transpose(), and thorin::plug::autodiff::normalize_zero().
Definition at line 80 of file world.cpp.
References thorin::assert_emplace(), thorin::Annex::demangle(), and driver().
|
inline |
Definition at line 88 of file world.h.
References thorin::World::State::POD::name, name(), thorin::World::State::pod, and sym().
|
inline |
Definition at line 87 of file world.h.
References thorin::World::State::POD::name, name(), and thorin::World::State::pod.
Referenced by main().
|
inline |
Definition at line 218 of file world.cpp.
References arr(), thorin::Check::is_uniform(), and sigma().
Referenced by thorin::flatten(), thorin::Sigma::immutabilize(), thorin::is_unit(), thorin::merge_sigma(), thorin::plug::affine::LowerFor::rewrite(), thorin::plug::mem::CopyProp::rewrite(), and thorin::TuplePtrn::type().
|
inline |
Sym thorin::World::sym | ( | const char * | s | ) |
Sym thorin::World::sym | ( | const std::string & | s | ) |
Sym thorin::World::sym | ( | std::string_view | s | ) |
Definition at line 77 of file world.cpp.
References driver().
Referenced by append_suffix(), thorin::plug::autodiff::AutoDiffEval::augment_(), thorin::Def::debug_prefix(), thorin::Def::debug_suffix(), thorin::Annex::demangle(), main(), thorin::optimize(), thorin::plug::matrix::LowerMatrixMediumLevel::rewrite_(), set(), thorin::Annex::split(), thorin::Def::sym(), thorin::Def::sym(), thorin::Def::sym(), tuple(), and World().
Definition at line 501 of file world.cpp.
References thorin::Check::alpha(), thorin::Pi::codom(), thorin::Pi::dom(), join(), thorin::match(), pi(), and thorin::Def::type().
|
inline |
Definition at line 417 of file world.h.
Referenced by arr_unsafe().
|
inline |
Definition at line 226 of file world.cpp.
References thorin::Check::assignable(), thorin::error(), sigma(), and tuple().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_tuple(), thorin::Lam::branch(), thorin::plug::matrix::counting_for(), thorin::plug::autodiff::AutoDiffEval::derive_(), thorin::RetWrap::enter(), thorin::flatten(), thorin::merge_tuple(), thorin::LamSpec::rewrite(), thorin::plug::affine::LowerFor::rewrite(), thorin::plug::mem::SSAConstr::rewrite(), thorin::plug::matrix::LowerMatrixMediumLevel::rewrite_(), and thorin::plug::matrix::LowerMatrixLowLevel::rewrite_imm().
Ascribes type
to this tuple - needed for dependently typed and mutable Sigmas.
Definition at line 237 of file world.cpp.
References extract(), thorin::Check::is_uniform(), thorin::Lit::isa(), thorin::Def::isa_mut(), pack(), tuple(), type(), and thorin::Def::type().
Ref thorin::World::tuple | ( | Sym | sym | ) |
Definition at line 188 of file world.h.
References lit_univ(), and type().
Referenced by ac(), app(), axiom(), axiom(), axiom(), axiom(), bot(), ext(), extract(), global(), insert(), lit(), mut_arr(), mut_bound(), mut_infer(), mut_join(), mut_meet(), mut_pack(), mut_pi(), mut_sigma(), pack(), pick(), proxy(), raw_app(), raw_app(), top(), tuple(), type(), type_infer_univ(), umax(), var(), vel(), and World().
Definition at line 92 of file world.cpp.
References thorin::error(), and thorin::Def::type().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_app(), thorin::plug::affine::LowerFor::rewrite(), and thorin::Def::unfold_type().
|
inline |
Definition at line 462 of file world.h.
References type_int().
|
inline |
Definition at line 459 of file world.h.
References type_int().
|
inline |
Definition at line 463 of file world.h.
References type_int().
Referenced by thorin::plug::matrix::LowerMatrixMediumLevel::rewrite_().
|
inline |
Definition at line 460 of file world.h.
References type_int().
|
inline |
Definition at line 464 of file world.h.
References type_int().
|
inline |
Definition at line 461 of file world.h.
References type_int().
|
inline |
Definition at line 447 of file world.h.
Referenced by lit_idx(), thorin::plug::matrix::LowerMatrixMediumLevel::rewrite_(), type_int(), and World().
size = 0
means 2^64
. Definition at line 451 of file world.h.
References lit_nat(), and type_idx().
Referenced by type_idx().
size = 0
means 2^64
. Definition at line 449 of file world.h.
References app(), and type_idx().
Referenced by type_idx().
|
inline |
Definition at line 187 of file world.h.
References mut_infer_univ(), and type().
Referenced by mut_infer_entity(), and mut_infer_type().
Constructs a type Idx of size $2^width$.
width = 64
will be automatically converted to size 0
- the encoding for $2^64$.
Definition at line 455 of file world.h.
References thorin::Idx::bitwidth2size(), lit_nat(), and type_idx().
Referenced by type_i16(), type_i2(), type_i32(), type_i4(), type_i64(), and type_i8().
|
inline |
Definition at line 99 of file world.cpp.
References thorin::error(), thorin::Lit::isa(), lit_univ(), and thorin::Def::type().
Definition at line 107 of file world.cpp.
References thorin::error(), thorin::Lit::isa(), thorin::Kind, thorin::Type::level(), lit_univ(), thorin::Term, thorin::Type, type(), and thorin::Univ.
Referenced by thorin::TuplePtrn::type().
|
inline |
Definition at line 183 of file world.h.
Referenced by lit_univ(), mut_infer_univ(), and thorin::Rewriter::rewrite().
Definition at line 153 of file world.cpp.
References thorin::Lit::isa(), lit_0_1(), thorin::Idx::size(), type(), and var().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_extract(), thorin::plug::autodiff::AutoDiffEval::augment_tuple(), erase(), insert(), thorin::plug::affine::LowerFor::rewrite(), var(), and vars().
Definition at line 484 of file world.h.
References var().
Referenced by thorin::Def::Def(), erase(), insert(), thorin::plug::matrix::LowerMatrixMediumLevel::rewrite_(), and thorin::VarRewriter::VarRewriter().
World & thorin::World::verify | ( | ) |
Verifies that all externals() and annexes() are Def::is_closed(), if THORIN_ENABLE_CHECKS
.
Definition at line 551 of file world.cpp.
References annex(), annexes(), externals(), and thorin::Def::is_closed().
Referenced by thorin::PassMan::run(), and thorin::Phase::run().
void thorin::World::write | ( | ) |
void thorin::World::write | ( | const char * | file | ) |