Skip to content

Commit

Permalink
Run the Polling pass earlier (#10523)
Browse files Browse the repository at this point in the history
Inserting poll point adds new control paths: a poll can raise an
exception that is handled by a try...with in the same function.

As #10520, this can invalidate optimizations performed before poll
point insertion, such as dead code elimination.

This commit moves the Polling pass just after the Selection pass,
before all optimization passes.

Fixes: #10520
  • Loading branch information
xavierleroy committed Jul 17, 2021
1 parent 9f1b1ed commit f203a5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions asmcomp/asmgen.ml
Expand Up @@ -139,16 +139,16 @@ let compile_fundecl ~ppf_dump ~funcnames fd_cmm =
fd_cmm
++ Profile.record ~accumulate:true "cmm_invariants" (cmm_invariants ppf_dump)
++ Profile.record ~accumulate:true "selection"
(Selection.fundecl ~future_funcnames:funcnames)
(Selection.fundecl ~future_funcnames:funcnames)
++ Profile.record ~accumulate:true "polling"
(Polling.instrument_fundecl ~future_funcnames:funcnames)
++ pass_dump_if ppf_dump dump_selection "After instruction selection"
++ Profile.record ~accumulate:true "comballoc" Comballoc.fundecl
++ pass_dump_if ppf_dump dump_combine "After allocation combining"
++ Profile.record ~accumulate:true "cse" CSE.fundecl
++ pass_dump_if ppf_dump dump_cse "After CSE"
++ Profile.record ~accumulate:true "liveness" liveness
++ Profile.record ~accumulate:true "deadcode" Deadcode.fundecl
++ Profile.record ~accumulate:true "polling"
(Polling.instrument_fundecl ~future_funcnames:funcnames)
++ pass_dump_if ppf_dump dump_live "Liveness analysis"
++ Profile.record ~accumulate:true "spill" Spill.fundecl
++ Profile.record ~accumulate:true "liveness" liveness
Expand Down

0 comments on commit f203a5d

Please sign in to comment.