Commit 32e9fa48 by Kaveh R. Ghazi Committed by Kaveh Ghazi

bt-load.c (add_btr_def, [...]): Avoid C++ keywords.

	* bt-load.c (add_btr_def, migrate_btr_def,
	branch_target_load_optimize): Avoid C++ keywords.
	* caller-save.c (insert_restore, insert_save, insert_one_insn):
	Likewise.
	* combine.c (subst, simplify_set, make_extraction,
	make_compound_operation, known_cond, simplify_shift_const_1):
	Likewise.
	* cse.c (make_regs_eqv, merge_equiv_classes, validate_canon_reg,
	fold_rtx, equiv_constant, cse_insn, cse_process_notes_1):
	Likewise.

From-SVN: r137847
parent ac7ee6ad
2008-07-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* bt-load.c (add_btr_def, migrate_btr_def,
branch_target_load_optimize): Avoid C++ keywords.
* caller-save.c (insert_restore, insert_save, insert_one_insn):
Likewise.
* combine.c (subst, simplify_set, make_extraction,
make_compound_operation, known_cond, simplify_shift_const_1):
Likewise.
* cse.c (make_regs_eqv, merge_equiv_classes, validate_canon_reg,
fold_rtx, equiv_constant, cse_insn, cse_process_notes_1):
Likewise.
2008-07-15 Richard Guenther <rguenther@suse.de>
PR middle-end/36369
......
......@@ -301,31 +301,30 @@ add_btr_def (fibheap_t all_btr_defs, basic_block bb, int insn_luid, rtx insn,
unsigned int dest_reg, int other_btr_uses_before_def,
btr_def_group *all_btr_def_groups)
{
btr_def this
= XOBNEW (&migrate_btrl_obstack, struct btr_def_s);
this->bb = bb;
this->luid = insn_luid;
this->insn = insn;
this->btr = dest_reg;
this->cost = basic_block_freq (bb);
this->has_ambiguous_use = 0;
this->other_btr_uses_before_def = other_btr_uses_before_def;
this->other_btr_uses_after_use = 0;
this->next_this_bb = NULL;
this->next_this_group = NULL;
this->uses = NULL;
this->live_range = NULL;
find_btr_def_group (all_btr_def_groups, this);
fibheap_insert (all_btr_defs, -this->cost, this);
btr_def this_def = XOBNEW (&migrate_btrl_obstack, struct btr_def_s);
this_def->bb = bb;
this_def->luid = insn_luid;
this_def->insn = insn;
this_def->btr = dest_reg;
this_def->cost = basic_block_freq (bb);
this_def->has_ambiguous_use = 0;
this_def->other_btr_uses_before_def = other_btr_uses_before_def;
this_def->other_btr_uses_after_use = 0;
this_def->next_this_bb = NULL;
this_def->next_this_group = NULL;
this_def->uses = NULL;
this_def->live_range = NULL;
find_btr_def_group (all_btr_def_groups, this_def);
fibheap_insert (all_btr_defs, -this_def->cost, this_def);
if (dump_file)
fprintf (dump_file,
"Found target reg definition: sets %u { bb %d, insn %d }%s priority %d\n",
dest_reg, bb->index, INSN_UID (insn), (this->group ? "" : ":not const"),
this->cost);
dest_reg, bb->index, INSN_UID (insn),
(this_def->group ? "" : ":not const"), this_def->cost);
return this;
return this_def;
}
/* Create a new target register user structure, for a use in block BB,
......@@ -1274,7 +1273,7 @@ migrate_btr_def (btr_def def, int min_cost)
HARD_REG_SET btrs_live_in_range;
int btr_used_near_def = 0;
int def_basic_block_freq;
basic_block try;
basic_block attempt;
int give_up = 0;
int def_moved = 0;
btr_user user;
......@@ -1328,31 +1327,31 @@ migrate_btr_def (btr_def def, int min_cost)
def_basic_block_freq = basic_block_freq (def->bb);
for (try = get_immediate_dominator (CDI_DOMINATORS, def->bb);
!give_up && try && try != ENTRY_BLOCK_PTR && def->cost >= min_cost;
try = get_immediate_dominator (CDI_DOMINATORS, try))
for (attempt = get_immediate_dominator (CDI_DOMINATORS, def->bb);
!give_up && attempt && attempt != ENTRY_BLOCK_PTR && def->cost >= min_cost;
attempt = get_immediate_dominator (CDI_DOMINATORS, attempt))
{
/* Try to move the instruction that sets the target register into
basic block TRY. */
int try_freq = basic_block_freq (try);
basic block ATTEMPT. */
int try_freq = basic_block_freq (attempt);
edge_iterator ei;
edge e;
/* If TRY has abnormal edges, skip it. */
FOR_EACH_EDGE (e, ei, try->succs)
/* If ATTEMPT has abnormal edges, skip it. */
FOR_EACH_EDGE (e, ei, attempt->succs)
if (e->flags & EDGE_COMPLEX)
break;
if (e)
continue;
if (dump_file)
fprintf (dump_file, "trying block %d ...", try->index);
fprintf (dump_file, "trying block %d ...", attempt->index);
if (try_freq < def_basic_block_freq
|| (try_freq == def_basic_block_freq && btr_used_near_def))
{
int btr;
augment_live_range (live_range, &btrs_live_in_range, def->bb, try,
augment_live_range (live_range, &btrs_live_in_range, def->bb, attempt,
flag_btr_bb_exclusive);
if (dump_file)
{
......@@ -1363,7 +1362,7 @@ migrate_btr_def (btr_def def, int min_cost)
btr = choose_btr (btrs_live_in_range);
if (btr != -1)
{
move_btr_def (try, btr, def, live_range, &btrs_live_in_range);
move_btr_def (attempt, btr, def, live_range, &btrs_live_in_range);
bitmap_copy(live_range, def->live_range);
btr_used_near_def = 0;
def_moved = 1;
......@@ -1459,8 +1458,8 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save)
static void
branch_target_load_optimize (bool after_prologue_epilogue_gen)
{
enum reg_class class = targetm.branch_target_register_class ();
if (class != NO_REGS)
enum reg_class klass = targetm.branch_target_register_class ();
if (klass != NO_REGS)
{
/* Initialize issue_rate. */
if (targetm.sched.issue_rate)
......@@ -1482,7 +1481,7 @@ branch_target_load_optimize (bool after_prologue_epilogue_gen)
/* Dominator info is also needed for migrate_btr_def. */
calculate_dominance_info (CDI_DOMINATORS);
migrate_btr_defs (class,
migrate_btr_defs (klass,
(targetm.branch_target_register_callee_saved
(after_prologue_epilogue_gen)));
......
......@@ -660,7 +660,7 @@ insert_restore (struct insn_chain *chain, int before_p, int regno,
rtx pat = NULL_RTX;
int code;
unsigned int numregs = 0;
struct insn_chain *new;
struct insn_chain *new_chain;
rtx mem;
/* A common failure mode if register status is not correct in the
......@@ -713,13 +713,13 @@ insert_restore (struct insn_chain *chain, int before_p, int regno,
gen_rtx_REG (GET_MODE (mem),
regno), mem);
code = reg_restore_code (regno, GET_MODE (mem));
new = insert_one_insn (chain, before_p, code, pat);
new_chain = insert_one_insn (chain, before_p, code, pat);
/* Clear status for all registers we restored. */
for (k = 0; k < i; k++)
{
CLEAR_HARD_REG_BIT (hard_regs_saved, regno + k);
SET_REGNO_REG_SET (&new->dead_or_set, regno + k);
SET_REGNO_REG_SET (&new_chain->dead_or_set, regno + k);
n_regs_saved--;
}
......@@ -738,7 +738,7 @@ insert_save (struct insn_chain *chain, int before_p, int regno,
rtx pat = NULL_RTX;
int code;
unsigned int numregs = 0;
struct insn_chain *new;
struct insn_chain *new_chain;
rtx mem;
/* A common failure mode if register status is not correct in the
......@@ -790,13 +790,13 @@ insert_save (struct insn_chain *chain, int before_p, int regno,
gen_rtx_REG (GET_MODE (mem),
regno));
code = reg_save_code (regno, GET_MODE (mem));
new = insert_one_insn (chain, before_p, code, pat);
new_chain = insert_one_insn (chain, before_p, code, pat);
/* Set hard_regs_saved and dead_or_set for all the registers we saved. */
for (k = 0; k < numregs; k++)
{
SET_HARD_REG_BIT (hard_regs_saved, regno + k);
SET_REGNO_REG_SET (&new->dead_or_set, regno + k);
SET_REGNO_REG_SET (&new_chain->dead_or_set, regno + k);
n_regs_saved++;
}
......@@ -809,7 +809,7 @@ static struct insn_chain *
insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
{
rtx insn = chain->insn;
struct insn_chain *new;
struct insn_chain *new_chain;
#ifdef HAVE_cc0
/* If INSN references CC0, put our insns in front of the insn that sets
......@@ -824,23 +824,23 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
chain = chain->prev, insn = chain->insn;
#endif
new = new_insn_chain ();
new_chain = new_insn_chain ();
if (before_p)
{
rtx link;
new->prev = chain->prev;
if (new->prev != 0)
new->prev->next = new;
new_chain->prev = chain->prev;
if (new_chain->prev != 0)
new_chain->prev->next = new_chain;
else
reload_insn_chain = new;
reload_insn_chain = new_chain;
chain->prev = new;
new->next = chain;
new->insn = emit_insn_before (pat, insn);
chain->prev = new_chain;
new_chain->next = chain;
new_chain->insn = emit_insn_before (pat, insn);
/* ??? It would be nice if we could exclude the already / still saved
registers from the live sets. */
COPY_REG_SET (&new->live_throughout, &chain->live_throughout);
COPY_REG_SET (&new_chain->live_throughout, &chain->live_throughout);
/* Registers that die in CHAIN->INSN still live in the new insn. */
for (link = REG_NOTES (chain->insn); link; link = XEXP (link, 1))
{
......@@ -857,7 +857,7 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
continue;
for (i = hard_regno_nregs[regno][GET_MODE (reg)] - 1;
i >= 0; i--)
SET_REGNO_REG_SET (&new->live_throughout, regno + i);
SET_REGNO_REG_SET (&new_chain->live_throughout, regno + i);
}
}
......@@ -885,41 +885,41 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
for (i = hard_regno_nregs[regno][GET_MODE (reg)] - 1;
i >= 0; i--)
SET_REGNO_REG_SET (&new->live_throughout, regno + i);
SET_REGNO_REG_SET (&new_chain->live_throughout, regno + i);
}
}
}
}
CLEAR_REG_SET (&new->dead_or_set);
CLEAR_REG_SET (&new_chain->dead_or_set);
if (chain->insn == BB_HEAD (BASIC_BLOCK (chain->block)))
BB_HEAD (BASIC_BLOCK (chain->block)) = new->insn;
BB_HEAD (BASIC_BLOCK (chain->block)) = new_chain->insn;
}
else
{
new->next = chain->next;
if (new->next != 0)
new->next->prev = new;
chain->next = new;
new->prev = chain;
new->insn = emit_insn_after (pat, insn);
new_chain->next = chain->next;
if (new_chain->next != 0)
new_chain->next->prev = new_chain;
chain->next = new_chain;
new_chain->prev = chain;
new_chain->insn = emit_insn_after (pat, insn);
/* ??? It would be nice if we could exclude the already / still saved
registers from the live sets, and observe REG_UNUSED notes. */
COPY_REG_SET (&new->live_throughout, &chain->live_throughout);
COPY_REG_SET (&new_chain->live_throughout, &chain->live_throughout);
/* Registers that are set in CHAIN->INSN live in the new insn.
(Unless there is a REG_UNUSED note for them, but we don't
look for them here.) */
note_stores (PATTERN (chain->insn), add_stored_regs,
&new->live_throughout);
CLEAR_REG_SET (&new->dead_or_set);
&new_chain->live_throughout);
CLEAR_REG_SET (&new_chain->dead_or_set);
if (chain->insn == BB_END (BASIC_BLOCK (chain->block)))
BB_END (BASIC_BLOCK (chain->block)) = new->insn;
BB_END (BASIC_BLOCK (chain->block)) = new_chain->insn;
}
new->block = chain->block;
new->is_caller_save_insn = 1;
new_chain->block = chain->block;
new_chain->is_caller_save_insn = 1;
INSN_CODE (new->insn) = code;
return new;
INSN_CODE (new_chain->insn) = code;
return new_chain;
}
#include "gt-caller-save.h"
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