aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-pass.h
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2024-05-15 19:57:22 -0700
committerAndi Kleen <ak@gcc.gnu.org>2024-07-17 21:25:27 -0700
commitb738a63e528db410a1c51fc27db37fe22f0cb397 (patch)
tree3e936f2f0c193eb17934f561847f3fc7a40d0f42 /gcc/tree-pass.h
parent983daf0e5fdaada5b930374c21455d42d34350be (diff)
downloadgcc-b738a63e528db410a1c51fc27db37fe22f0cb397.zip
gcc-b738a63e528db410a1c51fc27db37fe22f0cb397.tar.gz
gcc-b738a63e528db410a1c51fc27db37fe22f0cb397.tar.bz2
Enable musttail tail conversion even when not optimizing
Enable the tailcall optimization for non optimizing builds, but in this case only checks calls that have the musttail attribute set. This makes musttail work without optimization. This is done with a new late musttail pass that is only active when not optimizing. The new pass relies on tree-cfg to discover musttails. This avoids a ~0.8% compiler run time penalty at -O0. gcc/ChangeLog: PR c/83324 * function.h (struct function): Add has_musttail. * lto-streamer-in.cc (input_struct_function_base): Stream has_musttail. * lto-streamer-out.cc (output_struct_function_base): Dito. * passes.def (pass_musttail): Add. * tree-cfg.cc (notice_special_calls): Record has_musttail. (clear_special_calls): Clear has_musttail. * tree-pass.h (make_pass_musttail): Add. * tree-tailcall.cc (find_tail_calls): Handle only_musttail argument. (tree_optimize_tail_calls_1): Pass on only_musttail. (execute_tail_calls): Pass only_musttail as false. (class pass_musttail): Add. (make_pass_musttail): Add.
Diffstat (limited to 'gcc/tree-pass.h')
-rw-r--r--gcc/tree-pass.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 84bc91b..3a0cf13 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -368,6 +368,7 @@ extern gimple_opt_pass *make_pass_sra (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_sra_early (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_tail_recursion (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_tail_calls (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_musttail (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_fix_loops (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_tree_loop (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_tree_no_loop (gcc::context *ctxt);