This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/43359] gas_dyn benchmark 230% slower when compiled with -fgraphite-identity
- From: "dominiq at lps dot ens dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Mar 2010 14:20:40 -0000
- Subject: [Bug middle-end/43359] gas_dyn benchmark 230% slower when compiled with -fgraphite-identity
- References: <bug-43359-11113@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from dominiq at lps dot ens dot fr 2010-03-15 14:20 -------
The patch used for comment #3 was
--- /opt/gcc/_clean/gcc/passes.c 2010-02-22 15:28:45.000000000 +0100
+++ /opt/gcc/p_work/gcc/passes.c 2010-03-14 14:05:55.000000000 +0100
@@ -901,6 +901,8 @@ init_optimization_passes (void)
NEXT_PASS (pass_lim);
}
NEXT_PASS (pass_iv_canon);
+ NEXT_PASS (pass_copy_prop);
+ NEXT_PASS (pass_dce_loop);
NEXT_PASS (pass_if_conversion);
NEXT_PASS (pass_vectorize);
{
Note this is a regression:
[macbook] lin/test% gfcd -v -c eos.f90 -O3 -ffast-math
-ftree-vectorizer-verbose=2 -fgraphite-identity
...
Target: x86_64-apple-darwin10
Configured with: ../for_work/configure --prefix=/opt/gcc/gcc4.5d
--mandir=/opt/gcc/gcc4.5d/share/man --infodir=/opt/gcc/gcc4.5d/share/info
--build=x86_64-apple-darwin10 --host=x86_64-apple-darwin10
--target=x86_64-apple-darwin10 --enable-languages=c,fortran
--with-gmp=/opt/sw64 --with-libiconv-prefix=/opt/sw64 --with-system-zlib
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
--with-cloog=/opt/sw64 --with-ppl=/opt/sw64 --with-mpc=/opt/sw64
Thread model: posix
gcc version 4.5.0 20100226 (experimental) [branch fortran-dev revision 157148]
(GCC)
...
eos.f90:1: note: LOOP VECTORIZED.
eos.f90:1: note: LOOP VECTORIZED.
eos.f90:1: note: LOOP VECTORIZED.
eos.f90:1: note: LOOP VECTORIZED.
eos.f90:1: note: LOOP VECTORIZED.
eos.f90:1: note: LOOP VECTORIZED.
eos.f90:1: note: LOOP VECTORIZED.
eos.f90:1: note: vectorized 7 loops in function.
...
[macbook] lin/test% gfcp -v -c eos.f90 -O3 -ffast-math
-ftree-vectorizer-verbose=2 -fgraphite-identity
...
Target: x86_64-apple-darwin10
Configured with: ../p_work/configure --prefix=/opt/gcc/gcc4.5p
--mandir=/opt/gcc/gcc4.5p/share/man --infodir=/opt/gcc/gcc4.5p/share/info
--build=x86_64-apple-darwin10 --host=x86_64-apple-darwin10
--target=x86_64-apple-darwin10 --enable-languages=c,fortran
--with-gmp=/opt/sw64 --with-libiconv-prefix=/opt/sw64 --with-system-zlib
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
--with-cloog=/opt/sw64 --with-ppl=/opt/sw64 --with-mpc=/opt/sw64
Thread model: posix
gcc version 4.5.0 20100314 (experimental) [trunk revision 157446p1] (GCC)
...
eos.f90:1: note: vectorized 0 loops in function.
...
for r157446 with the above patch. The summary should probably be changed to
something such as "missed vectorization with graphite".
Note that if I replace -fgraphite-identity with -fgraphite or -floop-block,
there is no vectorization even with gfortran.
Also the test from http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00515.html
subroutine sum(a, b, c, n)
integer i, n
real a(n), b(n), c(n)
do i = 1, n
c(i) = a(i) + b(i)
enddo
end
vectorize with gfortran 4.4.2, but not with 4.5 at revision 156618.
Final note pr40979 is also a missed vectorization with graphite. It would be of
interest to investigate if it is a duplicate or a more subtle problem related
to pr34265 and friends (early inlining of dot_product).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43359