OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [cfghooks.h] - Blame information for rev 823

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
/* Hooks for cfg representation specific functions.
2
   Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
3
   Contributed by Sebastian Pop <s.pop@laposte.net>
4
 
5
This file is part of GCC.
6
 
7
GCC is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 3, or (at your option)
10
any later version.
11
 
12
GCC is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
GNU General Public License for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with GCC; see the file COPYING3.  If not see
19
<http://www.gnu.org/licenses/>.  */
20
 
21
#ifndef GCC_CFGHOOKS_H
22
#define GCC_CFGHOOKS_H
23
 
24
struct cfg_hooks
25
{
26
  /* Name of the corresponding ir.  */
27
  const char *name;
28
 
29
  /* Debugging.  */
30
  int (*verify_flow_info) (void);
31
  void (*dump_bb) (basic_block, FILE *, int);
32
 
33
  /* Basic CFG manipulation.  */
34
 
35
  /* Return new basic block.  */
36
  basic_block (*create_basic_block) (void *head, void *end, basic_block after);
37
 
38
  /* Redirect edge E to the given basic block B and update underlying program
39
     representation.  Returns edge representing redirected branch (that may not
40
     be equivalent to E in the case of duplicate edges being removed) or NULL
41
     if edge is not easily redirectable for whatever reason.  */
42
  edge (*redirect_edge_and_branch) (edge e, basic_block b);
43
 
44
  /* Same as the above but allows redirecting of fallthru edges.  In that case
45
     newly created forwarder basic block is returned.  The edge must
46
     not be abnormal.  */
47
  basic_block (*redirect_edge_and_branch_force) (edge, basic_block);
48
 
49
  /* Remove statements corresponding to a given basic block.  */
50
  void (*delete_basic_block) (basic_block);
51
 
52
  /* Creates a new basic block just after basic block B by splitting
53
     everything after specified instruction I.  */
54
  basic_block (*split_block) (basic_block b, void * i);
55
 
56
  /* Move block B immediately after block A.  */
57
  bool (*move_block_after) (basic_block b, basic_block a);
58
 
59
  /* Return true when blocks A and B can be merged into single basic block.  */
60
  bool (*can_merge_blocks_p) (basic_block a, basic_block b);
61
 
62
  /* Merge blocks A and B.  */
63
  void (*merge_blocks) (basic_block a, basic_block b);
64
 
65
  /* Predict edge E using PREDICTOR to given PROBABILITY.  */
66
  void (*predict_edge) (edge e, enum br_predictor predictor, int probability);
67
 
68
  /* Return true if the one of outgoing edges is already predicted by
69
     PREDICTOR.  */
70
  bool (*predicted_by_p) (basic_block bb, enum br_predictor predictor);
71
 
72
  /* Return true when block A can be duplicated.  */
73
  bool (*can_duplicate_block_p) (basic_block a);
74
 
75
  /* Duplicate block A.  */
76
  basic_block (*duplicate_block) (basic_block a);
77
 
78
  /* Higher level functions representable by primitive operations above if
79
     we didn't have some oddities in RTL and Tree representations.  */
80
  basic_block (*split_edge) (edge);
81
  void (*make_forwarder_block) (edge);
82
 
83
  /* Tries to make the edge fallthru.  */
84
  void (*tidy_fallthru_edge) (edge);
85
 
86
  /* Say whether a block ends with a call, possibly followed by some
87
     other code that must stay with the call.  */
88
  bool (*block_ends_with_call_p) (basic_block);
89
 
90
  /* Say whether a block ends with a conditional branch.  Switches
91
     and unconditional branches do not qualify.  */
92
  bool (*block_ends_with_condjump_p) (basic_block);
93
 
94
  /* Add fake edges to the function exit for any non constant and non noreturn
95
     calls, volatile inline assembly in the bitmap of blocks specified by
96
     BLOCKS or to the whole CFG if BLOCKS is zero.  Return the number of blocks
97
     that were split.
98
 
99
     The goal is to expose cases in which entering a basic block does not imply
100
     that all subsequent instructions must be executed.  */
101
  int (*flow_call_edges_add) (sbitmap);
102
 
103
  /* This function is called immediately after edge E is added to the
104
     edge vector E->dest->preds.  */
105
  void (*execute_on_growing_pred) (edge);
106
 
107
  /* This function is called immediately before edge E is removed from
108
     the edge vector E->dest->preds.  */
109
  void (*execute_on_shrinking_pred) (edge);
110
 
111
  /* A hook for duplicating loop in CFG, currently this is used
112
     in loop versioning.  */
113
  bool (*cfg_hook_duplicate_loop_to_header_edge) (struct loop *loop, edge e,
114
                                                  struct loops *loops,
115
                                                  unsigned int ndupl,
116
                                                  sbitmap wont_exit,
117
                                                  edge orig, edge *to_remove,
118
                                                  unsigned int *n_to_remove,
119
                                                  int flags);
120
 
121
  /* Add condition to new basic block and update CFG used in loop
122
     versioning.  */
123
  void (*lv_add_condition_to_bb) (basic_block, basic_block, basic_block,
124
                                  void *);
125
  /* Update the PHI nodes in case of loop versioning.  */
126
  void (*lv_adjust_loop_header_phi) (basic_block, basic_block,
127
                                     basic_block, edge);
128
 
129
  /* Given a condition BB extract the true/false taken/not taken edges
130
     (depending if we are on tree's or RTL). */
131
  void (*extract_cond_bb_edges) (basic_block, edge *, edge *);
132
 
133
 
134
  /* Add PHI arguments queued in PENDINT_STMT list on edge E to edge
135
     E->dest (only in tree-ssa loop versioning.  */
136
  void (*flush_pending_stmts) (edge);
137
};
138
 
139
extern void verify_flow_info (void);
140
extern void dump_bb (basic_block, FILE *, int);
141
extern edge redirect_edge_and_branch (edge, basic_block);
142
extern basic_block redirect_edge_and_branch_force (edge, basic_block);
143
extern edge split_block (basic_block, void *);
144
extern edge split_block_after_labels (basic_block);
145
extern bool move_block_after (basic_block, basic_block);
146
extern void delete_basic_block (basic_block);
147
extern basic_block split_edge (edge);
148
extern basic_block create_basic_block (void *, void *, basic_block);
149
extern basic_block create_empty_bb (basic_block);
150
extern bool can_merge_blocks_p (basic_block, basic_block);
151
extern void merge_blocks (basic_block, basic_block);
152
extern edge make_forwarder_block (basic_block, bool (*)(edge),
153
                                  void (*) (basic_block));
154
extern void tidy_fallthru_edge (edge);
155
extern void tidy_fallthru_edges (void);
156
extern void predict_edge (edge e, enum br_predictor predictor, int probability);
157
extern bool predicted_by_p (basic_block bb, enum br_predictor predictor);
158
extern bool can_duplicate_block_p (basic_block);
159
extern basic_block duplicate_block (basic_block, edge, basic_block);
160
extern bool block_ends_with_call_p (basic_block bb);
161
extern bool block_ends_with_condjump_p (basic_block bb);
162
extern int flow_call_edges_add (sbitmap);
163
extern void execute_on_growing_pred (edge);
164
extern void execute_on_shrinking_pred (edge);
165
extern bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge,
166
                                                    struct loops *loops,
167
                                                    unsigned int ndupl,
168
                                                    sbitmap wont_exit,
169
                                                    edge orig, edge *to_remove,
170
                                                    unsigned int *n_to_remove,
171
                                                    int flags);
172
 
173
extern void lv_flush_pending_stmts (edge);
174
extern void extract_cond_bb_edges (basic_block, edge *, edge*);
175
extern void lv_adjust_loop_header_phi (basic_block, basic_block, basic_block,
176
                                       edge);
177
extern void lv_add_condition_to_bb (basic_block, basic_block, basic_block,
178
                                    void *);
179
 
180
/* Hooks containers.  */
181
extern struct cfg_hooks tree_cfg_hooks;
182
extern struct cfg_hooks rtl_cfg_hooks;
183
extern struct cfg_hooks cfg_layout_rtl_cfg_hooks;
184
 
185
/* Declarations.  */
186
extern int ir_type (void);
187
extern void rtl_register_cfg_hooks (void);
188
extern void cfg_layout_rtl_register_cfg_hooks (void);
189
extern void tree_register_cfg_hooks (void);
190
 
191
#endif  /* GCC_CFGHOOKS_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.