From 02f2dc441b1954736cc61e3f97687cd23d5586c5 Mon Sep 17 00:00:00 2001 From: "Vladimir N. Makarov" Date: Mon, 22 Mar 2021 13:34:50 -0400 Subject: [PR99581] Define relaxed memory and use it for aarch64 aarch64 needs to skip memory address validation for LD1R insns. Skipping the address validation may result in LRA crash for some targets when usual memory constraint is used. This patch introduces define_relaxed_memory_constraint, skipping address validation for it, and defining relaxed memory for aarch64 LD1r insn memory operand. gcc/ChangeLog: PR target/99581 * config/aarch64/constraints.md (UtQ): Use define_relaxed_memory_constraint for it. * doc/md.texi (define_relaxed_memory_constraint): Describe it. * genoutput.c (main): Process DEFINE_RELAXED_MEMORY_CONSTRAINT. * genpreds.c (constraint_data): Add bitfield is_relaxed_memory. (have_relaxed_memory_constraints): New static var. (relaxed_memory_start, relaxed_memory_end): Ditto. (add_constraint): Add arg is_relaxed_memory. Check name for relaxed memory. Set up is_relaxed_memory in constraint_data and have_relaxed_memory_constraints. Adjust calls. (choose_enum_order): Process relaxed memory. (write_tm_preds_h): Ditto. (main): Process DEFINE_RELAXED_MEMORY_CONSTRAINT. * gensupport.c (process_rtx): Process DEFINE_RELAXED_MEMORY_CONSTRAINT. * ira-costs.c (record_reg_classes): Process CT_RELAXED_MEMORY. * ira-lives.c (single_reg_class): Use insn_extra_relaxed_memory_constraint. * ira.c (ira_setup_alts): CT_RELAXED_MEMORY. * lra-constraints.c (valid_address_p): Use insn_extra_relaxed_memory_constraint instead of other memory constraints. (process_alt_operands): Process CT_RELAXED_MEMORY. (curr_insn_transform): Use insn_extra_relaxed_memory_constraint. * recog.c (asm_operand_ok, preprocess_constraints): Process CT_RELAXED_MEMORY. * reload.c (find_reloads): Ditto. * rtl.def (DEFINE_RELAXED_MEMORY_CONSTRAINT): New. * stmt.c (parse_input_constraint): Use insn_extra_relaxed_memory_constraint. gcc/testsuite/ChangeLog: PR target/99581 * gcc.target/powerpc/pr99581.c: New. --- gcc/lra-constraints.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/lra-constraints.c') diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index fdfe953..861b5aa 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -410,8 +410,7 @@ valid_address_p (rtx op, struct address_info *ad, Need to extract memory from op for special memory constraint, i.e. bcst_mem_operand in i386 backend. */ if (MEM_P (extract_mem_from_operand (op)) - && (insn_extra_memory_constraint (constraint) - || insn_extra_special_memory_constraint (constraint)) + && insn_extra_relaxed_memory_constraint (constraint) && constraint_satisfied_p (op, constraint)) return true; @@ -2460,6 +2459,7 @@ process_alt_operands (int only_alternative) break; case CT_SPECIAL_MEMORY: + case CT_RELAXED_MEMORY: if (satisfies_memory_constraint_p (op, cn)) win = true; else if (spilled_pseudo_p (op)) @@ -4370,7 +4370,8 @@ curr_insn_transform (bool check_only_p) { enum constraint_num cn = lookup_constraint (constraint); if ((insn_extra_memory_constraint (cn) - || insn_extra_special_memory_constraint (cn)) + || insn_extra_special_memory_constraint (cn) + || insn_extra_relaxed_memory_constraint (cn)) && satisfies_memory_constraint_p (tem, cn)) break; } -- cgit v1.1