Commit 391886c8 by Richard Guenther Committed by Richard Biener

basic-block.h (struct basic_block): Remove loop_depth member, move flags and…

basic-block.h (struct basic_block): Remove loop_depth member, move flags and index members next to each other.

2012-08-13  Richard Guenther  <rguenther@suse.de>

	* basic-block.h (struct basic_block): Remove loop_depth
	member, move flags and index members next to each other.
	* cfgloop.h (bb_loop_depth): New inline function.
	* cfghooks.c (split_block): Do not set loop_depth.
	(duplicate_block): Likewise.
	* cfgloop.c (flow_loop_nodes_find): Likewise.
	(flow_loops_find): Likewise.
	(add_bb_to_loop): Likewise.
	(remove_bb_from_loops): Likewise.
	* cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
	* gimple-streamer-in.c (input_bb): Do not stream loop_depth.
	* gimple-streamer-out.c (output_bb): Likewise.
	* bt-load.c: Include cfgloop.h.
	(migrate_btr_defs): Use bb_loop_depth.
	* cfg.c (dump_bb_info): Likewise.
	* final.c (compute_alignments): Likewise.
	* ira.c (update_equiv_regs): Likewise.
	* tree-ssa-copy.c (init_copy_prop): Likewise.
	* tree-ssa-dom.c (loop_depth_of_name): Likewise.
	* tree-ssa-forwprop.c: Include cfgloop.h.
	(forward_propagate_addr_expr): Use bb_loop_depth.
	* tree-ssa-pre.c (insert_into_preds_of_block): Likewise.
	* tree-ssa-sink.c (select_best_block): Likewise.
	* ipa-inline-analysis.c: Include cfgloop.h.
	(estimate_function_body_sizes): Use bb_loop_depth.
	* Makefile.in (tree-ssa-forwprop.o): Depend on $(CFGLOOP_H).
	(ipa-inline-analysis.o): Likewise.
	(bt-load.o): Likewise.

	* gcc.dg/tree-prof/update-loopch.c: Adjust.

From-SVN: r190346
parent 9006f7f3
2012-08-13 Richard Guenther <rguenther@suse.de>
* basic-block.h (struct basic_block): Remove loop_depth
member, move flags and index members next to each other.
* cfgloop.h (bb_loop_depth): New inline function.
* cfghooks.c (split_block): Do not set loop_depth.
(duplicate_block): Likewise.
* cfgloop.c (flow_loop_nodes_find): Likewise.
(flow_loops_find): Likewise.
(add_bb_to_loop): Likewise.
(remove_bb_from_loops): Likewise.
* cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
* gimple-streamer-in.c (input_bb): Do not stream loop_depth.
* gimple-streamer-out.c (output_bb): Likewise.
* bt-load.c: Include cfgloop.h.
(migrate_btr_defs): Use bb_loop_depth.
* cfg.c (dump_bb_info): Likewise.
* final.c (compute_alignments): Likewise.
* ira.c (update_equiv_regs): Likewise.
* tree-ssa-copy.c (init_copy_prop): Likewise.
* tree-ssa-dom.c (loop_depth_of_name): Likewise.
* tree-ssa-forwprop.c: Include cfgloop.h.
(forward_propagate_addr_expr): Use bb_loop_depth.
* tree-ssa-pre.c (insert_into_preds_of_block): Likewise.
* tree-ssa-sink.c (select_best_block): Likewise.
* ipa-inline-analysis.c: Include cfgloop.h.
(estimate_function_body_sizes): Use bb_loop_depth.
* Makefile.in (tree-ssa-forwprop.o): Depend on $(CFGLOOP_H).
(ipa-inline-analysis.o): Likewise.
(bt-load.o): Likewise.
2012-08-13 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com> 2012-08-13 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com>
Jakub Jelinek <jakub@redhat.com> Jakub Jelinek <jakub@redhat.com>
......
...@@ -2271,7 +2271,7 @@ tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ ...@@ -2271,7 +2271,7 @@ tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TREE_FLOW_H) $(TREE_PASS_H) domwalk.h $(FLAGS_H) \ $(TREE_FLOW_H) $(TREE_PASS_H) domwalk.h $(FLAGS_H) \
$(GIMPLE_PRETTY_PRINT_H) langhooks.h $(GIMPLE_PRETTY_PRINT_H) langhooks.h
tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(TM_P_H) $(BASIC_BLOCK_H) \ $(TM_H) $(TREE_H) $(TM_P_H) $(BASIC_BLOCK_H) $(CFGLOOP_H) \
$(TREE_FLOW_H) $(TREE_PASS_H) $(DIAGNOSTIC_H) \ $(TREE_FLOW_H) $(TREE_PASS_H) $(DIAGNOSTIC_H) \
langhooks.h $(FLAGS_H) $(GIMPLE_H) $(GIMPLE_PRETTY_PRINT_H) $(EXPR_H) langhooks.h $(FLAGS_H) $(GIMPLE_H) $(GIMPLE_PRETTY_PRINT_H) $(EXPR_H)
tree-ssa-phiprop.o : tree-ssa-phiprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ tree-ssa-phiprop.o : tree-ssa-phiprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
...@@ -2899,7 +2899,7 @@ ipa-inline.o : ipa-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ ...@@ -2899,7 +2899,7 @@ ipa-inline.o : ipa-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(EXCEPT_H) $(GIMPLE_PRETTY_PRINT_H) ipa-inline.h $(TARGET_H) $(IPA_UTILS_H) $(EXCEPT_H) $(GIMPLE_PRETTY_PRINT_H) ipa-inline.h $(TARGET_H) $(IPA_UTILS_H)
ipa-inline-analysis.o : ipa-inline-analysis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ ipa-inline-analysis.o : ipa-inline-analysis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) langhooks.h $(TREE_INLINE_H) $(FLAGS_H) $(CGRAPH_H) intl.h \ $(TREE_H) langhooks.h $(TREE_INLINE_H) $(FLAGS_H) $(CGRAPH_H) intl.h \
$(DIAGNOSTIC_H) $(PARAMS_H) $(TREE_PASS_H) \ $(DIAGNOSTIC_H) $(PARAMS_H) $(TREE_PASS_H) $(CFGLOOP_H) \
$(HASHTAB_H) $(COVERAGE_H) $(GGC_H) $(TREE_FLOW_H) $(IPA_PROP_H) \ $(HASHTAB_H) $(COVERAGE_H) $(GGC_H) $(TREE_FLOW_H) $(IPA_PROP_H) \
$(GIMPLE_PRETTY_PRINT_H) ipa-inline.h $(LTO_STREAMER_H) $(DATA_STREAMER_H) \ $(GIMPLE_PRETTY_PRINT_H) ipa-inline.h $(LTO_STREAMER_H) $(DATA_STREAMER_H) \
$(TREE_STREAMER_H) $(TREE_STREAMER_H)
...@@ -3183,7 +3183,7 @@ caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h \ ...@@ -3183,7 +3183,7 @@ caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h \
bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(EXCEPT_H) \ bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(EXCEPT_H) \
$(RTL_H) hard-reg-set.h $(REGS_H) $(TM_P_H) $(FIBHEAP_H) $(EXPR_H) \ $(RTL_H) hard-reg-set.h $(REGS_H) $(TM_P_H) $(FIBHEAP_H) $(EXPR_H) \
$(TARGET_H) $(FLAGS_H) $(INSN_ATTR_H) $(FUNCTION_H) $(TREE_PASS_H) \ $(TARGET_H) $(FLAGS_H) $(INSN_ATTR_H) $(FUNCTION_H) $(TREE_PASS_H) \
$(DIAGNOSTIC_CORE_H) $(DF_H) vecprim.h $(RECOG_H) $(DIAGNOSTIC_CORE_H) $(DF_H) vecprim.h $(RECOG_H) $(CFGLOOP_H)
reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
conditions.h hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \ conditions.h hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \
$(INSN_ATTR_H) $(EXCEPT_H) $(RECOG_H) $(FUNCTION_H) $(FLAGS_H) output.h \ $(INSN_ATTR_H) $(EXCEPT_H) $(RECOG_H) $(FUNCTION_H) $(FLAGS_H) output.h \
......
...@@ -160,14 +160,14 @@ struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_d ...@@ -160,14 +160,14 @@ struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_d
} GTY ((tag ("1"))) x; } GTY ((tag ("1"))) x;
} GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il; } GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
/* Expected number of executions: calculated in profile.c. */ /* Various flags. See cfg-flags.def. */
gcov_type count; int flags;
/* The index of this block. */ /* The index of this block. */
int index; int index;
/* The loop depth of this block. */ /* Expected number of executions: calculated in profile.c. */
int loop_depth; gcov_type count;
/* Expected frequency. Normalized to be in range 0 to BB_FREQ_MAX. */ /* Expected frequency. Normalized to be in range 0 to BB_FREQ_MAX. */
int frequency; int frequency;
...@@ -176,9 +176,6 @@ struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_d ...@@ -176,9 +176,6 @@ struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_d
among several basic blocks that share a common locus, allowing for among several basic blocks that share a common locus, allowing for
more accurate sample-based profiling. */ more accurate sample-based profiling. */
int discriminator; int discriminator;
/* Various flags. See cfg-flags.def. */
int flags;
}; };
/* This ensures that struct gimple_bb_info is smaller than /* This ensures that struct gimple_bb_info is smaller than
......
...@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h" #include "tree-pass.h"
#include "recog.h" #include "recog.h"
#include "df.h" #include "df.h"
#include "cfgloop.h"
/* Target register optimizations - these are performed after reload. */ /* Target register optimizations - these are performed after reload. */
...@@ -1408,7 +1409,7 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save) ...@@ -1408,7 +1409,7 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save)
fprintf(dump_file, fprintf(dump_file,
"Basic block %d: count = " HOST_WIDEST_INT_PRINT_DEC "Basic block %d: count = " HOST_WIDEST_INT_PRINT_DEC
" loop-depth = %d idom = %d\n", " loop-depth = %d idom = %d\n",
i, (HOST_WIDEST_INT) bb->count, bb->loop_depth, i, (HOST_WIDEST_INT) bb->count, bb_loop_depth (bb),
get_immediate_dominator (CDI_DOMINATORS, bb)->index); get_immediate_dominator (CDI_DOMINATORS, bb)->index);
} }
} }
......
...@@ -698,7 +698,7 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, int flags, ...@@ -698,7 +698,7 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, int flags,
if (flags & TDF_COMMENT) if (flags & TDF_COMMENT)
fputs (";; ", outf); fputs (";; ", outf);
fprintf (outf, "%sbasic block %d, loop depth %d", fprintf (outf, "%sbasic block %d, loop depth %d",
s_indent, bb->index, bb->loop_depth); s_indent, bb->index, bb_loop_depth (bb));
if (flags & TDF_DETAILS) if (flags & TDF_DETAILS)
{ {
fprintf (outf, ", count " HOST_WIDEST_INT_PRINT_DEC, fprintf (outf, ", count " HOST_WIDEST_INT_PRINT_DEC,
......
...@@ -462,7 +462,6 @@ split_block (basic_block bb, void *i) ...@@ -462,7 +462,6 @@ split_block (basic_block bb, void *i)
new_bb->count = bb->count; new_bb->count = bb->count;
new_bb->frequency = bb->frequency; new_bb->frequency = bb->frequency;
new_bb->loop_depth = bb->loop_depth;
new_bb->discriminator = bb->discriminator; new_bb->discriminator = bb->discriminator;
if (dom_info_available_p (CDI_DOMINATORS)) if (dom_info_available_p (CDI_DOMINATORS))
...@@ -985,7 +984,6 @@ duplicate_block (basic_block bb, edge e, basic_block after) ...@@ -985,7 +984,6 @@ duplicate_block (basic_block bb, edge e, basic_block after)
if (after) if (after)
move_block_after (new_bb, after); move_block_after (new_bb, after);
new_bb->loop_depth = bb->loop_depth;
new_bb->flags = bb->flags; new_bb->flags = bb->flags;
FOR_EACH_EDGE (s, ei, bb->succs) FOR_EACH_EDGE (s, ei, bb->succs)
{ {
......
...@@ -229,10 +229,8 @@ flow_loop_nodes_find (basic_block header, struct loop *loop) ...@@ -229,10 +229,8 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
int num_nodes = 1; int num_nodes = 1;
edge latch; edge latch;
edge_iterator latch_ei; edge_iterator latch_ei;
unsigned depth = loop_depth (loop);
header->loop_father = loop; header->loop_father = loop;
header->loop_depth = depth;
FOR_EACH_EDGE (latch, latch_ei, loop->header->preds) FOR_EACH_EDGE (latch, latch_ei, loop->header->preds)
{ {
...@@ -243,7 +241,6 @@ flow_loop_nodes_find (basic_block header, struct loop *loop) ...@@ -243,7 +241,6 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
num_nodes++; num_nodes++;
VEC_safe_push (basic_block, heap, stack, latch->src); VEC_safe_push (basic_block, heap, stack, latch->src);
latch->src->loop_father = loop; latch->src->loop_father = loop;
latch->src->loop_depth = depth;
while (!VEC_empty (basic_block, stack)) while (!VEC_empty (basic_block, stack))
{ {
...@@ -260,7 +257,6 @@ flow_loop_nodes_find (basic_block header, struct loop *loop) ...@@ -260,7 +257,6 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
if (ancestor->loop_father != loop) if (ancestor->loop_father != loop)
{ {
ancestor->loop_father = loop; ancestor->loop_father = loop;
ancestor->loop_depth = depth;
num_nodes++; num_nodes++;
VEC_safe_push (basic_block, heap, stack, ancestor); VEC_safe_push (basic_block, heap, stack, ancestor);
} }
...@@ -365,7 +361,7 @@ init_loops_structure (struct loops *loops, unsigned num_loops) ...@@ -365,7 +361,7 @@ init_loops_structure (struct loops *loops, unsigned num_loops)
} }
/* Find all the natural loops in the function and save in LOOPS structure and /* Find all the natural loops in the function and save in LOOPS structure and
recalculate loop_depth information in basic block structures. recalculate loop_father information in basic block structures.
Return the number of natural loops found. */ Return the number of natural loops found. */
int int
...@@ -404,8 +400,6 @@ flow_loops_find (struct loops *loops) ...@@ -404,8 +400,6 @@ flow_loops_find (struct loops *loops)
{ {
edge_iterator ei; edge_iterator ei;
header->loop_depth = 0;
/* If we have an abnormal predecessor, do not consider the /* If we have an abnormal predecessor, do not consider the
loop (not worth the problems). */ loop (not worth the problems). */
if (bb_has_abnormal_pred (header)) if (bb_has_abnormal_pred (header))
...@@ -1185,7 +1179,6 @@ add_bb_to_loop (basic_block bb, struct loop *loop) ...@@ -1185,7 +1179,6 @@ add_bb_to_loop (basic_block bb, struct loop *loop)
gcc_assert (bb->loop_father == NULL); gcc_assert (bb->loop_father == NULL);
bb->loop_father = loop; bb->loop_father = loop;
bb->loop_depth = loop_depth (loop);
loop->num_nodes++; loop->num_nodes++;
FOR_EACH_VEC_ELT (loop_p, loop->superloops, i, ploop) FOR_EACH_VEC_ELT (loop_p, loop->superloops, i, ploop)
ploop->num_nodes++; ploop->num_nodes++;
...@@ -1215,7 +1208,6 @@ remove_bb_from_loops (basic_block bb) ...@@ -1215,7 +1208,6 @@ remove_bb_from_loops (basic_block bb)
FOR_EACH_VEC_ELT (loop_p, loop->superloops, i, ploop) FOR_EACH_VEC_ELT (loop_p, loop->superloops, i, ploop)
ploop->num_nodes--; ploop->num_nodes--;
bb->loop_father = NULL; bb->loop_father = NULL;
bb->loop_depth = 0;
FOR_EACH_EDGE (e, ei, bb->succs) FOR_EACH_EDGE (e, ei, bb->succs)
{ {
......
...@@ -445,6 +445,14 @@ loop_depth (const struct loop *loop) ...@@ -445,6 +445,14 @@ loop_depth (const struct loop *loop)
return VEC_length (loop_p, loop->superloops); return VEC_length (loop_p, loop->superloops);
} }
/* Returns the loop depth of the loop BB belongs to. */
static inline int
bb_loop_depth (const_basic_block bb)
{
return bb->loop_father ? loop_depth (bb->loop_father) : 0;
}
/* Returns the immediate superloop of LOOP, or NULL if LOOP is the outermost /* Returns the immediate superloop of LOOP, or NULL if LOOP is the outermost
loop. */ loop. */
......
...@@ -1438,7 +1438,6 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label) ...@@ -1438,7 +1438,6 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label)
jump_block = create_basic_block (note, NULL, e->src); jump_block = create_basic_block (note, NULL, e->src);
jump_block->count = count; jump_block->count = count;
jump_block->frequency = EDGE_FREQUENCY (e); jump_block->frequency = EDGE_FREQUENCY (e);
jump_block->loop_depth = target->loop_depth;
/* Make sure new block ends up in correct hot/cold section. */ /* Make sure new block ends up in correct hot/cold section. */
......
...@@ -739,7 +739,8 @@ compute_alignments (void) ...@@ -739,7 +739,8 @@ compute_alignments (void)
{ {
if (dump_file) if (dump_file)
fprintf(dump_file, "BB %4i freq %4i loop %2i loop_depth %2i skipped.\n", fprintf(dump_file, "BB %4i freq %4i loop %2i loop_depth %2i skipped.\n",
bb->index, bb->frequency, bb->loop_father->num, bb->loop_depth); bb->index, bb->frequency, bb->loop_father->num,
bb_loop_depth (bb));
continue; continue;
} }
max_log = LABEL_ALIGN (label); max_log = LABEL_ALIGN (label);
...@@ -756,7 +757,7 @@ compute_alignments (void) ...@@ -756,7 +757,7 @@ compute_alignments (void)
{ {
fprintf(dump_file, "BB %4i freq %4i loop %2i loop_depth %2i fall %4i branch %4i", fprintf(dump_file, "BB %4i freq %4i loop %2i loop_depth %2i fall %4i branch %4i",
bb->index, bb->frequency, bb->loop_father->num, bb->index, bb->frequency, bb->loop_father->num,
bb->loop_depth, bb_loop_depth (bb),
fallthru_frequency, branch_frequency); fallthru_frequency, branch_frequency);
if (!bb->loop_father->inner && bb->loop_father->num) if (!bb->loop_father->inner && bb->loop_father->num)
fprintf (dump_file, " inner_loop"); fprintf (dump_file, " inner_loop");
......
...@@ -296,7 +296,6 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag, ...@@ -296,7 +296,6 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag,
bb->count = (streamer_read_hwi (ib) * count_materialization_scale bb->count = (streamer_read_hwi (ib) * count_materialization_scale
+ REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE; + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
bb->loop_depth = streamer_read_hwi (ib);
bb->frequency = streamer_read_hwi (ib); bb->frequency = streamer_read_hwi (ib);
bb->flags = streamer_read_hwi (ib); bb->flags = streamer_read_hwi (ib);
......
...@@ -176,7 +176,6 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn) ...@@ -176,7 +176,6 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn)
streamer_write_uhwi (ob, bb->index); streamer_write_uhwi (ob, bb->index);
streamer_write_hwi (ob, bb->count); streamer_write_hwi (ob, bb->count);
streamer_write_hwi (ob, bb->loop_depth);
streamer_write_hwi (ob, bb->frequency); streamer_write_hwi (ob, bb->frequency);
streamer_write_hwi (ob, bb->flags); streamer_write_hwi (ob, bb->flags);
......
...@@ -87,6 +87,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -87,6 +87,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-streamer.h" #include "tree-streamer.h"
#include "ipa-inline.h" #include "ipa-inline.h"
#include "alloc-pool.h" #include "alloc-pool.h"
#include "cfgloop.h"
/* Estimate runtime of function can easilly run into huge numbers with many /* Estimate runtime of function can easilly run into huge numbers with many
nested loops. Be sure we can compute time * INLINE_SIZE_SCALE * 2 in an nested loops. Be sure we can compute time * INLINE_SIZE_SCALE * 2 in an
...@@ -2088,7 +2089,7 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early) ...@@ -2088,7 +2089,7 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
es->call_stmt_size = this_size; es->call_stmt_size = this_size;
es->call_stmt_time = this_time; es->call_stmt_time = this_time;
es->loop_depth = bb->loop_depth; es->loop_depth = bb_loop_depth (bb);
edge_set_predicate (edge, &bb_predicate); edge_set_predicate (edge, &bb_predicate);
} }
......
...@@ -2777,7 +2777,7 @@ update_equiv_regs (void) ...@@ -2777,7 +2777,7 @@ update_equiv_regs (void)
a register can be set below its use. */ a register can be set below its use. */
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
{ {
loop_depth = bb->loop_depth; loop_depth = bb_loop_depth (bb);
for (insn = BB_HEAD (bb); for (insn = BB_HEAD (bb);
insn != NEXT_INSN (BB_END (bb)); insn != NEXT_INSN (BB_END (bb));
...@@ -3053,7 +3053,7 @@ update_equiv_regs (void) ...@@ -3053,7 +3053,7 @@ update_equiv_regs (void)
basic block. */ basic block. */
FOR_EACH_BB_REVERSE (bb) FOR_EACH_BB_REVERSE (bb)
{ {
loop_depth = bb->loop_depth; loop_depth = bb_loop_depth (bb);
for (insn = BB_END (bb); for (insn = BB_END (bb);
insn != PREV_INSN (BB_HEAD (bb)); insn != PREV_INSN (BB_HEAD (bb));
insn = PREV_INSN (insn)) insn = PREV_INSN (insn))
......
2012-08-13 Richard Guenther <rguenther@suse.de> 2012-08-13 Richard Guenther <rguenther@suse.de>
* gcc.dg/tree-prof/update-loopch.c: Adjust.
2012-08-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/54200 PR tree-optimization/54200
* gcc.dg/guality/pr54200.c: New testcase. * gcc.dg/guality/pr54200.c: New testcase.
* gcc.dg/tree-ssa/slsr-8.c: Adjust. * gcc.dg/tree-ssa/slsr-8.c: Adjust.
......
...@@ -14,7 +14,7 @@ main () ...@@ -14,7 +14,7 @@ main ()
/* Loop header copying will peel away the initial conditional, so the loop body /* Loop header copying will peel away the initial conditional, so the loop body
is once reached directly from entry point of function, rest via loopback is once reached directly from entry point of function, rest via loopback
edge. */ edge. */
/* { dg-final-use { scan-ipa-dump "loop depth 1, count 33334" "profile"} } */ /* { dg-final-use { scan-ipa-dump "loop depth 0, count 33334" "profile"} } */
/* { dg-final-use { scan-tree-dump "loop depth 1, count 33332" "optimized"} } */ /* { dg-final-use { scan-tree-dump "loop depth 1, count 33332" "optimized"} } */
/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
/* { dg-final-use { cleanup-ipa-dump "profile" } } */ /* { dg-final-use { cleanup-ipa-dump "profile" } } */
......
...@@ -670,7 +670,7 @@ init_copy_prop (void) ...@@ -670,7 +670,7 @@ init_copy_prop (void)
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
{ {
gimple_stmt_iterator si; gimple_stmt_iterator si;
int depth = bb->loop_depth; int depth = bb_loop_depth (bb);
for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si)) for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{ {
......
...@@ -1391,7 +1391,7 @@ loop_depth_of_name (tree x) ...@@ -1391,7 +1391,7 @@ loop_depth_of_name (tree x)
if (!defbb) if (!defbb)
return 0; return 0;
return defbb->loop_depth; return bb_loop_depth (defbb);
} }
/* Record that X is equal to Y in const_and_copies. Record undo /* Record that X is equal to Y in const_and_copies. Record undo
......
...@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h" #include "flags.h"
#include "gimple.h" #include "gimple.h"
#include "expr.h" #include "expr.h"
#include "cfgloop.h"
/* This pass propagates the RHS of assignment statements into use /* This pass propagates the RHS of assignment statements into use
sites of the LHS of the assignment. It's basically a specialized sites of the LHS of the assignment. It's basically a specialized
...@@ -1002,7 +1003,7 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, ...@@ -1002,7 +1003,7 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
static bool static bool
forward_propagate_addr_expr (tree name, tree rhs) forward_propagate_addr_expr (tree name, tree rhs)
{ {
int stmt_loop_depth = gimple_bb (SSA_NAME_DEF_STMT (name))->loop_depth; int stmt_loop_depth = bb_loop_depth (gimple_bb (SSA_NAME_DEF_STMT (name)));
imm_use_iterator iter; imm_use_iterator iter;
gimple use_stmt; gimple use_stmt;
bool all = true; bool all = true;
...@@ -1025,7 +1026,7 @@ forward_propagate_addr_expr (tree name, tree rhs) ...@@ -1025,7 +1026,7 @@ forward_propagate_addr_expr (tree name, tree rhs)
/* If the use is in a deeper loop nest, then we do not want /* If the use is in a deeper loop nest, then we do not want
to propagate non-invariant ADDR_EXPRs into the loop as that to propagate non-invariant ADDR_EXPRs into the loop as that
is likely adding expression evaluations into the loop. */ is likely adding expression evaluations into the loop. */
if (gimple_bb (use_stmt)->loop_depth > stmt_loop_depth if (bb_loop_depth (gimple_bb (use_stmt)) > stmt_loop_depth
&& !is_gimple_min_invariant (rhs)) && !is_gimple_min_invariant (rhs))
{ {
all = false; all = false;
......
...@@ -3204,7 +3204,7 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum, ...@@ -3204,7 +3204,7 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
gimple phi; gimple phi;
/* Make sure we aren't creating an induction variable. */ /* Make sure we aren't creating an induction variable. */
if (block->loop_depth > 0 && EDGE_COUNT (block->preds) == 2) if (bb_loop_depth (block) > 0 && EDGE_COUNT (block->preds) == 2)
{ {
bool firstinsideloop = false; bool firstinsideloop = false;
bool secondinsideloop = false; bool secondinsideloop = false;
......
...@@ -212,7 +212,7 @@ select_best_block (basic_block early_bb, ...@@ -212,7 +212,7 @@ select_best_block (basic_block early_bb,
{ {
/* If we've moved into a lower loop nest, then that becomes /* If we've moved into a lower loop nest, then that becomes
our best block. */ our best block. */
if (temp_bb->loop_depth < best_bb->loop_depth) if (bb_loop_depth (temp_bb) < bb_loop_depth (best_bb))
best_bb = temp_bb; best_bb = temp_bb;
/* Walk up the dominator tree, hopefully we'll find a shallower /* Walk up the dominator tree, hopefully we'll find a shallower
...@@ -223,7 +223,7 @@ select_best_block (basic_block early_bb, ...@@ -223,7 +223,7 @@ select_best_block (basic_block early_bb,
/* If we found a shallower loop nest, then we always consider that /* If we found a shallower loop nest, then we always consider that
a win. This will always give us the most control dependent block a win. This will always give us the most control dependent block
within that loop nest. */ within that loop nest. */
if (best_bb->loop_depth < early_bb->loop_depth) if (bb_loop_depth (best_bb) < bb_loop_depth (early_bb))
return best_bb; return best_bb;
/* Get the sinking threshold. If the statement to be moved has memory /* Get the sinking threshold. If the statement to be moved has memory
...@@ -239,7 +239,7 @@ select_best_block (basic_block early_bb, ...@@ -239,7 +239,7 @@ select_best_block (basic_block early_bb,
/* If BEST_BB is at the same nesting level, then require it to have /* If BEST_BB is at the same nesting level, then require it to have
significantly lower execution frequency to avoid gratutious movement. */ significantly lower execution frequency to avoid gratutious movement. */
if (best_bb->loop_depth == early_bb->loop_depth if (bb_loop_depth (best_bb) == bb_loop_depth (early_bb)
&& best_bb->frequency < (early_bb->frequency * threshold / 100.0)) && best_bb->frequency < (early_bb->frequency * threshold / 100.0))
return best_bb; return best_bb;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment