Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero alloc: move checkmach pass before Comballoc and CSE #1786

Merged
Merged
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
4 changes: 2 additions & 2 deletions backend/asmgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,14 @@ let compile_fundecl ~ppf_dump ~funcnames fd_cmm =
++ Profile.record ~accumulate:true "polling"
(Polling.instrument_fundecl ~future_funcnames:funcnames)
++ Compiler_hooks.execute_and_pipe Compiler_hooks.Mach_polling
++ Profile.record ~accumulate:true "checkmach"
(Checkmach.fundecl ~future_funcnames:funcnames ppf_dump)
++ Profile.record ~accumulate:true "comballoc" Comballoc.fundecl
++ Compiler_hooks.execute_and_pipe Compiler_hooks.Mach_combine
++ pass_dump_if ppf_dump dump_combine "After allocation combining"
++ Profile.record ~accumulate:true "cse" CSE.fundecl
++ Compiler_hooks.execute_and_pipe Compiler_hooks.Mach_cse
++ pass_dump_if ppf_dump dump_cse "After CSE"
++ Profile.record ~accumulate:true "checkmach"
(Checkmach.fundecl ~future_funcnames:funcnames ppf_dump)
++ Profile.record ~accumulate:true "regalloc" (fun (fd : Mach.fundecl) ->
match register_allocator fd with
| ((IRC | LS) as regalloc) ->
Expand Down
8 changes: 3 additions & 5 deletions tests/backend/checkmach/fail19.output
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
File "fail19.ml", line 7, characters 5-15:
Error: Annotation check for zero_alloc failed on function Fail19.foo (camlFail19__foo_HIDE_STAMP)
File "fail19.ml", line 18, characters 5-26:
allocate 48 bytes (fail19.ml:18,5--26;dep19.ml:1,38--52)
File "fail19.ml", line 18, characters 5-26:
external call to caml_make_array (fail19.ml:18,5--26;dep19.ml:1,38--52)
File "fail19.ml", line 10, characters 12-17:
Expand All @@ -15,10 +17,6 @@ File "fail19.ml", line 14, characters 46-54:
File "fail19.ml", line 15, characters 11-20:
allocate 24 bytes
File "fail19.ml", line 17, characters 10-15:
allocate 72 bytes combining 2 allocations below
File "fail19.ml", line 18, characters 5-26:
allocate 6 words
File "fail19.ml", line 17, characters 10-15:
allocate 3 words
allocate 24 bytes
File "fail19.ml", line 18, characters 2-27:
allocate 24 bytes
Loading