From be3c16c474629e69c6c4cd6465ffa4b572cc6460 Mon Sep 17 00:00:00 2001 From: Dehao Chen Date: Tue, 21 Oct 2014 17:59:30 +0000 Subject: Add AutoFDO. gcc/ChangeLog: 2014-10-21 Dehao Chen * auto-profile.c: New file. * auto-profile.h: New file. * basic-block.h (maybe_hot_count_p): New export func. (add_working_set): New export func. * gcov-io.h (GCOV_TAG_AFDO_FILE_NAMES): New tag. (GCOV_TAG_AFDO_FUNCTION): Likewise. (GCOV_TAG_AFDO_WORKING_SET): Likewise. * opts.c (enable_fdo_optimizations): New func. (common_handle_option): Handle -fauto-profile flag. * ipa-inline.c (want_early_inline_function_p): Iterative-einline. (class pass_early_inline): Export early_inliner. (early_inliner): Likewise. (pass_early_inline::execute): Likewise. * ipa-inline.h (early_inliner): Likewise. * predict.c (maybe_hot_count_p): New export func. (counts_to_freqs): AutoFDO logic. (rebuild_frequencies): Likewise. * tree-profile.c (pass_ipa_tree_profile::gate): Likewise. * profile.c (add_working_set): New func. * Makefile.in (auto-profile.o): New object file. * passes.def (pass_ipa_auto_profile): New pass. * tree-ssa-live.c (remove_unused_scope_block_p): AutoFDO logic. * tree-pass.h (make_pass_ipa_auto_profile): New pass. * toplev.c (compile_file): AutoFDO logic. * doc/invoke.texi (-fauto-profile): New doc. * coverage.c (coverage_init): AutoFDO logic. * common.opt (-fauto-profile): New flag. * timevar.def (TV_IPA_AUTOFDO): New tag. * value-prof.c (gimple_alloc_histogram_value): New export func. (check_ic_target): Likewise. * value-prof.h (gimple_alloc_histogram_value): Likewise. (check_ic_target): Likewise. From-SVN: r216523 --- gcc/auto-profile.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 gcc/auto-profile.h (limited to 'gcc/auto-profile.h') diff --git a/gcc/auto-profile.h b/gcc/auto-profile.h new file mode 100644 index 00000000000..7b4f2449cb7 --- /dev/null +++ b/gcc/auto-profile.h @@ -0,0 +1,31 @@ +/* auto-profile.h - Defines data exported from auto-profile.c + Copyright (C) 2014. Free Software Foundation, Inc. + Contributed by Dehao Chen (dehao@google.com) + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#ifndef AUTO_PROFILE_H +#define AUTO_PROFILE_H + +/* Read, process, finalize AutoFDO data structures. */ +extern void read_autofdo_file (void); +extern void end_auto_profile (void); + +/* Returns TRUE if EDGE is hot enough to be inlined early. */ +extern bool afdo_callsite_hot_enough_for_early_inline (struct cgraph_edge *); + +#endif /* AUTO_PROFILE_H */ -- cgit v1.2.1