Skip to content

Commit 768b131

Browse files
authored
Fix "regalloc" profile category (#3968)
1 parent 6e3762a commit 768b131

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

asmcomp/asmgen.ml

+18-15
Original file line numberDiff line numberDiff line change
@@ -341,23 +341,28 @@ let compile_cfg ppf_dump ~funcnames fd_cmm cfg_with_layout =
341341
++ Cfg_with_infos.make
342342
++ cfg_with_infos_profile ~accumulate:true "cfg_deadcode" Cfg_deadcode.run
343343
in
344-
let cfg_description =
345-
Regalloc_validate.Description.create
346-
(Cfg_with_infos.cfg_with_layout cfg_with_infos)
347-
in
348344
cfg_with_infos
349-
++ (match register_allocator with
350-
| GI -> cfg_with_infos_profile ~accumulate:true "cfg_gi" Regalloc_gi.run
351-
| IRC -> cfg_with_infos_profile ~accumulate:true "cfg_irc" Regalloc_irc.run
352-
| LS -> cfg_with_infos_profile ~accumulate:true "cfg_ls" Regalloc_ls.run)
353-
++ Cfg_with_infos.cfg_with_layout
345+
++ Profile.record ~accumulate:true "regalloc" (fun cfg_with_infos ->
346+
let cfg_description =
347+
Regalloc_validate.Description.create
348+
(Cfg_with_infos.cfg_with_layout cfg_with_infos)
349+
in
350+
cfg_with_infos
351+
++ (match register_allocator with
352+
| GI ->
353+
cfg_with_infos_profile ~accumulate:true "cfg_gi" Regalloc_gi.run
354+
| IRC ->
355+
cfg_with_infos_profile ~accumulate:true "cfg_irc" Regalloc_irc.run
356+
| LS ->
357+
cfg_with_infos_profile ~accumulate:true "cfg_ls" Regalloc_ls.run)
358+
++ Cfg_with_infos.cfg_with_layout
359+
++ cfg_with_layout_profile ~accumulate:true "cfg_validate_description"
360+
(Regalloc_validate.run cfg_description))
354361
++ Profile.record ~accumulate:true "cfg_available_regs"
355362
(available_regs
356363
~stack_slots:(fun x ->
357364
(Cfg_with_layout.cfg x).Cfg.fun_num_stack_slots)
358365
~f:Cfg_available_regs.run)
359-
++ cfg_with_layout_profile ~accumulate:true "cfg_validate_description"
360-
(Regalloc_validate.run cfg_description)
361366
++ Profile.record ~accumulate:true "cfg_invariants" (cfg_invariants ppf_dump)
362367
++ cfg_with_layout_profile ~accumulate:true "cfg_simplify"
363368
Regalloc_utils.simplify_cfg
@@ -388,10 +393,8 @@ let compile_fundecl ~ppf_dump ~funcnames fd_cmm =
388393
++ pass_dump_cfg_if ppf_dump Flambda_backend_flags.dump_cfg
389394
"After selection")
390395
++ Profile.record ~accumulate:true "cfg_invariants" (cfg_invariants ppf_dump)
391-
++ Profile.record ~accumulate:true "regalloc" (fun cfg_with_layout ->
392-
cfg_with_layout
393-
++ Profile.record ~accumulate:true "cfg" (fun cfg_with_layout ->
394-
compile_cfg ppf_dump ~funcnames fd_cmm cfg_with_layout))
396+
++ Profile.record ~accumulate:true "cfg" (fun cfg_with_layout ->
397+
compile_cfg ppf_dump ~funcnames fd_cmm cfg_with_layout)
395398
++ pass_dump_linear_if ppf_dump dump_linear "Linearized code"
396399
++ Compiler_hooks.execute_and_pipe Compiler_hooks.Linear
397400
++ Profile.record ~accumulate:true "save_linear" save_linear

0 commit comments

Comments
 (0)