summaryrefslogtreecommitdiff
path: root/gcc/et-forest.h
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-20 17:57:27 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-20 17:57:27 +0000
commit5dd29ee727e4713fda224749a25dd43580b34209 (patch)
tree693f50ac9512d1c5e30d62c99ee87e300a094ad0 /gcc/et-forest.h
parent89d75d78ea20e6326fb171c82a5b61ca98694329 (diff)
downloadgcc-5dd29ee727e4713fda224749a25dd43580b34209.tar.gz
Mon Jun 10 20:42:34 CEST 2002 Jan Hubicka <jh@suse.cz>
* basic-block.h: Do not include et-forest.h (dominance_info): Declare as struct dominance-info. * cfglayout.c (cleanup_unconditional_jumps): Remove the edge before deleting block. * dominance.c (struct dominance_info): Define. (BB_NODE, SET_BB_NODE): New macros. (bb_hash_func, bb_eq_func): Kill. (calculate_dominace_info, free_dominacne_info, set_immediate_dominator, nearest_common_dominator, dominated_by_p, recount_dominator, add_to_dominance_info, delete_from_dominance_info): update for new representation. (get_dominated_by, redirect_immediate_dominators): Rewrite using enumerate_sons. * ifcvt.c (process_double_test_block, merge_if_block, find_cond_trap, find_if_case_1, find_if_case_2): Remove killed blocks from dominance structure. * et-forest.h: Update copyright; revamp all function to operate on nodes (et_forest_value): Kill. (et_forest_enumerate_sons, et_forest_node_value): New. * et-forest.c: Update copyright. * et-forest.h: Update copyright; revamp all function to operate on nodes (et_forest_value): Kill. (et_forest_enumerate_sons, et_forest_node_value): New. Thu Jun 6 22:43:43 CEST 2002 Jan Hubicka <jh@suse.cz> * basic-block.h: Inlude et-forest.h (basic_block_def): Kill dominator. (dominance_info): New type. (loops): Use dominace_info. (dominace handling functions): Take dominace_info as argument instead of bitmaps. (create_preheader): Likewise. * cfg.c (entry_exit_blocks): Kill dominator. (dump_flow_info): Do not dump dominators. * cfglayout.c (cleanup_unconditonal_jumps): Delete deleted block from dominators. * cfgloop.c (flow_pre_header_find): Use dominacne_info. (flow_loops_pre_header_scan, make_forwarder_block, canonicale_loop_headers, flow_loops_find): Likewise. * dominance.c: Include error.h (idoms_to_doms): Kill. (bb_hash_func, bb_eq_func): New static functions. (debug_dominace_info): New global function. (calculate_dominance_info): Use new et forest structure. (free_dominace_info, get_immediate_dominator, set_immediate_dominator, get_dominated_by, redirect_immediate_dominators, nearest_common_dominator, dominated_by_p, verify_dominators, recount_dominator, iterate_fix_dominators, add_to_dominace_info, delete_from_dominance_info): New global functions. * gcse.c (domnators): CHange to dominance_info. (alloc_hoist_mem): Do not alloc dominators (free_code_hoist_mem): Use free_dominance_info. (compute_code_hoist_data): Use dominance_info. (hoist_code): Likewise. * ifcvt.c (post_dominators): Likewise. (find_if_case_2, if_convert): Likewise. * predict.c (process_note_predictions, process_note_prediction, estimate-probability): Likewise. * sched-rgn.c (find_rgns, init_regions): Likewise. * ssa-dce.c (find_all_control_dependences, fint_control_depemndence, find_pdom, delete_insn_bb, ssa_eliminate_dead_code): Likewise. * ssa.c (compute_dominance_frontiers_1, rename_block, rename_registers, find_evaluations, convert_to_ssa): Likewise. * ssa.h (compute_dominance_frontiers): Likewise. Thu Jun 6 22:57:34 CEST 2002 Pavel Nejedly <bim@atrey.karlin.mff.cuni.cz> * Makefile.in (et-forest.c): Add. * et-forest.c: New file. * at-forest.h: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54844 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/et-forest.h')
-rw-r--r--gcc/et-forest.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/gcc/et-forest.h b/gcc/et-forest.h
new file mode 100644
index 00000000000..8f4290c1193
--- /dev/null
+++ b/gcc/et-forest.h
@@ -0,0 +1,83 @@
+/* Et-forest data structure implementation.
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This program 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 2 of the License, or
+(at your option) any later version.
+
+This program 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 this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This package implements ET forest data structure. Each tree in
+ the structure maintains a tree structure and offers logarithmic time
+ for tree operations (insertion and removal of nodes and edges) and
+ poly-logarithmic time for nearest common ancesto.
+
+ ET tree strores its structue as a sequence of symbols obtained
+ by dfs(root)
+
+ dfs (node)
+ {
+ s = node;
+ for each child c of node do
+ s = concat (s, c, node);
+ return s;
+ }
+
+ For example for tree
+
+ 1
+ / | \
+ 2 3 4
+ / |
+ 4 5
+
+ the sequence is 1 2 4 2 5 3 1 3 1 4 1.
+
+ The sequence is stored in a sligtly modified splay tree.
+ In order to support various types of node values, a hashtable
+ is used to convert node values to the internal representation. */
+
+#ifndef _ET_TREE_H
+#define _ET_TREE_H
+
+#include <ansidecl.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef struct et_forest *et_forest_t;
+typedef struct et_forest_node *et_forest_node_t;
+
+extern et_forest_t et_forest_create PARAMS ((void));
+
+extern void et_forest_delete PARAMS ((et_forest_t));
+
+extern et_forest_node_t et_forest_add_node PARAMS ((et_forest_t, void *));
+extern int et_forest_add_edge PARAMS ((et_forest_t, et_forest_node_t,
+ et_forest_node_t));
+extern void et_forest_remove_node PARAMS ((et_forest_t, et_forest_node_t));
+extern int et_forest_remove_edge PARAMS ((et_forest_t, et_forest_node_t,
+ et_forest_node_t));
+extern et_forest_node_t et_forest_parent PARAMS ((et_forest_t, et_forest_node_t));
+extern et_forest_node_t et_forest_common_ancestor PARAMS ((et_forest_t,
+ et_forest_node_t,
+ et_forest_node_t));
+extern void * et_forest_node_value PARAMS ((et_forest_t, et_forest_node_t));
+extern int et_forest_enumerate_sons PARAMS ((et_forest_t, et_forest_node_t,
+ et_forest_node_t *));
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _ET_TREE_H */