16 return {
"opt",
nullptr,
20 auto& driver = builder.world().driver();
22 auto plugin_axiom = args[1]->as<
Axiom>();
23 auto then_phase = args[2];
24 auto else_phase = args[3];
25 auto name = plugin_axiom->
sym();
27 auto plugin = tag.view().substr(0, tag.view().find(
'_'));
28 bool is_loaded = driver.is_loaded(driver.sym(plugin));
30 assert(tag.view().find(
'_') != std::string_view::npos
31 &&
"thorin/plugin_phase: invalid plugin name");
32 world.DLOG(
"thorin/plugin_phase for: {}", plugin_axiom->sym());
33 world.DLOG(
"thorin/plugin: {}", plugin);
34 world.DLOG(
"contained: {}", is_loaded);
The World represents the whole program and manages creation of Thorin nodes (Defs).
void handle_optimization_part(const Def *part, World &world, Passes &passes, PipelineBuilder &builder)
absl::flat_hash_map< flags_t, std::function< void(World &, PipelineBuilder &, const Def *)> > Passes
axiom ↦ (pipeline part) × (axiom application) → () The function should inspect Application to const...
THORIN_EXPORT thorin::Plugin thorin_get_plugin()
To be implemented and exported by a plugin.
std::pair< const Def *, std::vector< const Def * > > collect_args(const Def *def)
Helper function to cope with the fact that normalizers take all arguments and not only its axiom argu...
static constexpr flags_t Base
static std::array< Sym, 3 > split(World &, Sym)
Basic info and registration function pointer to be returned from a specific plugin.