Hi,

I have tried vectorization and encountered a problem which I can see
is common to some ports (I tried ia64 and bfin).

For this function:

#define ts unsigned short
void f(ts* __restrict__ a, ts* __restrict__ b, ts* __restrict__ x)
{
   int i;
   for (i=0;i<1024;i++)
       x[i] = a[i] + b[i];
}

the loop is vectorized.
But if I define ts as follows: #define ts short
then the loop is not vectorized. The message I get is:

./a.c:21: note: no optab.
./a.c:21: note: not vectorized: relevant stmt not supported: D.1279_12
= (short unsigned int) D.1278_11;

I have tried to look a bit in the vectorizer code and it seems that
for this stmt I get to vectorizable_operation with code==NOP_EXPR
which is not handled.

Does anyone knows anything about this problem?

Thanks, Roy.

./xgcc -v -save-temps -O3 -S ./a.c -ftree-vectorizer-verbose=2
Using built-in specs.
Target: ia64-*-linux
Configured with: ../gcc-4.4.3/configure --target='ia64-*-linux'
--enable-languages=c : (reconfigured)
Thread model: posix
gcc version 4.4.3 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O3' '-S' '-ftree-vectorizer-verbose=2'
 cc1 -E -quiet -v -iprefix
/home/swproj/sw/users/eyalhar/gcc-ia64/gcc/../lib/gcc/ia64-*-linux/4.4.3/ ./a.c
-ftree-vectorizer-verbose=2 -O3 -fpch-preprocess -o a.i
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/gcc-ia64/gcc/../lib/gcc/ia64-*-linux/4.4.3/include"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/gcc-ia64/gcc/../lib/gcc/ia64-*-linux/4.4.3/include-fixed"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/gcc-ia64/gcc/../lib/gcc/ia64-*-linux/4.4.3/../../../../ia64-*-linux/sys-include"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/gcc-ia64/gcc/../lib/gcc/ia64-*-linux/4.4.3/../../../../ia64-*-linux/include"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/gcc-ia64/gcc/../lib/gcc/../../lib/gcc/ia64-*-linux/4.4.3/include"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/gcc-ia64/gcc/../lib/gcc/../../lib/gcc/ia64-*-linux/4.4.3/include-fixed"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/gcc-ia64/gcc/../lib/gcc/../../lib/gcc/ia64-*-linux/4.4.3/../../../../ia64-*-linux/sys-include"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/gcc-ia64/gcc/../lib/gcc/../../lib/gcc/ia64-*-linux/4.4.3/../../../../ia64-*-linux/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O3' '-S' '-ftree-vectorizer-verbose=2'
 cc1 -fpreprocessed a.i -quiet -dumpbase a.c -auxbase a -O3 -version
-ftree-vectorizer-verbose=2 -o a.s
GNU C (GCC) version 4.4.3 (ia64-*-linux)
        compiled by GNU C version 4.1.2 20080704 (Red Hat 4.1.2-44), GMP
version 4.3.2, MPFR version 2.4.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: cc15465375f06438c45a5c1ccdf35a17

./a.c:21: note: not vectorized: relevant stmt not supported: D.1236_12 = (short
unsigned int) D.1235_11;

./a.c:18: note: vectorized 0 loops in function.
COMPILER_PATH=
LIBRARY_PATH=
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O3' '-S' '-ftree-vectorizer-verbose=2'


-- 
           Summary: vectorization does not work for short variable
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: roy dot 1rosen at gmail dot com
 GCC build triplet: *
  GCC host triplet: linux
GCC target triplet: ia64


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44284

Reply via email to