frontend: Add novector C pragma
FORTRAN currently has a pragma NOVECTOR for indicating that vectorization should not be applied to a particular loop. ICC/ICX also has such a pragma for C and C++ called #pragma novector. As part of this patch series I need a way to easily turn off vectorization of particular loops, particularly for testsuite reasons. This patch proposes a #pragma GCC novector that does the same for C as gfortan does for FORTRAN and what ICX/ICX does for C. I added only some basic tests here, but the next patch in the series uses this in the testsuite in about ~800 tests. gcc/c-family/ChangeLog: * c-pragma.h (enum pragma_kind): Add PRAGMA_NOVECTOR. * c-pragma.cc (init_pragma): Use it. gcc/c/ChangeLog: * c-parser.cc (c_parser_while_statement, c_parser_do_statement, c_parser_for_statement, c_parser_statement_after_labels, c_parse_pragma_novector, c_parser_pragma): Wire through novector and default to false. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-novector-pragma.c: New test.
Showing
- gcc/c-family/c-pragma.cc 4 additions, 0 deletionsgcc/c-family/c-pragma.cc
- gcc/c-family/c-pragma.h 1 addition, 0 deletionsgcc/c-family/c-pragma.h
- gcc/c/c-parser.cc 80 additions, 39 deletionsgcc/c/c-parser.cc
- gcc/testsuite/gcc.dg/vect/vect-novector-pragma.c 61 additions, 0 deletionsgcc/testsuite/gcc.dg/vect/vect-novector-pragma.c
Loading
Please register or sign in to comment