On Tue, May 03, 2016 at 02:53:42PM +0200, Bernd Schmidt wrote: > >This series teaches cfgcleanup how to optimize jumps and branches to and > >around return statements, after which the shrink-wrap code doesn't have > >to deal with it anymore. The simplified code also catches a few more > >cases. > > > >Tested on powerpc64-linux (-m32 and -m64, all languages), and also on > >x86_64-linux (actually, still in progress with the most recent version > >of the patchset). Is this okay for trunk? > > Looking at the outputs I see a number of jump to return replaced with > plain return, which seems like an improvement.
Yeah; not very many though. > There are random changes > in .p2align output: > > @@ -207,7 +207,7 @@ > jbe .L20 > movl $-1, %eax > cmpl $4, %r8d > - ja .L31 > + ja .L28 > pushq %r15 > .cfi_def_cfa_offset 16 > .cfi_offset 15, -16 > @@ -288,8 +288,6 @@ > .cfi_offset 14, -24 > .cfi_offset 15, -16 > movl $-1, %eax > - .p2align 4,,10 > - .p2align 3 > .L18: > addq $8, %rsp > .cfi_def_cfa_offset 56 > @@ -311,7 +309,10 @@ > popq %r15 > .cfi_restore 15 > .cfi_def_cfa_offset 8 > -.L31: > + ret > + .p2align 4,,10 > + .p2align 3 > +.L28: > rep ret > .cfi_endproc > .LFE1257: > > Do you have an explanation as to why this happens? (Testcase: basically > any large file.) I have no explanation for this. I'll investigate. > Does ppc have conditional returns? Yes it does. "beqlr", etc. They are generated fine. > If not, are you set up to test arm in > any way? Ideally you'd want to run that as well. Good plan. There is arm64 in the cfarm; I'll see if I can build 32-bit as well. > I think all three patches look ok, except all your fprintf calls are > misindented. In patch 2, bah I thought I fixed that. I want to factor that huge function anyway, reduce the indent a lot, okay to fix it then? :-) Segher