This is the mail archive of the 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 8/9] shrink-wrap: shrink-wrapping for separate concerns

On 07/19/2016 05:35 PM, Segher Boessenkool wrote:
On Tue, Jul 19, 2016 at 04:49:26PM +0200, Bernd Schmidt wrote:
But you need the profile to make even reasonably good decisions.

I'm not worried about making cost decisions: as far as I'm concerned
it's perfectly fine for that. I'm worried about correctness - you can't
validly save registers inside a loop.

Of course you can.  It needs to be paired with a restore; and we do
that just fine.
> Pretty much *all* implementations in the literature do this, fwiw.

I, however, fail to see where this happens. If you have references to somewhere where this algorithm is described, that would be helpful, because at this stage I think I really don't understand what you're trying to achieve. The submission lacks examples.

So I could see things could work if you place an epilogue part in the last block of a loop if the start of the loop contains a corresponding part of the prologue, but taking just the comment in the code:
   Prologue concerns are placed in such a way that they are executed as
   infrequently as possible.  Epilogue concerns are put everywhere where
   there is an edge from a bb dominated by such a prologue concern to a
   bb not dominated by one.

this describes no mechanism by which such a thing would happen. And I fail to see how moving parts of the prologue into a loop would be beneficial as an optimization.


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