Skip to content

Commit f203a5d

Browse files
authored
Run the Polling pass earlier (#10523)
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
1 parent 9f1b1ed commit f203a5d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

asmcomp/asmgen.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,16 @@ let compile_fundecl ~ppf_dump ~funcnames fd_cmm =
139139
fd_cmm
140140
++ Profile.record ~accumulate:true "cmm_invariants" (cmm_invariants ppf_dump)
141141
++ Profile.record ~accumulate:true "selection"
142-
(Selection.fundecl ~future_funcnames:funcnames)
142+
(Selection.fundecl ~future_funcnames:funcnames)
143+
++ Profile.record ~accumulate:true "polling"
144+
(Polling.instrument_fundecl ~future_funcnames:funcnames)
143145
++ pass_dump_if ppf_dump dump_selection "After instruction selection"
144146
++ Profile.record ~accumulate:true "comballoc" Comballoc.fundecl
145147
++ pass_dump_if ppf_dump dump_combine "After allocation combining"
146148
++ Profile.record ~accumulate:true "cse" CSE.fundecl
147149
++ pass_dump_if ppf_dump dump_cse "After CSE"
148150
++ Profile.record ~accumulate:true "liveness" liveness
149151
++ Profile.record ~accumulate:true "deadcode" Deadcode.fundecl
150-
++ Profile.record ~accumulate:true "polling"
151-
(Polling.instrument_fundecl ~future_funcnames:funcnames)
152152
++ pass_dump_if ppf_dump dump_live "Liveness analysis"
153153
++ Profile.record ~accumulate:true "spill" Spill.fundecl
154154
++ Profile.record ~accumulate:true "liveness" liveness

0 commit comments

Comments
 (0)