11 auto compilation_functions = {world.
sym(
"_compile"), world.
sym(
"_default_compile"), world.
sym(
"_core_compile"),
12 world.
sym(
"_fallback_compile")};
13 const Def* compilation =
nullptr;
14 for (
auto compilation_function : compilation_functions) {
15 if (
auto compilation_ = world.
external(compilation_function)) {
16 if (!compilation) compilation = compilation_;
23 for (
auto [_, def] : externals) {
24 if (
auto lam = def->isa<
Lam>(); lam && lam->num_doms() == 0) {
25 if (lam->codom()->sym().view() ==
"%compile.Pipeline") {
26 if (!compilation) compilation = lam;
31 assert(compilation &&
"no compilation function found");
38 world.DLOG(
"compilation using {} : {}", compilation, compilation->
type());
45 auto pipeline = compilation->as<
Lam>()->body();
49 auto pipeline_axiom = ax->as<
Axiom>();
50 auto pipeline_flags = pipeline_axiom->
flags();
51 world.DLOG(
"Building pipeline");
52 if (
auto pass = world.
driver().
pass(pipeline_flags))
53 (*pass)(world, pipe_builder, pipeline);
55 error(
"pipeline_axiom not found in passes");
57 world.DLOG(
"Executing pipeline");
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...