gccint: Shrink-wrapping separate components

1 
1 18.9.14 Shrink-wrapping separate components
1 -------------------------------------------
1 
1 The prologue may perform a variety of target dependent tasks such as
1 saving callee-saved registers, saving the return address, aligning the
1 stack, creating a stack frame, initializing the PIC register, setting up
1 the static chain, etc.
1 
1  On some targets some of these tasks may be independent of others and
1 thus may be shrink-wrapped separately.  These independent tasks are
1 referred to as components and are handled generically by the target
1 independent parts of GCC.
1 
1  Using the following hooks those prologue or epilogue components can be
1 shrink-wrapped separately, so that the initialization (and possibly
1 teardown) those components do is not done as frequently on execution
1 paths where this would unnecessary.
1 
1  What exactly those components are is up to the target code; the generic
1 code treats them abstractly, as a bit in an 'sbitmap'.  These 'sbitmap's
1 are allocated by the 'shrink_wrap.get_separate_components' and
1 'shrink_wrap.components_for_bb' hooks, and deallocated by the generic
1 code.
1 
1  -- Target Hook: sbitmap TARGET_SHRINK_WRAP_GET_SEPARATE_COMPONENTS
1           (void)
1      This hook should return an 'sbitmap' with the bits set for those
1      components that can be separately shrink-wrapped in the current
1      function.  Return 'NULL' if the current function should not get any
1      separate shrink-wrapping.  Don't define this hook if it would
1      always return 'NULL'.  If it is defined, the other hooks in this
1      group have to be defined as well.
1 
1  -- Target Hook: sbitmap TARGET_SHRINK_WRAP_COMPONENTS_FOR_BB
1           (basic_block)
1      This hook should return an 'sbitmap' with the bits set for those
1      components where either the prologue component has to be executed
1      before the 'basic_block', or the epilogue component after it, or
1      both.
1 
1  -- Target Hook: void TARGET_SHRINK_WRAP_DISQUALIFY_COMPONENTS (sbitmap
1           COMPONENTS, edge E, sbitmap EDGE_COMPONENTS, bool IS_PROLOGUE)
1      This hook should clear the bits in the COMPONENTS bitmap for those
1      components in EDGE_COMPONENTS that the target cannot handle on edge
1      E, where IS_PROLOGUE says if this is for a prologue or an epilogue
1      instead.
1 
1  -- Target Hook: void TARGET_SHRINK_WRAP_EMIT_PROLOGUE_COMPONENTS
1           (sbitmap)
1      Emit prologue insns for the components indicated by the parameter.
1 
1  -- Target Hook: void TARGET_SHRINK_WRAP_EMIT_EPILOGUE_COMPONENTS
1           (sbitmap)
1      Emit epilogue insns for the components indicated by the parameter.
1 
1  -- Target Hook: void TARGET_SHRINK_WRAP_SET_HANDLED_COMPONENTS
1           (sbitmap)
1      Mark the components in the parameter as handled, so that the
1      'prologue' and 'epilogue' named patterns know to ignore those
1      components.  The target code should not hang on to the 'sbitmap',
1      it will be deleted after this call.
1