On Thu, Dec 03, 2015 at 12:35:51PM +0100, Bernd Schmidt wrote: > On 12/02/2015 07:21 PM, Segher Boessenkool wrote: > >After shrink-wrapping has found the "tightest fit" for where to place > >the prologue, it tries move it earlier (so that frame saves are run > >earlier) -- but without copying any more basic blocks. > > Another question would be - is there really a good reason to do this at all?
I haven't actually benchmarked it to see if it in fact matters for performance. The original code did something similar, but perhaps not for the same reasons. The goal is to put the prologue as early as possible while only putting it on paths that need it (the code before here puts it as *late* as possible instead). Moving the prologue earlier gives more free registers (the ones it saved) in the blocks "skipped", so that late passes have more to work with. More importantly, moving the prologue and the epilogue further apart avoids some execution hazards. Segher