* [patch] Move dominance info to struct control_flow_graph
@ 2007-07-25 23:42 Zdenek Dvorak
2007-07-26 10:35 ` Richard Guenther
2007-07-27 14:10 ` Andreas Schwab
0 siblings, 2 replies; 3+ messages in thread
From: Zdenek Dvorak @ 2007-07-25 23:42 UTC (permalink / raw)
To: gcc-patches
Hello,
this patch moves two global variables related to the dominance
information (dom_computed, describing whether dominators were
computed; and n_bbs_in_dom_tree, containing number of basic blocks
in the dominance tree) to struct control_flow_graph. This seems to be
the appropriate place, since all the dominance information is stored in
cfg. This change allows to have dominance information computed for
several functions at once (which might be useful for ipa passes).
Bootstrapped & regtested on i686.
Zdenek
* dominance.c (dom_computed, n_bbs_in_dom_tree): Removed.
* function.h (dom_computed, n_bbs_in_dom_tree): New macros.
* basic-block.h (struct control_flow_graph): Added x_dom_computed
and x_n_bbs_in_dom_tree fields.
Index: dominance.c
===================================================================
*** dominance.c (revision 126869)
--- dominance.c (working copy)
***************
*** 48,56 ****
#include "pointer-set.h"
#include "graphds.h"
- /* Whether the dominators and the postdominators are available. */
- static enum dom_state dom_computed[2];
-
/* We name our nodes with integers, beginning with 1. Zero is reserved for
'undefined' or 'end of list'. The name of each node is given by the dfs
number of the corresponding basic block. Please note, that we include the
--- 48,53 ----
*************** static void calc_idoms (struct dom_info
*** 126,134 ****
void debug_dominance_info (enum cdi_direction);
void debug_dominance_tree (enum cdi_direction, basic_block);
- /* Keeps track of the*/
- static unsigned n_bbs_in_dom_tree[2];
-
/* Helper macro for allocating and initializing an array,
for aesthetic reasons. */
#define init_ar(var, type, num, content) \
--- 123,128 ----
Index: function.h
===================================================================
*** function.h (revision 126869)
--- function.h (working copy)
*************** extern int trampolines_created;
*** 535,540 ****
--- 535,542 ----
#define nonlocal_goto_handler_labels (cfun->x_nonlocal_goto_handler_labels)
#define rtl_df (cfun->df)
#define current_loops (cfun->x_current_loops)
+ #define dom_computed (cfun->cfg->x_dom_computed)
+ #define n_bbs_in_dom_tree (cfun->cfg->x_n_bbs_in_dom_tree)
#define VALUE_HISTOGRAMS(fun) (fun)->value_histograms
/* Given a function decl for a containing function,
Index: basic-block.h
===================================================================
*** basic-block.h (revision 126869)
--- basic-block.h (working copy)
*************** enum bb_flags
*** 349,354 ****
--- 349,363 ----
#define BB_COPY_PARTITION(dstbb, srcbb) \
BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb))
+ /* State of dominance information. */
+
+ enum dom_state
+ {
+ DOM_NONE, /* Not computed at all. */
+ DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */
+ DOM_OK /* Everything is ok. */
+ };
+
/* A structure to group all the per-function control flow graph data.
The x_* prefixing is necessary because otherwise references to the
fields of this struct are interpreted as the defines for backward
*************** struct control_flow_graph GTY(())
*** 381,386 ****
--- 390,401 ----
PROFILE_GUESSED,
PROFILE_READ
} x_profile_status;
+
+ /* Whether the dominators and the postdominators are available. */
+ enum dom_state x_dom_computed[2];
+
+ /* Number of basic blocks in the dominance tree. */
+ unsigned x_n_bbs_in_dom_tree[2];
};
/* Defines for accessing the fields of the CFG structure for function FN. */
*************** enum cdi_direction
*** 888,900 ****
CDI_POST_DOMINATORS = 2
};
- enum dom_state
- {
- DOM_NONE, /* Not computed at all. */
- DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */
- DOM_OK /* Everything is ok. */
- };
-
extern enum dom_state dom_info_state (enum cdi_direction);
extern void set_dom_info_availability (enum cdi_direction, enum dom_state);
extern bool dom_info_available_p (enum cdi_direction);
--- 904,909 ----
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] Move dominance info to struct control_flow_graph
2007-07-25 23:42 [patch] Move dominance info to struct control_flow_graph Zdenek Dvorak
@ 2007-07-26 10:35 ` Richard Guenther
2007-07-27 14:10 ` Andreas Schwab
1 sibling, 0 replies; 3+ messages in thread
From: Richard Guenther @ 2007-07-26 10:35 UTC (permalink / raw)
To: Zdenek Dvorak; +Cc: gcc-patches
On 7/26/07, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> Hello,
>
> this patch moves two global variables related to the dominance
> information (dom_computed, describing whether dominators were
> computed; and n_bbs_in_dom_tree, containing number of basic blocks
> in the dominance tree) to struct control_flow_graph. This seems to be
> the appropriate place, since all the dominance information is stored in
> cfg. This change allows to have dominance information computed for
> several functions at once (which might be useful for ipa passes).
>
> Bootstrapped & regtested on i686.
THis is ok.
Thanks,
Richard.
> Zdenek
>
> * dominance.c (dom_computed, n_bbs_in_dom_tree): Removed.
> * function.h (dom_computed, n_bbs_in_dom_tree): New macros.
> * basic-block.h (struct control_flow_graph): Added x_dom_computed
> and x_n_bbs_in_dom_tree fields.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] Move dominance info to struct control_flow_graph
2007-07-25 23:42 [patch] Move dominance info to struct control_flow_graph Zdenek Dvorak
2007-07-26 10:35 ` Richard Guenther
@ 2007-07-27 14:10 ` Andreas Schwab
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2007-07-27 14:10 UTC (permalink / raw)
To: Zdenek Dvorak; +Cc: gcc-patches
Zdenek Dvorak <rakdver@kam.mff.cuni.cz> writes:
> * dominance.c (dom_computed, n_bbs_in_dom_tree): Removed.
> * function.h (dom_computed, n_bbs_in_dom_tree): New macros.
> * basic-block.h (struct control_flow_graph): Added x_dom_computed
> and x_n_bbs_in_dom_tree fields.
This causes a bootstrap comparison failure for ./ada/exp_aggr.o on ia64.
The only difference is in the .debug_line section.
Special opcode 15: advance Address by 1 to 0x119b1 and Line by -4 to 3450
Advance PC by constant 17 to 0x119c2
Special opcode 9: advance Address by 0 to 0x119c2 and Line by 4 to 3454
- Advance Line by 43 to 3497
+ Advance Line by 151 to 3605
Advance PC by 46 to 0x119f0
Copy
- Advance Line by 135 to 3632
+ Advance Line by 27 to 3632
Special opcode 229: advance Address by 16 to 0x11a00 and Line by 0 to 3632
Advance Line by -177 to 3455
Advance PC by 48 to 0x11a30
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-27 13:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-25 23:42 [patch] Move dominance info to struct control_flow_graph Zdenek Dvorak
2007-07-26 10:35 ` Richard Guenther
2007-07-27 14:10 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).