Debian Codegraph @

gcc/passes.def

raw
1 /* Description of pass structure
2 Copyright (C) 1987-2025 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
10
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
19
20 /* Note that this file is processed by a simple parser:
21 'gen-pass-instances.awk', so carefully verify the generated
22 'pass-instances.def' if you deviate from the syntax otherwise used in
23 here. */
24
25
26 /* All passes needed to lower the function into shape optimizers can
27 operate on. These passes are always run first on the function, but
28 backend might produce already lowered functions that are not processed
29 by these passes. */
30 INSERT_PASSES_AFTER (all_lowering_passes)
31 NEXT_PASS (pass_warn_unused_result);
32 NEXT_PASS (pass_diagnose_omp_blocks);
33 NEXT_PASS (pass_diagnose_tm_blocks);
34 NEXT_PASS (pass_omp_oacc_kernels_decompose);
35 NEXT_PASS (pass_lower_omp);
36 NEXT_PASS (pass_lower_cf);
37 NEXT_PASS (pass_lower_tm);
38 NEXT_PASS (pass_refactor_eh);
39 NEXT_PASS (pass_lower_eh);
40 NEXT_PASS (pass_coroutine_lower_builtins);
41 NEXT_PASS (pass_build_cfg);
42 NEXT_PASS (pass_warn_function_return);
43 NEXT_PASS (pass_coroutine_early_expand_ifns);
44 NEXT_PASS (pass_expand_omp);
45 NEXT_PASS (pass_build_cgraph_edges);
46 TERMINATE_PASS_LIST (all_lowering_passes)
47
48 /* Interprocedural optimization passes. */
49 INSERT_PASSES_AFTER (all_small_ipa_passes)
50 NEXT_PASS (pass_ipa_free_lang_data);
51 NEXT_PASS (pass_ipa_function_and_variable_visibility);
52 NEXT_PASS (pass_ipa_strub_mode);
53 NEXT_PASS (pass_build_ssa_passes);
54 PUSH_INSERT_PASSES_WITHIN (pass_build_ssa_passes)
55 NEXT_PASS (pass_fixup_cfg);
56 NEXT_PASS (pass_build_ssa);
57 NEXT_PASS (pass_walloca, /*strict_mode_p=*/true);
58 NEXT_PASS (pass_warn_printf);
59 NEXT_PASS (pass_warn_nonnull_compare);
60 NEXT_PASS (pass_early_warn_uninitialized);
61 NEXT_PASS (pass_warn_access, /*early=*/true);
62 NEXT_PASS (pass_ubsan);
63 NEXT_PASS (pass_nothrow);
64 NEXT_PASS (pass_rebuild_cgraph_edges);
65 POP_INSERT_PASSES ()
66
67 NEXT_PASS (pass_local_optimization_passes);
68 PUSH_INSERT_PASSES_WITHIN (pass_local_optimization_passes)
69 NEXT_PASS (pass_fixup_cfg);
70 NEXT_PASS (pass_rebuild_cgraph_edges);
71 NEXT_PASS (pass_local_fn_summary);
72 NEXT_PASS (pass_early_inline);
73 NEXT_PASS (pass_warn_recursion);
74 NEXT_PASS (pass_all_early_optimizations);
75 PUSH_INSERT_PASSES_WITHIN (pass_all_early_optimizations)
76 NEXT_PASS (pass_remove_cgraph_callee_edges);
77 NEXT_PASS (pass_early_object_sizes);
78 /* Don't record nonzero bits before IPA to avoid
79 using too much memory. */
80 NEXT_PASS (pass_ccp, false /* nonzero_p */);
81 /* After CCP we rewrite no longer addressed locals into SSA
82 form if possible. */
83 NEXT_PASS (pass_forwprop, /*last=*/false);
84 NEXT_PASS (pass_early_thread_jumps, /*first=*/true);
85 NEXT_PASS (pass_sra_early);
86 /* pass_build_ealias is a dummy pass that ensures that we
87 execute TODO_rebuild_alias at this point. */
88 NEXT_PASS (pass_build_ealias);
89 /* Do phiprop before FRE so we optimize std::min and std::max well. */
90 NEXT_PASS (pass_phiprop);
91 NEXT_PASS (pass_fre, true /* may_iterate */);
92 NEXT_PASS (pass_early_vrp);
93 NEXT_PASS (pass_merge_phi);
94 NEXT_PASS (pass_dse);
95 NEXT_PASS (pass_cd_dce, false /* update_address_taken_p */, true /* remove_unused_locals */);
96 NEXT_PASS (pass_phiopt, true /* early_p */);
97 NEXT_PASS (pass_tail_recursion);
98 NEXT_PASS (pass_if_to_switch);
99 NEXT_PASS (pass_convert_switch);
100 NEXT_PASS (pass_cleanup_eh);
101 NEXT_PASS (pass_sccopy);
102 NEXT_PASS (pass_profile);
103 NEXT_PASS (pass_local_pure_const);
104 NEXT_PASS (pass_modref);
105 /* Split functions creates parts that are not run through
106 early optimizations again. It is thus good idea to do this
107 late. */
108 NEXT_PASS (pass_split_functions);
109 NEXT_PASS (pass_strip_predict_hints, true /* early_p */);
110 POP_INSERT_PASSES ()
111 NEXT_PASS (pass_release_ssa_names);
112 NEXT_PASS (pass_rebuild_cgraph_edges);
113 NEXT_PASS (pass_local_fn_summary);
114 POP_INSERT_PASSES ()
115
116 NEXT_PASS (pass_ipa_remove_symbols);
117 NEXT_PASS (pass_ipa_strub);
118 NEXT_PASS (pass_ipa_oacc);
119 PUSH_INSERT_PASSES_WITHIN (pass_ipa_oacc)
120 NEXT_PASS (pass_ipa_pta);
121 /* Pass group that runs when the function is an offloaded function
122 containing oacc kernels loops. */
123 NEXT_PASS (pass_ipa_oacc_kernels);
124 PUSH_INSERT_PASSES_WITHIN (pass_ipa_oacc_kernels)
125 NEXT_PASS (pass_oacc_kernels);
126 PUSH_INSERT_PASSES_WITHIN (pass_oacc_kernels)
127 NEXT_PASS (pass_ch);
128 NEXT_PASS (pass_fre, true /* may_iterate */);
129 /* We use pass_lim to rewrite in-memory iteration and reduction
130 variable accesses in loops into local variables accesses. */
131 NEXT_PASS (pass_lim);
132 NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */);
133 NEXT_PASS (pass_dce);
134 NEXT_PASS (pass_parallelize_loops, true /* oacc_kernels_p */);
135 NEXT_PASS (pass_expand_omp_ssa);
136 NEXT_PASS (pass_rebuild_cgraph_edges);
137 POP_INSERT_PASSES ()
138 POP_INSERT_PASSES ()
139 POP_INSERT_PASSES ()
140
141 NEXT_PASS (pass_target_clone);
142 NEXT_PASS (pass_ipa_auto_profile);
143 NEXT_PASS (pass_ipa_tree_profile);
144 PUSH_INSERT_PASSES_WITHIN (pass_ipa_tree_profile)
145 NEXT_PASS (pass_feedback_split_functions);
146 POP_INSERT_PASSES ()
147 NEXT_PASS (pass_ipa_free_fn_summary, true /* small_p */);
148 NEXT_PASS (pass_ipa_increase_alignment);
149 NEXT_PASS (pass_ipa_tm);
150 NEXT_PASS (pass_ipa_lower_emutls);
151 TERMINATE_PASS_LIST (all_small_ipa_passes)
152
153 INSERT_PASSES_AFTER (all_regular_ipa_passes)
154 NEXT_PASS (pass_analyzer);
155 NEXT_PASS (pass_ipa_odr);
156 NEXT_PASS (pass_ipa_whole_program_visibility);
157 NEXT_PASS (pass_ipa_profile);
158 NEXT_PASS (pass_ipa_icf);
159 NEXT_PASS (pass_ipa_devirt);
160 NEXT_PASS (pass_ipa_cdtor_merge);
161 NEXT_PASS (pass_ipa_cp);
162 NEXT_PASS (pass_ipa_sra);
163 NEXT_PASS (pass_ipa_fn_summary);
164 NEXT_PASS (pass_ipa_inline);
165 NEXT_PASS (pass_ipa_locality_cloning);
166 NEXT_PASS (pass_ipa_pure_const);
167 NEXT_PASS (pass_ipa_modref);
168 NEXT_PASS (pass_ipa_free_fn_summary, false /* small_p */);
169 NEXT_PASS (pass_ipa_reference);
170 /* This pass needs to be scheduled after any IP code duplication. */
171 NEXT_PASS (pass_ipa_single_use);
172 /* Comdat privatization come last, as direct references to comdat local
173 symbols are not allowed outside of the comdat group. Privatizing early
174 would result in missed optimizations due to this restriction. */
175 NEXT_PASS (pass_ipa_comdats);
176 TERMINATE_PASS_LIST (all_regular_ipa_passes)
177
178 /* Simple IPA passes executed after the regular passes. In WHOPR mode the
179 passes are executed after partitioning and thus see just parts of the
180 compiled unit. */
181 INSERT_PASSES_AFTER (all_late_ipa_passes)
182 NEXT_PASS (pass_ipa_pta);
183 NEXT_PASS (pass_omp_simd_clone);
184 TERMINATE_PASS_LIST (all_late_ipa_passes)
185
186 /* These passes are run after IPA passes on every function that is being
187 output to the assembler file. */
188 INSERT_PASSES_AFTER (all_passes)
189 NEXT_PASS (pass_fixup_cfg);
190 NEXT_PASS (pass_lower_eh_dispatch);
191 NEXT_PASS (pass_oacc_loop_designation);
192 NEXT_PASS (pass_omp_oacc_neuter_broadcast);
193 NEXT_PASS (pass_oacc_device_lower);
194 NEXT_PASS (pass_omp_device_lower);
195 NEXT_PASS (pass_omp_target_link);
196 NEXT_PASS (pass_adjust_alignment);
197 NEXT_PASS (pass_harden_control_flow_redundancy);
198 NEXT_PASS (pass_all_optimizations);
199 PUSH_INSERT_PASSES_WITHIN (pass_all_optimizations)
200 NEXT_PASS (pass_remove_cgraph_callee_edges);
201 /* Initial scalar cleanups before alias computation.
202 They ensure memory accesses are not indirect wherever possible. */
203 NEXT_PASS (pass_strip_predict_hints, false /* early_p */);
204 NEXT_PASS (pass_ccp, true /* nonzero_p */);
205 /* After CCP we rewrite no longer addressed locals into SSA
206 form if possible. */
207 NEXT_PASS (pass_object_sizes);
208 NEXT_PASS (pass_post_ipa_warn);
209 /* Must run before loop unrolling. */
210 NEXT_PASS (pass_warn_access, /*early=*/true);
211 /* Profile count may overflow as a result of inlinining very large
212 loop nests. This pass should run before any late pass that makes
213 use of profile. */
214 NEXT_PASS (pass_rebuild_frequencies);
215 NEXT_PASS (pass_complete_unrolli);
216 NEXT_PASS (pass_backprop);
217 NEXT_PASS (pass_phiprop);
218 NEXT_PASS (pass_forwprop, /*last=*/false);
219 /* pass_build_alias is a dummy pass that ensures that we
220 execute TODO_rebuild_alias at this point. */
221 NEXT_PASS (pass_build_alias);
222 NEXT_PASS (pass_return_slot);
223 NEXT_PASS (pass_fre, true /* may_iterate */);
224 NEXT_PASS (pass_merge_phi);
225 NEXT_PASS (pass_thread_jumps_full, /*first=*/true);
226 NEXT_PASS (pass_vrp, false /* final_p*/);
227 NEXT_PASS (pass_array_bounds);
228 NEXT_PASS (pass_dse);
229 NEXT_PASS (pass_dce, false /* update_address_taken_p */, true /* remove_unused_locals */);
230 NEXT_PASS (pass_stdarg);
231 NEXT_PASS (pass_call_cdce);
232 NEXT_PASS (pass_cselim);
233 NEXT_PASS (pass_copy_prop);
234 NEXT_PASS (pass_tree_ifcombine);
235 NEXT_PASS (pass_merge_phi);
236 NEXT_PASS (pass_phiopt, false /* early_p */);
237 NEXT_PASS (pass_tail_recursion);
238 NEXT_PASS (pass_ch);
239 NEXT_PASS (pass_lower_complex);
240 NEXT_PASS (pass_lower_bitint);
241 NEXT_PASS (pass_sra);
242 /* The dom pass will also resolve all __builtin_constant_p calls
243 that are still there to 0. This has to be done after some
244 propagations have already run, but before some more dead code
245 is removed, and this place fits nicely. Remember this when
246 trying to move or duplicate pass_dominator somewhere earlier. */
247 NEXT_PASS (pass_thread_jumps, /*first=*/true);
248 NEXT_PASS (pass_dominator, true /* may_peel_loop_headers_p */);
249 /* Threading can leave many const/copy propagations in the IL.
250 Clean them up. Failure to do so well can lead to false
251 positives from warnings for erroneous code. */
252 NEXT_PASS (pass_copy_prop);
253 /* Identify paths that should never be executed in a conforming
254 program and isolate those paths. */
255 NEXT_PASS (pass_isolate_erroneous_paths);
256 NEXT_PASS (pass_reassoc, true /* early_p */);
257 NEXT_PASS (pass_dce);
258 NEXT_PASS (pass_forwprop, /*last=*/false);
259 NEXT_PASS (pass_phiopt, false /* early_p */);
260 NEXT_PASS (pass_ccp, true /* nonzero_p */);
261 /* After CCP we rewrite no longer addressed locals into SSA
262 form if possible. */
263 NEXT_PASS (pass_expand_pow);
264 NEXT_PASS (pass_optimize_bswap);
265 NEXT_PASS (pass_laddress);
266 NEXT_PASS (pass_lim);
267 NEXT_PASS (pass_walloca, false);
268 NEXT_PASS (pass_pre);
269 NEXT_PASS (pass_sink_code, false /* unsplit edges */);
270 NEXT_PASS (pass_sancov);
271 NEXT_PASS (pass_asan);
272 NEXT_PASS (pass_tsan);
273 NEXT_PASS (pass_dse, true /* use DR analysis */);
274 NEXT_PASS (pass_dce, false /* update_address_taken_p */, false /* remove_unused_locals */);
275 /* Pass group that runs when 1) enabled, 2) there are loops
276 in the function. Make sure to run pass_fix_loops before
277 to discover/remove loops before running the gate function
278 of pass_tree_loop. */
279 NEXT_PASS (pass_fix_loops);
280 NEXT_PASS (pass_tree_loop);
281 PUSH_INSERT_PASSES_WITHIN (pass_tree_loop)
282 /* Before loop_init we rewrite no longer addressed locals into SSA
283 form if possible. */
284 NEXT_PASS (pass_tree_loop_init);
285 NEXT_PASS (pass_tree_unswitch);
286 NEXT_PASS (pass_loop_split);
287 NEXT_PASS (pass_scev_cprop);
288 NEXT_PASS (pass_loop_versioning);
289 NEXT_PASS (pass_loop_jam);
290 /* All unswitching, final value replacement and splitting can expose
291 empty loops. Remove them now. */
292 NEXT_PASS (pass_cd_dce, false /* update_address_taken_p */);
293 NEXT_PASS (pass_iv_canon);
294 NEXT_PASS (pass_loop_distribution);
295 NEXT_PASS (pass_crc_optimization);
296 NEXT_PASS (pass_linterchange);
297 NEXT_PASS (pass_copy_prop);
298 NEXT_PASS (pass_graphite);
299 PUSH_INSERT_PASSES_WITHIN (pass_graphite)
300 NEXT_PASS (pass_graphite_transforms);
301 NEXT_PASS (pass_lim);
302 NEXT_PASS (pass_copy_prop);
303 NEXT_PASS (pass_dce);
304 POP_INSERT_PASSES ()
305 NEXT_PASS (pass_parallelize_loops, false /* oacc_kernels_p */);
306 NEXT_PASS (pass_expand_omp_ssa);
307 NEXT_PASS (pass_ch_vect);
308 NEXT_PASS (pass_if_conversion);
309 /* pass_vectorize must immediately follow pass_if_conversion.
310 Please do not add any other passes in between. */
311 NEXT_PASS (pass_vectorize);
312 PUSH_INSERT_PASSES_WITHIN (pass_vectorize)
313 NEXT_PASS (pass_dce);
314 POP_INSERT_PASSES ()
315 NEXT_PASS (pass_predcom);
316 NEXT_PASS (pass_complete_unroll);
317 NEXT_PASS (pass_pre_slp_scalar_cleanup);
318 PUSH_INSERT_PASSES_WITHIN (pass_pre_slp_scalar_cleanup)
319 NEXT_PASS (pass_fre, false /* may_iterate */);
320 NEXT_PASS (pass_dse);
321 POP_INSERT_PASSES ()
322 NEXT_PASS (pass_slp_vectorize);
323 NEXT_PASS (pass_loop_prefetch);
324 /* Run IVOPTs after the last pass that uses data-reference analysis
325 as that doesn't handle TARGET_MEM_REFs. */
326 NEXT_PASS (pass_iv_optimize);
327 NEXT_PASS (pass_lim);
328 NEXT_PASS (pass_tree_loop_done);
329 POP_INSERT_PASSES ()
330 /* Pass group that runs when pass_tree_loop is disabled or there
331 are no loops in the function. */
332 NEXT_PASS (pass_tree_no_loop);
333 PUSH_INSERT_PASSES_WITHIN (pass_tree_no_loop)
334 NEXT_PASS (pass_slp_vectorize);
335 POP_INSERT_PASSES ()
336 NEXT_PASS (pass_simduid_cleanup);
337 NEXT_PASS (pass_lower_vector_ssa);
338 NEXT_PASS (pass_lower_switch);
339 NEXT_PASS (pass_cse_sincos);
340 NEXT_PASS (pass_cse_reciprocals);
341 NEXT_PASS (pass_reassoc, false /* early_p */);
342 NEXT_PASS (pass_strength_reduction);
343 NEXT_PASS (pass_split_paths);
344 NEXT_PASS (pass_tracer);
345 NEXT_PASS (pass_fre, false /* may_iterate */);
346 /* After late FRE we rewrite no longer addressed locals into SSA
347 form if possible. */
348 NEXT_PASS (pass_thread_jumps, /*first=*/false);
349 NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */);
350 NEXT_PASS (pass_strlen);
351 NEXT_PASS (pass_thread_jumps_full, /*first=*/false);
352 NEXT_PASS (pass_vrp, true /* final_p */);
353 /* Run CCP to compute alignment and nonzero bits. */
354 NEXT_PASS (pass_ccp, true /* nonzero_p */);
355 NEXT_PASS (pass_warn_restrict);
356 NEXT_PASS (pass_dse);
357 NEXT_PASS (pass_dce, true /* update_address_taken_p */, true /* remove_unused_locals */);
358 /* After late DCE we rewrite no longer addressed locals into SSA
359 form if possible. */
360 NEXT_PASS (pass_forwprop, /*last=*/true);
361 NEXT_PASS (pass_sink_code, true /* unsplit edges */);
362 NEXT_PASS (pass_phiopt, false /* early_p */);
363 NEXT_PASS (pass_fold_builtins);
364 NEXT_PASS (pass_optimize_widening_mul);
365 NEXT_PASS (pass_store_merging);
366 /* If DCE is not run before checking for uninitialized uses,
367 we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c).
368 However, this also causes us to misdiagnose cases that should be
369 real warnings (e.g., testsuite/gcc.dg/pr18501.c). */
370 NEXT_PASS (pass_cd_dce, false /* update_address_taken_p */);
371 NEXT_PASS (pass_sccopy);
372 NEXT_PASS (pass_tail_calls);
373 /* Split critical edges before late uninit warning to reduce the
374 number of false positives from it. */
375 NEXT_PASS (pass_split_crit_edges);
376 NEXT_PASS (pass_late_warn_uninitialized);
377 NEXT_PASS (pass_local_pure_const);
378 NEXT_PASS (pass_modref);
379 /* uncprop replaces constants by SSA names. This makes analysis harder
380 and thus it should be run last. */
381 NEXT_PASS (pass_uncprop);
382 POP_INSERT_PASSES ()
383 NEXT_PASS (pass_all_optimizations_g);
384 PUSH_INSERT_PASSES_WITHIN (pass_all_optimizations_g)
385 /* The idea is that with -Og we do not perform any IPA optimization
386 so post-IPA work should be restricted to semantically required
387 passes and all optimization work is done early. */
388 NEXT_PASS (pass_remove_cgraph_callee_edges);
389 NEXT_PASS (pass_strip_predict_hints, false /* early_p */);
390 /* Lower remaining pieces of GIMPLE. */
391 NEXT_PASS (pass_lower_complex);
392 NEXT_PASS (pass_lower_bitint);
393 NEXT_PASS (pass_lower_vector_ssa);
394 NEXT_PASS (pass_lower_switch);
395 /* Perform simple scalar cleanup which is constant/copy propagation. */
396 NEXT_PASS (pass_ccp, true /* nonzero_p */);
397 NEXT_PASS (pass_post_ipa_warn);
398 NEXT_PASS (pass_object_sizes);
399 /* Fold remaining builtins. */
400 NEXT_PASS (pass_fold_builtins);
401 NEXT_PASS (pass_strlen);
402 /* Copy propagation also copy-propagates constants, this is necessary
403 to forward object-size and builtin folding results properly. */
404 NEXT_PASS (pass_copy_prop);
405 NEXT_PASS (pass_dce);
406 /* Profile count may overflow as a result of inlinining very large
407 loop nests. This pass should run before any late pass that makes
408 use of profile. */
409 NEXT_PASS (pass_rebuild_frequencies);
410 NEXT_PASS (pass_sancov);
411 NEXT_PASS (pass_asan);
412 NEXT_PASS (pass_tsan);
413 /* ??? We do want some kind of loop invariant motion, but we possibly
414 need to adjust LIM to be more friendly towards preserving accurate
415 debug information here. */
416 /* Split critical edges before late uninit warning to reduce the
417 number of false positives from it. */
418 NEXT_PASS (pass_split_crit_edges);
419 NEXT_PASS (pass_late_warn_uninitialized);
420 /* uncprop replaces constants by SSA names. This makes analysis harder
421 and thus it should be run last. */
422 NEXT_PASS (pass_uncprop);
423 POP_INSERT_PASSES ()
424 NEXT_PASS (pass_assumptions);
425 NEXT_PASS (pass_tm_init);
426 PUSH_INSERT_PASSES_WITHIN (pass_tm_init)
427 NEXT_PASS (pass_tm_mark);
428 NEXT_PASS (pass_tm_memopt);
429 NEXT_PASS (pass_tm_edges);
430 POP_INSERT_PASSES ()
431 NEXT_PASS (pass_simduid_cleanup);
432 NEXT_PASS (pass_vtable_verify);
433 NEXT_PASS (pass_lower_vaarg);
434 NEXT_PASS (pass_lower_vector);
435 NEXT_PASS (pass_lower_complex_O0);
436 NEXT_PASS (pass_lower_bitint_O0);
437 NEXT_PASS (pass_sancov_O0);
438 NEXT_PASS (pass_lower_switch_O0);
439 NEXT_PASS (pass_asan_O0);
440 NEXT_PASS (pass_tsan_O0);
441 NEXT_PASS (pass_musttail);
442 NEXT_PASS (pass_sanopt);
443 NEXT_PASS (pass_cleanup_eh);
444 NEXT_PASS (pass_lower_resx);
445 NEXT_PASS (pass_nrv);
446 NEXT_PASS (pass_gimple_isel);
447 NEXT_PASS (pass_harden_conditional_branches);
448 NEXT_PASS (pass_harden_compares);
449 NEXT_PASS (pass_warn_access, /*early=*/false);
450 NEXT_PASS (pass_cleanup_cfg_post_optimizing);
451 NEXT_PASS (pass_warn_function_noreturn);
452
453 NEXT_PASS (pass_expand);
454
455 NEXT_PASS (pass_rest_of_compilation);
456 PUSH_INSERT_PASSES_WITHIN (pass_rest_of_compilation)
457 NEXT_PASS (pass_instantiate_virtual_regs);
458 NEXT_PASS (pass_into_cfg_layout_mode);
459 NEXT_PASS (pass_jump);
460 NEXT_PASS (pass_lower_subreg);
461 NEXT_PASS (pass_df_initialize_opt);
462 NEXT_PASS (pass_cse);
463 NEXT_PASS (pass_rtl_fwprop);
464 NEXT_PASS (pass_rtl_cprop);
465 NEXT_PASS (pass_rtl_pre);
466 NEXT_PASS (pass_rtl_hoist);
467 NEXT_PASS (pass_hardreg_pre);
468 NEXT_PASS (pass_rtl_cprop);
469 NEXT_PASS (pass_rtl_store_motion);
470 NEXT_PASS (pass_cse_after_global_opts);
471 NEXT_PASS (pass_rtl_ifcvt);
472 NEXT_PASS (pass_reginfo_init);
473 /* Perform loop optimizations. It might be better to do them a bit
474 sooner, but we want the profile feedback to work more
475 efficiently. */
476 NEXT_PASS (pass_loop2);
477 PUSH_INSERT_PASSES_WITHIN (pass_loop2)
478 NEXT_PASS (pass_rtl_loop_init);
479 NEXT_PASS (pass_rtl_move_loop_invariants);
480 NEXT_PASS (pass_rtl_unroll_loops);
481 NEXT_PASS (pass_rtl_doloop);
482 NEXT_PASS (pass_rtl_loop_done);
483 POP_INSERT_PASSES ()
484 NEXT_PASS (pass_lower_subreg2);
485 NEXT_PASS (pass_web);
486 NEXT_PASS (pass_rtl_cprop);
487 NEXT_PASS (pass_cse2);
488 NEXT_PASS (pass_rtl_dse1);
489 NEXT_PASS (pass_rtl_fwprop_addr);
490 NEXT_PASS (pass_inc_dec);
491 NEXT_PASS (pass_initialize_regs);
492 NEXT_PASS (pass_ud_rtl_dce);
493 NEXT_PASS (pass_ext_dce);
494 NEXT_PASS (pass_combine);
495 NEXT_PASS (pass_late_combine);
496 NEXT_PASS (pass_if_after_combine);
497 NEXT_PASS (pass_jump_after_combine);
498 NEXT_PASS (pass_partition_blocks);
499 NEXT_PASS (pass_outof_cfg_layout_mode);
500 NEXT_PASS (pass_split_all_insns);
501 NEXT_PASS (pass_lower_subreg3);
502 NEXT_PASS (pass_df_initialize_no_opt);
503 NEXT_PASS (pass_stack_ptr_mod);
504 NEXT_PASS (pass_mode_switching);
505 NEXT_PASS (pass_match_asm_constraints);
506 NEXT_PASS (pass_sms);
507 NEXT_PASS (pass_live_range_shrinkage);
508 NEXT_PASS (pass_sched);
509 NEXT_PASS (pass_rtl_avoid_store_forwarding);
510 NEXT_PASS (pass_early_remat);
511 NEXT_PASS (pass_ira);
512 NEXT_PASS (pass_reload);
513 /* In the following, some passes are tied to 'pass_postreload' and others
514 to 'pass_late_compilation'. The difference is that the latter also
515 run for 'targetm.no_register_allocation' targets. */
516 NEXT_PASS (pass_postreload);
517 PUSH_INSERT_PASSES_WITHIN (pass_postreload)
518 NEXT_PASS (pass_postreload_cse);
519 NEXT_PASS (pass_late_combine);
520 NEXT_PASS (pass_gcse2);
521 NEXT_PASS (pass_split_after_reload);
522 NEXT_PASS (pass_ree);
523 NEXT_PASS (pass_compare_elim_after_reload);
524 NEXT_PASS (pass_thread_prologue_and_epilogue);
525 NEXT_PASS (pass_rtl_dse2);
526 NEXT_PASS (pass_stack_adjustments);
527 NEXT_PASS (pass_jump2);
528 NEXT_PASS (pass_duplicate_computed_gotos);
529 NEXT_PASS (pass_sched_fusion);
530 NEXT_PASS (pass_peephole2);
531 NEXT_PASS (pass_if_after_reload);
532 NEXT_PASS (pass_regrename);
533 NEXT_PASS (pass_fold_mem_offsets);
534 NEXT_PASS (pass_cprop_hardreg);
535 NEXT_PASS (pass_fast_rtl_dce);
536 NEXT_PASS (pass_reorder_blocks);
537 NEXT_PASS (pass_leaf_regs);
538 NEXT_PASS (pass_split_before_sched2);
539 NEXT_PASS (pass_sched2);
540 NEXT_PASS (pass_stack_regs);
541 PUSH_INSERT_PASSES_WITHIN (pass_stack_regs)
542 NEXT_PASS (pass_split_before_regstack);
543 NEXT_PASS (pass_stack_regs_run);
544 POP_INSERT_PASSES ()
545 POP_INSERT_PASSES ()
546 NEXT_PASS (pass_late_thread_prologue_and_epilogue);
547 /* No target-independent code motion is allowed beyond this point,
548 excepting the legacy delayed-branch pass. */
549 NEXT_PASS (pass_late_compilation);
550 PUSH_INSERT_PASSES_WITHIN (pass_late_compilation)
551 NEXT_PASS (pass_zero_call_used_regs);
552 NEXT_PASS (pass_compute_alignments);
553 NEXT_PASS (pass_variable_tracking);
554 NEXT_PASS (pass_free_cfg);
555 NEXT_PASS (pass_machine_reorg);
556 NEXT_PASS (pass_cleanup_barriers);
557 NEXT_PASS (pass_delay_slots);
558 NEXT_PASS (pass_split_for_shorten_branches);
559 NEXT_PASS (pass_convert_to_eh_region_ranges);
560 NEXT_PASS (pass_shorten_branches);
561 NEXT_PASS (pass_set_nothrow_function_flags);
562 NEXT_PASS (pass_dwarf2_frame);
563 NEXT_PASS (pass_final);
564 POP_INSERT_PASSES ()
565 NEXT_PASS (pass_df_finish);
566 POP_INSERT_PASSES ()
567 NEXT_PASS (pass_clean_state);
568 TERMINATE_PASS_LIST (all_passes)