alpha.c (alpha_tablejump_addr_vec): New.

* config/alpha/alpha.c (alpha_tablejump_addr_vec): New.
        (alpha_tablejump_best_label): New.
        * config/alpha/alpha-protos.h: Declare them.
        * config/alpha/alpha.md: Use braced strings for code blocks.
        (tablejump_osf): Break out add with r29.
        (tablejump_osf_internal): Remove.
        (tablejump_osf_nt_internal): Rename from tablejump_nt_internal,
        use alpha_tablejump_addr_vec and alpha_tablejump_best_label.

From-SVN: r44022
This commit is contained in:
Richard Henderson 2001-07-15 08:38:52 -07:00 committed by Richard Henderson
parent 09b495e503
commit 25e21aed56
4 changed files with 239 additions and 331 deletions

View File

@ -1,3 +1,14 @@
2001-07-15 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c (alpha_tablejump_addr_vec): New.
(alpha_tablejump_best_label): New.
* config/alpha/alpha-protos.h: Declare them.
* config/alpha/alpha.md: Use braced strings for code blocks.
(tablejump_osf): Break out add with r29.
(tablejump_osf_internal): Remove.
(tablejump_osf_nt_internal): Rename from tablejump_nt_internal,
use alpha_tablejump_addr_vec and alpha_tablejump_best_label.
Sun Jul 15 00:53:35 CEST 2001 Jan Hubicka <jh@suse.cz>
* loop.c (scan_loop): Add USEs inside PARALLELs into dependencies

View File

@ -70,6 +70,8 @@ extern int normal_memory_operand PARAMS ((rtx, enum machine_mode));
extern int reg_no_subreg_operand PARAMS ((rtx, enum machine_mode));
extern int addition_operation PARAMS ((rtx, enum machine_mode));
extern rtx alpha_tablejump_addr_vec PARAMS ((rtx));
extern rtx alpha_tablejump_best_label PARAMS ((rtx));
extern void get_aligned_mem PARAMS ((rtx, rtx *, rtx *));
extern rtx get_unaligned_address PARAMS ((rtx, int));
extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,

View File

@ -1074,6 +1074,61 @@ direct_return ()
&& current_function_outgoing_args_size == 0
&& current_function_pretend_args_size == 0);
}
/* Return the ADDR_VEC associated with a tablejump insn. */
rtx
alpha_tablejump_addr_vec (insn)
rtx insn;
{
rtx tmp;
tmp = JUMP_LABEL (insn);
if (!tmp)
return NULL_RTX;
tmp = NEXT_INSN (tmp);
if (!tmp)
return NULL_RTX;
if (GET_CODE (tmp) == JUMP_INSN
&& GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC)
return PATTERN (tmp);
return NULL_RTX;
}
/* Return the label of the predicted edge, or CONST0_RTX if we don't know. */
rtx
alpha_tablejump_best_label (insn)
rtx insn;
{
rtx jump_table = alpha_tablejump_addr_vec (insn);
rtx best_label = NULL_RTX;
/* ??? Once the CFG doesn't keep getting completely rebuilt, look
there for edge frequency counts from profile data. */
if (jump_table)
{
int n_labels = XVECLEN (jump_table, 1);
int best_count = -1;
int i, j;
for (i = 0; i < n_labels; i++)
{
int count = 1;
for (j = i + 1; j < n_labels; j++)
if (XEXP (XVECEXP (jump_table, 1, i), 0)
== XEXP (XVECEXP (jump_table, 1, j), 0))
count++;
if (count > best_count)
best_count = count, best_label = XVECEXP (jump_table, 1, i);
}
}
return best_label ? best_label : const0_rtx;
}
/* REF is an alignable memory location. Place an aligned SImode
reference into *PALIGNED_MEM and the number of bits to shift into

File diff suppressed because it is too large Load Diff