This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/50374] Support vectorization of min/max location pattern
- From: "vincenzo.innocente at cern dot ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Nov 2011 09:13:08 +0000
- Subject: [Bug tree-optimization/50374] Support vectorization of min/max location pattern
- Auto-submitted: auto-generated
- References: <bug-50374-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50374
--- Comment #26 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2011-11-30 09:13:08 UTC ---
using a minimal configuration like
./configure --prefix=/something --enable-languages=c,c++ --disable-multilib
--disable-bootstrap --enable-lto -enable-gold=yes -disable-libitm
I manage to build with the patch
int lmin(float const * __restrict__ c, int N) {
int k=0;
for (int i=1; i!=N; ++i)
k = (c[k] > c[i]) ? i : k;
return k;
}
indeed vectorizes (sse, not avx).
The amount of code emitted is quite large though, it will most probably worth
only in a long loop
with more instructions to vectorize: the effective speedup need to be properly
evaluated case by case