[ARC] Cleanup, fix and set LRA default

Programming / Compilers / GCC - claziss [138bc75d-0d04-0410-961f-82ee72b054a4] - 14 November 2018 09:45 EST

LP_COUNT register cannot be freely allocated by the compiler as it size, and/or content may change depending on the ARC hardware configuration. Thus, make this register fixed.

Remove register classes and unused constraint letters.

Cleanup the implementation of conditional_register_usage hook by using macros instead of magic constants and removing all references to reg_class_contents which are bringing so much grief when lra is enabled.

gcc/ xxxx-xx-xx Claudiu Zissulescu

- config/arc/arc.h (reg_class): Reorder registers classes, remove unused register classes. (REG_CLASS_NAMES): Likewise. (REG_CLASS_CONTENTS): Likewise. (FIXED_REGISTERS): Make lp_count fixed. (BASE_REG_CLASS): Remove ACC16_BASE_REGS reference. (PROGRAM_COUNTER_REGNO): Remove.
- config/arc/arc.c (arc_conditional_register_usage): Remove unused register classes, use constants for register numbers, remove reg_class_contents references. (arc_process_double_reg_moves): Add asserts. (arc_secondary_reload): Remove LPCOUNT_REG reference, use lra_in_progress predicate. (arc_init_reg_tables): Remove unused register classes. (arc_register_move_cost): Likewise. (arc_preferred_reload_class): Likewise. (hwloop_optimize): Update rtx patterns involving lp_count register. (arc_return_address_register): Rename ILINK1, INLINK2 regnums macros.
- config/arc/constraints.md ("c"): Choose between GENERAL_REGS and CHEAP_CORE_REGS. Former one will be used for LRA. ("Rac"): Choose between GENERAL_REGS and ALL_CORE_REGS. Former one will be used for LRA. ("w"): Choose between GENERAL_REGS and WRITABLE_CORE_REGS. Former one will be used for LRA. ("W"): Choose between GENERAL_REGS and MPY_WRITABLE_CORE_REGS. Former one will be used for LRA. ("f"): Delete constraint. ("k"): Likewise. ("e"): Likewise. ("l"): Change it from register constraint to constraint.
- config/arc/arc.md (movqi_insn): Remove unsed lp_count constraints. (movhi_insn): Likewise. (movsi_insn): Update pattern. (arc_lp): Likewise. (dbnz): Likewise. (stack_tie): Remove 'b' constraint letter. (R4_REG): Define. (R9_REG, R15_REG, R16_REG, R25_REG): Likewise. (R32_REG, R40_REG, R41_REG, R42_REG, R43_REG, R44_REG): Likewise. (R57_REG, R59_REG, PCL_REG): Likewise. (ILINK1_REGNUM): Renamed to ILINK1_REG. (ILINK2_REGNUM): Renamed to ILINK2_REG. (Rgp): Remove. (SP_REGS): Likewise. (Rcw): Remove unused reg classes.
- config/arc/predicates.md (dest_reg_operand): Just default on register_operand predicate. (mpy_dest_reg_operand): Likewise. (move_dest_operand): Use macros instead of constants.

8cb63fa629d [ARC] Cleanup, fix and set LRA default.
gcc/ChangeLog | 55 +++++++
gcc/config/arc/arc.c | 329 ++++++++++++++++--------------------------
gcc/config/arc/arc.h | 105 +++++---------
gcc/config/arc/arc.md | 57 +++++---
gcc/config/arc/arc.opt | 7 +-
gcc/config/arc/constraints.md | 47 ++----
gcc/config/arc/predicates.md | 28 +---
7 files changed, 277 insertions(+), 351 deletions(-)

Upstream: gcc.gnu.org


  • Share