This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC] [autovect patch] Implement vectorization hints
- From: Devang Patel <dpatel at apple dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 24 Feb 2005 16:27:39 -0800
- Subject: [RFC] [autovect patch] Implement vectorization hints
This patch implements two #pragmas that developers can use to give
hints to auto vectorization pass. These pragmas are inserted in the
source file before the loop. They are effective only on the very next
loop in the source file.
"#pragma novector" instructs compiler to not vectorize the loop.
Programmer may decide to do so for various reasons.
"#pragma ivdep" instructs compiler to ignore possible data dependence
when data dependence analyzer is not able determine it. This is useful
in a situation where compiler does not have enough information to prove
data independence, but developer knows about it.
2005-02-24 Devang Patel <dpatel@apple.com>
* Makefile.in (c-common.c): Depend on tree-flow.h,
tree-data-ref.h
and tree-vectorizer.h.
* c-common.c (tree-flow.h, tree-data-ref.h, tree-vectorizer.h):
Include.
(c_common_ivdep_pragma): New.
(c_common_novector_pragma): New.
* c-common.h (c_common_ivdep_pragma, c_common_novector_pragma):
New.
* c-pragma.c (init_pragma): Register ivdeps and novector pragma
handlers.
* input.h (LOCATION_RANGE_OPEN_ENDED): New.
(struct location_range): New.
* tree-vectorizer.h (new_ivdep_pragma, new_novector_pragma):
New.
(vect_pattern_recog_func): Moved to..
* tree-vectorizer.c (vect_pattern_recog_func): ... here.
(pragma_ivdep_on, pragma_novector_on): New.
(pragma_ivdep_active_p, pragma_novector_active_p,
vect_pragma_lookup,
new_ivdep_pragma, new_novector_pragma):
New functions.
(vect_analyze_data_ref_dependence): Use pragma ivdep settings.
(vectorize_loops): Use pragma novector settings.
* tree.c (compare_location, new_location_range,
location_inside_range_p):
New functions.
* tree.c (compare_location, new_location_range,
location_inside_range_p):
New.
* doc/exten.texi: Document #pragma ivdep and #pragma novector.
* gcc.dg/vect/vect-pragma-1.c: New test.
* gcc.dg/vect/vect-pragma-2.c: New test.
-
Devang
Attachment:
av_pragma.diff
Description: Binary data