Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/compiler/passes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ proved correct. Each pass falls into one of the three following categories.
Here is a list of the passes with a short description of what each does.
Each pass is described in more detail on a dedicated page.

- [Automated spilling](auto_spill) inserts spilling automatically (experimental)
- [Replace word ints](wint_word) replaces word-sized integers with machine words
- [Insert renaming](insert_renaming) introduces renaming assignments at export function boundaries
- [Array copy](array_copy) expands `#copy` operations into explicit `for` loops
Expand Down Expand Up @@ -79,6 +80,7 @@ Each pass is described in more detail on a dedicated page.
:::{toctree}
:hidden:

auto_spill
wint_word
insert_renaming
array_copy
Expand Down
15 changes: 10 additions & 5 deletions docs/source/compiler/passes/passes.dot
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ preprocess[label="Preprocess",fillcolor=moccasin];
typing[label="Type-check",style="filled,dotted",fillcolor=moccasin];
jasmin[label="Jasmin",shape=oval,fillcolor=white];

autospill[label="Automated\nspilling",fillcolor=moccasin,href="auto_spill.html",target="_top",tooltip="Insert spilling automatically (experimental)"];
wintword[label="Replace\nword ints",fillcolor=lightgreen,href="wint_word.html",target="_top",tooltip="Replace word ints"];
renaming[label="Insert\nrenaming",fillcolor=lightgreen,href="insert_renaming.html",target="_top",tooltip="Insert renaming"];
arraycopy[label="Array\ncopy",fillcolor=lightgreen,href="array_copy.html",target="_top",tooltip="Array copy"];
Expand Down Expand Up @@ -62,9 +63,10 @@ subgraph line1 {
parse -> preprocess;
preprocess -> typing;
typing -> jasmin;
jasmin -> autospill;
}

jasmin -> wintword;
autospill -> wintword;
Comment on lines +66 to +69
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d put autospill before jasmin.

Copy link
Contributor Author

@eponier eponier Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just followed the code, should we move do_auto_spill before

(* The source program, before any compilation pass. *)
let source_prog = prog in

?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The auto-spill feature will undergo some refactoring soon. In particular I’ll move it later in the compilation pipeline.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what should I do with this PR? Should I just wait for the refactoring?


subgraph line2 {
edge[dir=back];
Expand Down Expand Up @@ -173,13 +175,16 @@ subgraph caption {
edge[style=invis];

// This better aligns the blocks
jazz -> inline;
rmfunc -> loadconst;
jazz -> lowerspill -> cstprop -> rmglobals -> propagate -> linearization -> tunnel;
parse -> addarrinit -> dce -> splitting2 -> slhlowering -> onevarmap -> asmgen;
preprocess -> arraycopy -> unroll -> arrexp -> stkalloc -> dce2 -> asm;
typing -> renaming -> rmfunc2 -> makeref -> stack -> ralloc -> prettyprint;
lowering -> linear;
parse -> lowerspill -> cstprop -> rmglobals -> propagate -> linearization -> tunnel;
preprocess -> addarrinit -> dce -> splitting2 -> slhlowering -> onevarmap -> asmgen;
typing -> arraycopy -> unroll -> arrexp -> stkalloc -> dce2 -> asm;
jasmin -> renaming -> rmfunc2 -> makeref -> stack -> ralloc -> prettyprint;
wintword -> splitting;
rmarrinit -> loweraddr;
rmreturn -> asmfile;

// This puts the caption below the graph
proved0[style=invis];
Expand Down