diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2014-06-11 16:58:35 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2014-06-11 16:58:35 +0000 |
commit | 777e635f1a6cab5d2c6837b1ea903ed0bcbe87d3 (patch) | |
tree | 923092a0e7d4f3ea66962e54661707bc328d5327 /gcc/ira-costs.c | |
parent | 9e6b7874141cf74a8eb0786d7265296f671feac4 (diff) | |
download | gcc-777e635f1a6cab5d2c6837b1ea903ed0bcbe87d3.tar.gz |
system.h (REG_CLASS_FROM_CONSTRAINT): Poison.
gcc/
* system.h (REG_CLASS_FROM_CONSTRAINT): Poison.
(REG_CLASS_FOR_CONSTRAINT, EXTRA_CONSTRAINT_STR): Likewise.
(EXTRA_MEMORY_CONSTRAINT, EXTRA_ADDRESS_CONSTRAINT): Likewise.
* genpreds.c (print_type_tree): New function.
(write_tm_preds_h): Remove REG_CLASS_FROM_CONSTRAINT,
REG_CLASS_FOR_CONSTRAINT, EXTRA_MEMORY_CONSTRAINT,
EXTRA_ADDRESS_CONSTRAINT and EXTRA_CONSTRAINT_STR.
Write out enum constraint_type and get_constraint_type.
* lra-constraints.c (satisfies_memory_constraint_p): Take a
constraint_num rather than a constraint string.
(satisfies_address_constraint_p): Likewise.
(reg_class_from_constraints): Avoid old constraint macros.
(process_alt_operands, process_address_1): Likewise.
(curr_insn_transform): Likewise.
* ira-costs.c (record_reg_classes): Likewise.
(record_operand_costs): Likewise.
* ira-lives.c (single_reg_class): Likewise.
(ira_implicitly_set_insn_hard_regs): Likewise.
* ira.c (ira_setup_alts, ira_get_dup_out_num): Likewise.
* postreload.c (reload_cse_simplify_operands): Likewise.
* recog.c (asm_operand_ok, preprocess_constraints): Likewise.
(constrain_operands, peep2_find_free_register): Likewise.
* reload.c (push_secondary_reload, scratch_reload_class): Likewise.
(find_reloads, alternative_allows_const_pool_ref): Likewise.
* reload1.c (maybe_fix_stack_asms): Likewise.
* stmt.c (parse_output_constraint, parse_input_constraint): Likewise.
* targhooks.c (default_secondary_reload): Likewise.
* config/m32c/m32c.c (m32c_matches_constraint_p): Avoid reference
to EXTRA_CONSTRAINT_STR.
* config/sparc/constraints.md (U): Likewise REG_CLASS_FROM_CONSTRAINT.
From-SVN: r211471
Diffstat (limited to 'gcc/ira-costs.c')
-rw-r--r-- | gcc/ira-costs.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index 4ecf75f124d..a93985b1855 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -753,25 +753,28 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, break; default: - if (REG_CLASS_FROM_CONSTRAINT (c, p) != NO_REGS) - classes[i] = ira_reg_class_subunion[classes[i]] - [REG_CLASS_FROM_CONSTRAINT (c, p)]; -#ifdef EXTRA_CONSTRAINT_STR - else if (EXTRA_CONSTRAINT_STR (op, c, p)) - win = 1; - - if (EXTRA_MEMORY_CONSTRAINT (c, p)) + enum constraint_num cn = lookup_constraint (p); + enum reg_class cl; + switch (get_constraint_type (cn)) { + case CT_REGISTER: + cl = reg_class_for_constraint (cn); + if (cl != NO_REGS) + classes[i] = ira_reg_class_subunion[classes[i]][cl]; + break; + + case CT_MEMORY: /* Every MEM can be reloaded to fit. */ insn_allows_mem[i] = allows_mem[i] = 1; if (MEM_P (op)) win = 1; - } - if (EXTRA_ADDRESS_CONSTRAINT (c, p)) - { + break; + + case CT_ADDRESS: /* Every address can be reloaded to fit. */ allows_addr = 1; - if (address_operand (op, GET_MODE (op))) + if (address_operand (op, GET_MODE (op)) + || constraint_satisfied_p (op, cn)) win = 1; /* We know this operand is an address, so we want it to be allocated to a hard register @@ -781,8 +784,13 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, = ira_reg_class_subunion[classes[i]] [base_reg_class (VOIDmode, ADDR_SPACE_GENERIC, ADDRESS, SCRATCH)]; + break; + + case CT_FIXED_FORM: + if (constraint_satisfied_p (op, cn)) + win = 1; + break; } -#endif break; } p += CONSTRAINT_LEN (c, p); @@ -1275,8 +1283,8 @@ record_operand_costs (rtx insn, enum reg_class *pref) XEXP (recog_data.operand[i], 0), 0, MEM, SCRATCH, frequency * 2); else if (constraints[i][0] == 'p' - || EXTRA_ADDRESS_CONSTRAINT (constraints[i][0], - constraints[i])) + || (insn_extra_address_constraint + (lookup_constraint (constraints[i])))) record_address_regs (VOIDmode, ADDR_SPACE_GENERIC, recog_data.operand[i], 0, ADDRESS, SCRATCH, frequency * 2); |