diff mbox

New rematerialization sub-pass in LRA

Message ID 1413317838.5926.25.camel@otta
State New
Headers show

Commit Message

Peter Bergner Oct. 14, 2014, 8:17 p.m. UTC
On Fri, 2014-10-10 at 11:02 -0400, Vladimir Makarov wrote:
> Here is a new rematerialization sub-pass of LRA.

When Mike and I build with this patch along with the patch that
enables LRA by default on powerpc64*-linux (attached below), we're
seeing the following error message.  I'm not sure how your patch
can cause this error, but it does go away if we remove your patch
and build again.

Peter


# Enable LRA by default


Error message caused by LRA Rematerialization patch:

make[5]: Entering directory
`/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include'
mkdir -p ./powerpc64-linux/bits/stdc++.h.gch
/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/./gcc/xgcc
-shared-libgcc
-B/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/./gcc -nostdinc++
-L/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/src -L/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/src/.libs -L/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/libsupc++/.libs -B/home/bergner/gcc/install/gcc-fsf-mainline-lra-remat/powerpc64-linux/bin/ -B/home/bergner/gcc/install/gcc-fsf-mainline-lra-remat/powerpc64-linux/lib/ -isystem /home/bergner/gcc/install/gcc-fsf-mainline-lra-remat/powerpc64-linux/include -isystem /home/bergner/gcc/install/gcc-fsf-mainline-lra-remat/powerpc64-linux/sys-include    -x c++-header -nostdinc++ -g -O2 -D_GNU_SOURCE  -I/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/powerpc64-linux -I/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include -I/home/bergner/gcc/gcc-fsf-mainline-bootstrap/libstdc++-v3/libsupc++ -O2 -g -std=gnu++0x /home/bergner/gcc/gcc-fsf-mainline-bootstrap/libstdc++-v3/include/precompiled/stdc++.h \
	-o powerpc64-linux/bits/stdc++.h.gch/O2ggnu++0x.gch
In file included
from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/bits/move.h:57:0,

from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/bits/stl_pair.h:59,

from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/bits/stl_algobase.h:64,

from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/bits/char_traits.h:39,

from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/ios:40,

from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/istream:38,

from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/sstream:38,

from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/complex:45,

from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/ccomplex:38,

from /home/bergner/gcc/gcc-fsf-mainline-bootstrap/libstdc
++-v3/include/precompiled/stdc++.h:52:
/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/type_traits:251:12: error: redefinition of ‘struct std::__is_integral_helper<unsigned int>’
     struct __is_integral_helper<unsigned __int128>
            ^
/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/type_traits:226:12: error: previous definition of ‘struct std::__is_integral_helper<unsigned int>’
     struct __is_integral_helper<unsigned int>
            ^
/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/type_traits:1763:12: error: redefinition of ‘struct std::__make_signed<unsigned int>’
     struct __make_signed<unsigned __int128>
            ^
/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/type_traits:1735:12: error: previous definition of ‘struct std::__make_signed<unsigned int>’
     struct __make_signed<unsigned int>
            ^
In file included
from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/random:42:0,

from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/bits/stl_algo.h:66,

from /home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/algorithm:62,

from /home/bergner/gcc/gcc-fsf-mainline-bootstrap/libstdc
++-v3/include/precompiled/stdc++.h:64:
/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/limits:1479:12: error: redefinition of ‘struct std::numeric_limits<unsigned int>’
     struct numeric_limits<unsigned __int128>
            ^
/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include/limits:1049:12: error: previous definition of ‘struct std::numeric_limits<unsigned int>’
     struct numeric_limits<unsigned int>
            ^
make[5]: *** [powerpc64-linux/bits/stdc++.h.gch/O2ggnu++0x.gch] Error 1
make[5]: Leaving directory
`/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3/include'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory
`/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3'
make[3]: *** [all] Error 2
make[3]: Leaving directory
`/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat/powerpc64-linux/libstdc++-v3'
make[2]: *** [all-stage2-target-libstdc++-v3] Error 2
make[2]: Leaving directory
`/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory
`/home/bergner/gcc/build/gcc-fsf-mainline-lra-remat'
make: *** [all] Error 2

Comments

Vladimir Makarov Oct. 14, 2014, 11:28 p.m. UTC | #1
On 2014-10-14 4:17 PM, Peter Bergner wrote:
> On Fri, 2014-10-10 at 11:02 -0400, Vladimir Makarov wrote:
>> Here is a new rematerialization sub-pass of LRA.
>
> When Mike and I build with this patch along with the patch that
> enables LRA by default on powerpc64*-linux (attached below), we're
> seeing the following error message.  I'm not sure how your patch
> can cause this error, but it does go away if we remove your patch
> and build again.

Peter, thanks for checking the patch and reporting this.  I had several 
wrong code generation problems with rematerialization on x86 and arm. 
I've solved them before posting the patch but I did not check ppc64.

As a lot of people started to try the patch, several problems were 
reported.  I'll address them and do some patch modifications.  Now I 
think that I'll commit the patch into the trunk not earlier the next 
week.  And I'll check with ppc64 too to be sure that we have no wrong 
code generation problems on this target too.
Michael Meissner Oct. 15, 2014, 5:13 p.m. UTC | #2
On Tue, Oct 14, 2014 at 07:28:45PM -0400, Vladimir Makarov wrote:
> On 2014-10-14 4:17 PM, Peter Bergner wrote:
> >On Fri, 2014-10-10 at 11:02 -0400, Vladimir Makarov wrote:
> >>Here is a new rematerialization sub-pass of LRA.
> >
> >When Mike and I build with this patch along with the patch that
> >enables LRA by default on powerpc64*-linux (attached below), we're
> >seeing the following error message.  I'm not sure how your patch
> >can cause this error, but it does go away if we remove your patch
> >and build again.
> 
> Peter, thanks for checking the patch and reporting this.  I had
> several wrong code generation problems with rematerialization on x86
> and arm. I've solved them before posting the patch but I did not
> check ppc64.
> 
> As a lot of people started to try the patch, several problems were
> reported.  I'll address them and do some patch modifications.  Now I
> think that I'll commit the patch into the trunk not earlier the next
> week.  And I'll check with ppc64 too to be sure that we have no
> wrong code generation problems on this target too.

I started a power7 spec run, and so far I've gotten through SpecINT on trunk,
trunk + LRA, and trunk + LRA + Vlad's patches (including rematerialization).

There are 3 benchmarks that fail with my usual options with the new LRA
patches: gcc, gobmk, h264ref.

My usual options are:
	-fpeel-loops -funroll-loops -ftree-vectorize -fvect-cost-model -mlra
	-ffast-math -O3 -mcpu=power7

Right now, on the remaining benchmarks, there is a very slight performance loss
for mcf with lra and remat, but MCF is one of those benchmarks that seems to
vary on factors other than compiler options (location of loops in memory,
etc.), but other than that there is no real difference in using the current
reload, the current LRA, and the new patches.
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.opt
===================================================================
--- gcc/config/rs6000/rs6000.opt	(revision 216216)
+++ gcc/config/rs6000/rs6000.opt	(working copy)
@@ -466,7 +466,7 @@  Target RejectNegative Joined UInteger Va
 -mlong-double-<n>	Specify size of long double (64 or 128 bits)
 
 mlra
-Target Report Var(rs6000_lra_flag) Init(0) Save
+Target Report Var(rs6000_lra_flag) Init(1) Save
 Use LRA instead of reload
 
 msched-costly-dep=