This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/9] separate shrink-wrap: New command-line flag, status flag, hooks, and doc


On 08/29/2016 03:31 AM, Bernd Schmidt wrote:
On 08/01/2016 03:42 AM, Segher Boessenkool wrote:
+@deftypefn {Target Hook} void
TARGET_SHRINK_WRAP_EMIT_PROLOGUE_COMPONENTS (sbitmap)
+Emit prologue insns for the components indicated by the parameter.
+@end deftypefn
+
+@deftypefn {Target Hook} void
TARGET_SHRINK_WRAP_EMIT_EPILOGUE_COMPONENTS (sbitmap)
+Emit epilogue insns for the components indicated by the parameter.
+@end deftypefn

How do these actually know where to save/restore registers? The frame
pointer may have been eliminated, and SP isn't necessarily constant
during the function. Seems like you'd have to calculate CFA reg/offset
much like dwarf2out does and pass it to this hook.
So I think the confusion here is these hooks are independent of placement. ie, the target independent code does something like:

FOR_EACH_BB
  Build the component bitmap using the incoming edge components
  Emit the prologue components at the start of the block
  Emit the epilogue components at the end of the block


The components handled by a particular block start are set/cleared by the other hooks.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]