aboutsummaryrefslogtreecommitdiff
path: root/gcc/addresses.h
diff options
context:
space:
mode:
authorHongyu Wang <hongyu.wang@intel.com>2023-07-14 16:33:32 +0800
committerHongyu Wang <hongyu.wang@intel.com>2023-10-07 16:34:29 +0800
commitdfa15b4946d1d2678e0a3135c94173a103979f7d (patch)
tree5992e4b776d48d92549dac78cf06d2b010a3c8db /gcc/addresses.h
parentbc4466b94e91f4d2a051a9beba45187e7c23615c (diff)
[APX EGPR] middle-end: Add index_reg_class with insn argument.
Like base_reg_class, INDEX_REG_CLASS also does not support backend insn. Add index_reg_class with insn argument for lra/reload usage. gcc/ChangeLog: * addresses.h (index_reg_class): New wrapper function like base_reg_class. * doc/tm.texi: Document INSN_INDEX_REG_CLASS. * doc/tm.texi.in: Ditto. * lra-constraints.cc (index_part_to_reg): Pass index_class. (process_address_1): Calls index_reg_class with curr_insn and replace INDEX_REG_CLASS with its return value index_cl. * reload.cc (find_reloads_address): Likewise. (find_reloads_address_1): Likewise. Co-authored-by: Kong Lingling <lingling.kong@intel.com> Co-authored-by: Hongtao Liu <hongtao.liu@intel.com>
Diffstat (limited to 'gcc/addresses.h')
-rw-r--r--gcc/addresses.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/addresses.h b/gcc/addresses.h
index 2c92927bd51..08bf39cd56c 100644
--- a/gcc/addresses.h
+++ b/gcc/addresses.h
@@ -51,6 +51,16 @@ base_reg_class (machine_mode mode ATTRIBUTE_UNUSED,
#endif
}
+inline enum reg_class
+index_reg_class (rtx_insn *insn ATTRIBUTE_UNUSED = NULL)
+{
+#ifdef INSN_INDEX_REG_CLASS
+ return INSN_INDEX_REG_CLASS (insn);
+#else
+ return INDEX_REG_CLASS;
+#endif
+}
+
/* Wrapper function to unify target macros REGNO_MODE_CODE_OK_FOR_BASE_P,
REGNO_MODE_OK_FOR_REG_BASE_P, REGNO_MODE_OK_FOR_BASE_P and
REGNO_OK_FOR_BASE_P.