+2014-10-20 Andrew MacLeod <amacleod@redhat.com>
+
+ * cfgrtl.h: New. Add prototypes for cfgrtl.c.
+ * basic-block.h: Remove prototypes for cfgrtl.c.
+ * cfghooks.h (cfg_layout_initialize, cfg_layout_finalize): Move
+ prototypes to cfgrtl.h.
+ * profile.h (profile_info): Add extern export declaration.
+ * rtl.h: Remove prototypes for cfgrtl.h.
+ * tree-cfg.h (gt_ggc_mx, gt_pch_nx): Move prototypes to here.
+ * ipa-inline.c: Include profile.h.
+ * loop-unroll.c: Ditto.
+ * modulo-sched.c: Ditto.
+ * postreload-gcse.c: Ditto.
+ * predict.c: Ditto.
+ * sched-ebb.c: Ditto.
+ * sched-rgn.c: Ditto.
+ * tracer.c: Ditto.
+ * tree-ssa-loop-ivcanon.c: Ditto.
+
2014-10-20 Richard Biener <rguenther@suse.de>
* tree-vect-slp.c (vect_get_and_check_slp_defs): Try swapping
#include "hard-reg-set.h"
#include "input.h"
#include "function.h"
+#include "cfgrtl.h"
/* Use gcov_type to hold basic block counters. Should be at least
64bit. Although a counter cannot be negative, we use a signed
in profile.c */
};
-
-/* Garbage collection and PCH support for edge_def. */
-extern void gt_ggc_mx (edge_def *e);
-extern void gt_pch_nx (edge_def *e);
-extern void gt_pch_nx (edge_def *e, gt_pointer_operator, void *);
-
/* Masks for edge.flags. */
#define DEF_EDGE_FLAG(NAME,IDX) EDGE_##NAME = 1 << IDX ,
enum cfg_edge_flags {
#define EDGE_COMPLEX \
(EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH | EDGE_PRESERVE)
-/* Counter summary from the last set of coverage counts read by
- profile.c. */
-extern const struct gcov_ctr_summary *profile_info;
-
/* Structure to gather statistic about profile consistency, per pass.
An array of this structure, indexed by pass static number, is allocated
in passes.c. The structure is defined here so that different CFG modes
bool run;
};
-/* Declared in cfgloop.h. */
-struct loop;
struct GTY(()) rtl_bb_info {
/* The first insn of the block is embedded into bb->il.x. */
/* The two blocks that are always in the cfg. */
#define NUM_FIXED_BLOCKS (2)
-extern void compute_bb_for_insn (void);
-extern unsigned int free_bb_for_insn (void);
-extern void update_bb_for_insn (basic_block);
-extern void insert_insn_on_edge (rtx, edge);
basic_block split_edge_and_insert (edge, rtx_insn *);
-extern void commit_one_edge_insertion (edge e);
-extern void commit_edge_insertions (void);
-
extern edge unchecked_make_edge (basic_block, basic_block, int);
extern edge cached_make_edge (sbitmap, basic_block, basic_block, int);
extern edge make_edge (basic_block, basic_block, int);
extern void redirect_edge_succ (edge, basic_block);
extern edge redirect_edge_succ_nodup (edge, basic_block);
extern void redirect_edge_pred (edge, basic_block);
-extern basic_block create_basic_block_structure (rtx_insn *, rtx_insn *,
- rtx_note *, basic_block);
extern void clear_bb_flags (void);
extern void dump_bb_info (FILE *, basic_block, int, int, bool, bool);
extern void dump_edge_info (FILE *, edge, int, int);
extern bitmap compute_idf (bitmap, struct bitmap_head *);
extern basic_block * single_pred_before_succ_order (void);
-/* In cfgrtl.c */
-extern rtx block_label (basic_block);
-extern rtx_note *bb_note (basic_block);
-extern bool purge_all_dead_edges (void);
-extern bool purge_dead_edges (basic_block);
-extern bool fixup_abnormal_edges (void);
-extern basic_block force_nonfallthru_and_redirect (edge, basic_block, rtx);
-extern bool contains_no_active_insn_p (const_basic_block);
-extern bool forwarder_block_p (const_basic_block);
-extern bool can_fallthru (basic_block, basic_block);
-extern void emit_barrier_after_bb (basic_block bb);
-extern void fixup_partitions (void);
-
/* In cfgbuild.c. */
extern void find_many_sub_basic_blocks (sbitmap);
extern void rtl_make_eh_edge (sbitmap, basic_block, rtx);
extern bool delete_unreachable_blocks (void);
-extern void update_br_prob_note (basic_block);
extern bool inside_basic_block_p (const rtx_insn *);
extern bool control_flow_insn_p (const rtx_insn *);
extern rtx_insn *get_last_bb_insn (basic_block);
unsigned bb_dom_dfs_in (enum cdi_direction, basic_block);
unsigned bb_dom_dfs_out (enum cdi_direction, basic_block);
-extern edge try_redirect_by_replacing_jump (edge, basic_block, bool);
-extern void break_superblocks (void);
-extern void relink_block_chain (bool);
extern void update_bb_profile_for_threading (basic_block, int, gcov_type, edge);
-extern void init_rtl_bb_info (basic_block);
extern void initialize_original_copy_tables (void);
extern void free_original_copy_tables (void);
void account_profile_record (struct profile_record *, int);
-extern void cfg_layout_initialize (unsigned int);
-extern void cfg_layout_finalize (void);
-
/* Hooks containers. */
extern struct cfg_hooks gimple_cfg_hooks;
extern struct cfg_hooks rtl_cfg_hooks;
--- /dev/null
+/* Define control flow data structures for the CFG.
+ Copyright (C) 2014 Free Software Foundation, Inc.
+
+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
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_CFGRTL_H
+#define GCC_CFGRTL_H
+
+extern void delete_insn (rtx);
+extern void delete_insn_and_edges (rtx_insn *);
+extern void delete_insn_chain (rtx, rtx, bool);
+extern basic_block create_basic_block_structure (rtx_insn *, rtx_insn *,
+ rtx_note *, basic_block);
+extern void compute_bb_for_insn (void);
+extern unsigned int free_bb_for_insn (void);
+extern rtx_insn *entry_of_function (void);
+extern void update_bb_for_insn (basic_block);
+extern bool contains_no_active_insn_p (const_basic_block);
+extern bool forwarder_block_p (const_basic_block);
+extern bool can_fallthru (basic_block, basic_block);
+extern rtx_note *bb_note (basic_block);
+extern rtx block_label (basic_block);
+extern edge try_redirect_by_replacing_jump (edge, basic_block, bool);
+extern void emit_barrier_after_bb (basic_block bb);
+extern basic_block force_nonfallthru_and_redirect (edge, basic_block, rtx);
+extern void insert_insn_on_edge (rtx, edge);
+extern void commit_one_edge_insertion (edge e);
+extern void commit_edge_insertions (void);
+extern void print_rtl_with_bb (FILE *, const rtx_insn *, int);
+extern void update_br_prob_note (basic_block);
+extern rtx_insn *get_last_bb_insn (basic_block);
+extern void fixup_partitions (void);
+extern bool purge_dead_edges (basic_block);
+extern bool purge_all_dead_edges (void);
+extern bool fixup_abnormal_edges (void);
+extern rtx_insn *unlink_insn_chain (rtx_insn *, rtx_insn *);
+extern void relink_block_chain (bool);
+extern rtx_insn *duplicate_insn_chain (rtx_insn *, rtx_insn *);
+extern void cfg_layout_initialize (unsigned int);
+extern void cfg_layout_finalize (void);
+extern void break_superblocks (void);
+extern void init_rtl_bb_info (basic_block);
+
+#endif /* GCC_CFGRTL_H */
#include "coverage.h"
#include "rtl.h"
#include "bitmap.h"
+#include "profile.h"
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
#include "tree.h"
#include "hard-reg-set.h"
#include "obstack.h"
+#include "profile.h"
#include "basic-block.h"
#include "cfgloop.h"
#include "params.h"
#include "machmode.h"
#include "input.h"
#include "function.h"
+#include "profile.h"
#include "flags.h"
#include "insn-config.h"
#include "insn-attr.h"
#include "machmode.h"
#include "input.h"
#include "function.h"
+#include "profile.h"
#include "expr.h"
#include "except.h"
#include "intl.h"
#include "machmode.h"
#include "input.h"
#include "function.h"
+#include "profile.h"
#include "except.h"
#include "diagnostic-core.h"
#include "recog.h"
};
#define BLOCK_INFO(B) ((block_info *) (B)->aux)
+#undef EDGE_INFO
#define EDGE_INFO(E) ((edge_prob_info *) (E)->aux)
/* Helper function for estimate_bb_frequencies.
extern void get_working_sets (void);
+/* Counter summary from the last set of coverage counts read by
+ profile.c. */
+extern const struct gcov_ctr_summary *profile_info;
+
/* In predict.c. */
extern gcov_type get_hot_bb_threshold (void);
extern void set_hot_bb_threshold (gcov_type);
extern void add_insn_after (rtx, rtx, basic_block);
extern void remove_insn (rtx);
extern rtx_insn *emit (rtx);
-extern void delete_insn (rtx);
-extern rtx_insn *entry_of_function (void);
extern void emit_insn_at_entry (rtx);
-extern void delete_insn_chain (rtx, rtx, bool);
-extern rtx_insn *unlink_insn_chain (rtx_insn *, rtx_insn *);
-extern void delete_insn_and_edges (rtx_insn *);
extern rtx gen_lowpart_SUBREG (enum machine_mode, rtx);
extern rtx gen_const_mem (enum machine_mode, rtx);
extern rtx gen_frame_mem (enum machine_mode, rtx);
extern HOST_WIDE_INT find_args_size_adjust (rtx_insn *);
extern int fixup_args_size_notes (rtx_insn *, rtx_insn *, int);
-/* In cfgrtl.c */
-extern void print_rtl_with_bb (FILE *, const rtx_insn *, int);
-extern rtx_insn *duplicate_insn_chain (rtx_insn *, rtx_insn *);
-
/* In expmed.c */
extern void init_expmed (void);
extern void expand_inc (rtx, rtx);
#include "machmode.h"
#include "input.h"
#include "function.h"
+#include "profile.h"
#include "flags.h"
#include "insn-config.h"
#include "insn-attr.h"
#include "machmode.h"
#include "input.h"
#include "function.h"
+#include "profile.h"
#include "flags.h"
#include "insn-config.h"
#include "insn-attr.h"
#include "tree.h"
#include "rtl.h"
#include "hard-reg-set.h"
+#include "profile.h"
#include "basic-block.h"
#include "fibheap.h"
#include "flags.h"
/* Location to track pending stmt for edge insertion. */
#define PENDING_STMT(e) ((e)->insns.g)
+/* Garbage collection and PCH support for edge_def. */
+extern void gt_ggc_mx (edge_def *e);
+extern void gt_pch_nx (edge_def *e);
+extern void gt_pch_nx (edge_def *e, gt_pointer_operator, void *);
+
extern void init_empty_tree_cfg_for_function (struct function *);
extern void init_empty_tree_cfg (void);
extern void fold_cond_expr_cond (void);
#include "tm.h"
#include "tree.h"
#include "tm_p.h"
+#include "profile.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
#include "tree-ssa-alias.h"