aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira-lives.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-05-27 10:06:22 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-05-27 10:06:22 +0000
commit4cc8d9d2df6f618f133f6d5ec1019333a0d942e5 (patch)
tree5d62ebd89439d627b40ecb8026ad31c4827dbfae /gcc/ira-lives.c
parent9921417d94eb2b25ed60b1eafaaf5888164221a4 (diff)
downloadgcc-4cc8d9d2df6f618f133f6d5ec1019333a0d942e5.zip
gcc-4cc8d9d2df6f618f133f6d5ec1019333a0d942e5.tar.gz
gcc-4cc8d9d2df6f618f133f6d5ec1019333a0d942e5.tar.bz2
system.h (TEST_BIT): New macro.
gcc/ * system.h (TEST_BIT): New macro. * recog.h (alternative_mask): New type. (ALL_ALTERNATIVES, ALTERNATIVE_BIT): New macros. (recog_data_d): Replace alternative_enabled_p array with enabled_alternatives. (target_recog): New structure. (default_target_recog, this_target_recog): Declare. (get_enabled_alternatives, recog_init): Likewise. * recog.c (default_target_recog, this_target_recog): New variables. (get_enabled_alternatives): New function. (extract_insn): Use it. (recog_init): New function. (preprocess_constraints, constrain_operands): Adjust for change to recog_data. * postreload.c (reload_cse_simplify_operands): Likewise. * reload.c (find_reloads): Likewise. * ira-costs.c (record_reg_classes): Likewise. * ira-lives.c (single_reg_class): Likewise. Fix bug in which all alternatives after a disabled one would be skipped. (ira_implicitly_set_insn_hard_regs): Likewise. * ira.c (ira_setup_alts): Adjust for change to recog_data. * lra-int.h (lra_insn_recog_data): Replace alternative_enabled_p with enabled_alternatives. * lra.c (free_insn_recog_data): Update accordingly. (lra_update_insn_recog_data): Likewise. (lra_set_insn_recog_data): Likewise. Use get_enabled_alternatives. * lra-constraints.c (process_alt_operands): Likewise. Handle only_alternative as part of the enabled mask. * target-globals.h (this_target_recog): Declare. (target_globals): Add a recog field. (restore_target_globals): Restore this_target_recog. * target-globals.c: Include recog.h. (default_target_globals): Initialize recog field. (save_target_globals): Likewise. * reginfo.c (reinit_regs): Call recog_init. * toplev.c (backend_init_target): Likewise. From-SVN: r210964
Diffstat (limited to 'gcc/ira-lives.c')
-rw-r--r--gcc/ira-lives.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index 906d6db..ffbca389 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -743,22 +743,17 @@ mark_hard_reg_early_clobbers (rtx insn, bool live_p)
static enum reg_class
single_reg_class (const char *constraints, rtx op, rtx equiv_const)
{
- int curr_alt, c;
- bool ignore_p;
+ int c;
enum reg_class cl, next_cl;
cl = NO_REGS;
- for (ignore_p = false, curr_alt = 0;
- (c = *constraints);
- constraints += CONSTRAINT_LEN (c, constraints))
- if (c == '#' || !recog_data.alternative_enabled_p[curr_alt])
- ignore_p = true;
+ alternative_mask enabled = recog_data.enabled_alternatives;
+ for (; (c = *constraints); constraints += CONSTRAINT_LEN (c, constraints))
+ if (c == '#')
+ enabled &= ~ALTERNATIVE_BIT (0);
else if (c == ',')
- {
- curr_alt++;
- ignore_p = false;
- }
- else if (! ignore_p)
+ enabled >>= 1;
+ else if (enabled & 1)
switch (c)
{
case ' ':
@@ -887,8 +882,7 @@ single_reg_operand_class (int op_num)
void
ira_implicitly_set_insn_hard_regs (HARD_REG_SET *set)
{
- int i, curr_alt, c, regno = 0;
- bool ignore_p;
+ int i, c, regno = 0;
enum reg_class cl;
rtx op;
enum machine_mode mode;
@@ -909,17 +903,13 @@ ira_implicitly_set_insn_hard_regs (HARD_REG_SET *set)
mode = (GET_CODE (op) == SCRATCH
? GET_MODE (op) : PSEUDO_REGNO_MODE (regno));
cl = NO_REGS;
- for (ignore_p = false, curr_alt = 0;
- (c = *p);
- p += CONSTRAINT_LEN (c, p))
- if (c == '#' || !recog_data.alternative_enabled_p[curr_alt])
- ignore_p = true;
+ alternative_mask enabled = recog_data.enabled_alternatives;
+ for (; (c = *p); p += CONSTRAINT_LEN (c, p))
+ if (c == '#')
+ enabled &= ~ALTERNATIVE_BIT (0);
else if (c == ',')
- {
- curr_alt++;
- ignore_p = false;
- }
- else if (! ignore_p)
+ enabled >>= 1;
+ else if (enabled & 1)
switch (c)
{
case 'r':