rs6000: Separate shrink-wrapping
authorSegher Boessenkool <segher@kernel.crashing.org>
Wed, 12 Oct 2016 15:34:39 +0000 (17:34 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Wed, 12 Oct 2016 15:34:39 +0000 (17:34 +0200)
commit61f41369f1e1c6d8b83d4b644c24aebcc90f522f
tree57e6c0241ef8227a5614c375428a61b6023c3c17
parentaa07dfe7a053e6c7faad05c87306ee6829356eb3
rs6000: Separate shrink-wrapping

This implements the hooks for separate shrink-wrapping for rs6000.
It handles GPRs and LR.  The GPRs get a component number corresponding
to their register number; LR gets component number 0.

* config/rs6000/rs6000.c (machine_function): Add new fields
gpr_is_wrapped_separately and lr_is_wrapped_separately.
(TARGET_SHRINK_WRAP_GET_SEPARATE_COMPONENTS,
TARGET_SHRINK_WRAP_COMPONENTS_FOR_BB,
TARGET_SHRINK_WRAP_DISQUALIFY_COMPONENTS,
TARGET_SHRINK_WRAP_EMIT_PROLOGUE_COMPONENTS,
TARGET_SHRINK_WRAP_EMIT_EPILOGUE_COMPONENTS,
TARGET_SHRINK_WRAP_SET_HANDLED_COMPONENTS): Define.
(rs6000_get_separate_components): New function.
(rs6000_components_for_bb): New function.
(rs6000_disqualify_components): New function.
(rs6000_emit_prologue_components): New function.
(rs6000_emit_epilogue_components): New function.
(rs6000_set_handled_components): New function.
(rs6000_emit_prologue): Don't emit LR save if lr_is_wrapped_separately.
Don't emit GPR saves if gpr_is_wrapped_separately for that register.
(restore_saved_lr): Don't restore LR if lr_is_wrapped_separately.
(rs6000_emit_epilogue): Don't emit GPR restores if
gpr_is_wrapped_separately for that register.  Don't make a
REG_CFA_RESTORE note for registers we did not restore, either.

From-SVN: r241065
gcc/ChangeLog
gcc/config/rs6000/rs6000.c