On Fri, Sep 11, 2015 at 03:40:53PM +0100, Jiong Wang wrote: > >> A quick check shows > 30% more functions shrink-wrapped during > >> bootstrapping by a the following command: > >> > >> cd $TOP_BUILD ; find . -name "*.pro_and_epilogue" | xargs grep > >> "Perform.*shrink" | wc -l > > > > Wow, that is a lot! But this is mostly the testsuite? Shorter functions > > can be wrapped a whole lot more often. > > They all comes from gcc source code, not from testsuite as my bootstrap > command is "make BOOT_CFLAGS=-O2 -fdump-rtl-pro_and_epilogue". testsuite > itself is not involved in bootstrap. > > And I can confirm I get >30% more functions shrink-wrapped by > > cd $TOP_BUILD/gcc ; grep "Perform.*shrink" *.pro_and_epilogue | wc -l > > This only count shrink-wrap performed on gcc core source code during > final stage in bootstrapping. I also do some quick check, new > shrink-wrap opportunites come from files like dwarf2out.c, emit-rtl.c, > tree.c, tree-into-ssa.c etc, so they are valid.
It turns out for powerpc64-linux this particular "benchmark" shows 7.4% increase as well, much more than average code. Something in GCC code likes shrink-wrapping a lot, maybe all the checking code. > I know shrink-wrap is very sensitive to the RTL instruction sequences, > looks like your re-write make it much more friendly to AArch64 :) Yes indeed. I wonder what it is about AArch64 code gen :-) The old algorithm gave up if any block that would need duplicating could not in fact be duplicated; the new one does not (it places the prologue earlier and tries again). Maybe that explains (some of) it. Segher