On 9/22/23 06:56, Hongyu Wang wrote:
From: Kong Lingling <lingling.k...@intel.com>

Current reload infrastructure does not support selective base_reg_class
for backend insn. Add new macros with insn parameters to base_reg_class
for lra/reload usage.

gcc/ChangeLog:

        * addresses.h (base_reg_class): Add insn argument and new macro
        INSN_BASE_REG_CLASS.
        (regno_ok_for_base_p_1): Add insn argument and new macro
        REGNO_OK_FOR_INSN_BASE_P.
        (regno_ok_for_base_p): Add insn argument and parse to ok_for_base_p_1.
        * doc/tm.texi: Document INSN_BASE_REG_CLASS and
        REGNO_OK_FOR_INSN_BASE_P.
        * doc/tm.texi.in: Ditto.
        * lra-constraints.cc (process_address_1): Pass insn to
        base_reg_class.
        (curr_insn_transform): Ditto.
        * reload.cc (find_reloads): Ditto.
        (find_reloads_address): Ditto.
        (find_reloads_address_1): Ditto.
        (find_reloads_subreg_address): Ditto.
        * reload1.cc (maybe_fix_stack_asms): Ditto.

The patch is ok for committing to the trunk.  Thank you.

It would be nice to add to the documentation that INSN_BASE_REG_CLASS, INSN_INDEX_REG_CLASS, and REGNO_OK_FOR_INSN_BASE_P if defined have priority over older corresponding macros as it is already documented for REGNO_MODE_CODE_OK_FOR_BASE_P relating to REGNO_OK_FOR_BASE_P. But this small issue can be addressed later.


Reply via email to