aboutsummaryrefslogtreecommitdiff
path: root/gcc/var-tracking.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-03-02 13:18:39 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-03-02 13:18:39 +0100
commitd9a6979d96fcd19b2aa2660180c3a6ec26909cb3 (patch)
tree79ae7ab23fa1f60d595bc76405b4cf936ec7d794 /gcc/var-tracking.c
parent2542496c7022185de67a2098e93f966c610835c3 (diff)
downloadgcc-d9a6979d96fcd19b2aa2660180c3a6ec26909cb3.zip
gcc-d9a6979d96fcd19b2aa2660180c3a6ec26909cb3.tar.gz
gcc-d9a6979d96fcd19b2aa2660180c3a6ec26909cb3.tar.bz2
var-tracking.c (vt_initialize): Scan insns in ebb chunks instead of bb.
* var-tracking.c (vt_initialize): Scan insns in ebb chunks instead of bb. Co-Authored-By: Steven Bosscher <steven@gcc.gnu.org> From-SVN: r157164
Diffstat (limited to 'gcc/var-tracking.c')
-rw-r--r--gcc/var-tracking.c165
1 files changed, 94 insertions, 71 deletions
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 59369cb..374e333 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -7399,9 +7399,9 @@ vt_initialize (void)
{
rtx insn;
HOST_WIDE_INT pre, post = 0;
- int count;
unsigned int next_uid_before = cselib_get_next_uid ();
unsigned int next_uid_after = next_uid_before;
+ basic_block first_bb, last_bb;
if (MAY_HAVE_DEBUG_INSNS)
{
@@ -7411,55 +7411,70 @@ vt_initialize (void)
cselib_get_next_uid ());
}
+ first_bb = bb;
+ for (;;)
+ {
+ edge e;
+ if (bb->next_bb == EXIT_BLOCK_PTR
+ || ! single_pred_p (bb->next_bb))
+ break;
+ e = find_edge (bb, bb->next_bb);
+ if (! e || (e->flags & EDGE_FALLTHRU) == 0)
+ break;
+ bb = bb->next_bb;
+ }
+ last_bb = bb;
+
/* Count the number of micro operations. */
- VTI (bb)->n_mos = 0;
- for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb));
- insn = NEXT_INSN (insn))
+ FOR_BB_BETWEEN (bb, first_bb, last_bb->next_bb, next_bb)
{
- if (INSN_P (insn))
+ VTI (bb)->n_mos = 0;
+ for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb));
+ insn = NEXT_INSN (insn))
{
- if (!frame_pointer_needed)
+ if (INSN_P (insn))
{
- insn_stack_adjust_offset_pre_post (insn, &pre, &post);
- if (pre)
+ if (!frame_pointer_needed)
{
- VTI (bb)->n_mos++;
- if (dump_file && (dump_flags & TDF_DETAILS))
- log_op_type (GEN_INT (pre), bb, insn,
- MO_ADJUST, dump_file);
+ insn_stack_adjust_offset_pre_post (insn, &pre, &post);
+ if (pre)
+ {
+ VTI (bb)->n_mos++;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ log_op_type (GEN_INT (pre), bb, insn,
+ MO_ADJUST, dump_file);
+ }
+ if (post)
+ {
+ VTI (bb)->n_mos++;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ log_op_type (GEN_INT (post), bb, insn,
+ MO_ADJUST, dump_file);
+ }
}
- if (post)
+ cselib_hook_called = false;
+ if (MAY_HAVE_DEBUG_INSNS)
{
- VTI (bb)->n_mos++;
+ cselib_process_insn (insn);
if (dump_file && (dump_flags & TDF_DETAILS))
- log_op_type (GEN_INT (post), bb, insn,
- MO_ADJUST, dump_file);
+ {
+ print_rtl_single (dump_file, insn);
+ dump_cselib_table (dump_file);
+ }
}
- }
- cselib_hook_called = false;
- if (MAY_HAVE_DEBUG_INSNS)
- {
- cselib_process_insn (insn);
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (!cselib_hook_called)
+ count_with_sets (insn, 0, 0);
+ if (CALL_P (insn))
{
- print_rtl_single (dump_file, insn);
- dump_cselib_table (dump_file);
+ VTI (bb)->n_mos++;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ log_op_type (PATTERN (insn), bb, insn,
+ MO_CALL, dump_file);
}
}
- if (!cselib_hook_called)
- count_with_sets (insn, 0, 0);
- if (CALL_P (insn))
- {
- VTI (bb)->n_mos++;
- if (dump_file && (dump_flags & TDF_DETAILS))
- log_op_type (PATTERN (insn), bb, insn,
- MO_CALL, dump_file);
- }
}
}
- count = VTI (bb)->n_mos;
-
if (MAY_HAVE_DEBUG_INSNS)
{
cselib_preserve_only_values (false);
@@ -7472,58 +7487,66 @@ vt_initialize (void)
}
/* Add the micro-operations to the array. */
- VTI (bb)->mos = XNEWVEC (micro_operation, VTI (bb)->n_mos);
- VTI (bb)->n_mos = 0;
- for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb));
- insn = NEXT_INSN (insn))
+ FOR_BB_BETWEEN (bb, first_bb, last_bb->next_bb, next_bb)
{
- if (INSN_P (insn))
+ int count = VTI (bb)->n_mos;
+ VTI (bb)->mos = XNEWVEC (micro_operation, count);
+ VTI (bb)->n_mos = 0;
+ for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb));
+ insn = NEXT_INSN (insn))
{
- if (!frame_pointer_needed)
+ if (INSN_P (insn))
{
- insn_stack_adjust_offset_pre_post (insn, &pre, &post);
- if (pre)
+ if (!frame_pointer_needed)
{
- micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++;
+ insn_stack_adjust_offset_pre_post (insn, &pre, &post);
+ if (pre)
+ {
+ micro_operation *mo
+ = VTI (bb)->mos + VTI (bb)->n_mos++;
- mo->type = MO_ADJUST;
- mo->u.adjust = pre;
- mo->insn = insn;
+ mo->type = MO_ADJUST;
+ mo->u.adjust = pre;
+ mo->insn = insn;
- if (dump_file && (dump_flags & TDF_DETAILS))
- log_op_type (PATTERN (insn), bb, insn,
- MO_ADJUST, dump_file);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ log_op_type (PATTERN (insn), bb, insn,
+ MO_ADJUST, dump_file);
+ }
}
- }
- cselib_hook_called = false;
- if (MAY_HAVE_DEBUG_INSNS)
- {
- cselib_process_insn (insn);
- if (dump_file && (dump_flags & TDF_DETAILS))
+ cselib_hook_called = false;
+ if (MAY_HAVE_DEBUG_INSNS)
{
- print_rtl_single (dump_file, insn);
- dump_cselib_table (dump_file);
+ cselib_process_insn (insn);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ print_rtl_single (dump_file, insn);
+ dump_cselib_table (dump_file);
+ }
}
- }
- if (!cselib_hook_called)
- add_with_sets (insn, 0, 0);
+ if (!cselib_hook_called)
+ add_with_sets (insn, 0, 0);
- if (!frame_pointer_needed && post)
- {
- micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++;
+ if (!frame_pointer_needed && post)
+ {
+ micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++;
- mo->type = MO_ADJUST;
- mo->u.adjust = post;
- mo->insn = insn;
+ mo->type = MO_ADJUST;
+ mo->u.adjust = post;
+ mo->insn = insn;
- if (dump_file && (dump_flags & TDF_DETAILS))
- log_op_type (PATTERN (insn), bb, insn,
- MO_ADJUST, dump_file);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ log_op_type (PATTERN (insn), bb, insn,
+ MO_ADJUST, dump_file);
+ }
}
}
+ gcc_assert (count == VTI (bb)->n_mos);
}
- gcc_assert (count == VTI (bb)->n_mos);
+
+ bb = last_bb;
+
if (MAY_HAVE_DEBUG_INSNS)
{
cselib_preserve_only_values (true);