diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-16 20:14:45 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-16 20:14:45 +0000 |
commit | c7a8722cd14b69d59945e132d74567e51081c240 (patch) | |
tree | 03a1ca6a02d62b0b91e99afafe1fccdc323c6673 /gcc/tree-vectorizer.h | |
parent | 5b5af642816ed0feb44d646299ed37bb557b2a54 (diff) | |
download | gcc-c7a8722cd14b69d59945e132d74567e51081c240.tar.gz |
* tree-vectorizer.h (struct _loop_vec_info): Add no_data_dependencies
field.
(LOOP_VINFO_NO_DATA_DEPENDENCIES): Define.
* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Clear it
when not giving up or versioning for alias only because of
loop->safelen.
(vect_analyze_data_ref_dependences): Set to true.
* tree-vect-stmts.c (hoist_defs_of_uses): Return false if def_stmt
is a GIMPLE_PHI.
(vectorizable_load): Use LOOP_VINFO_NO_DATA_DEPENDENCIES instead of
LOOP_REQUIRES_VERSIONING_FOR_ALIAS, add && !nested_in_vect_loop
to the condition.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206687 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 935aab9d2b0..51367ea2500 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -347,6 +347,25 @@ typedef struct _loop_vec_info { fix it up. */ bool operands_swapped; + /* True if there are no loop carried data dependencies in the loop. + If loop->safelen <= 1, then this is always true, either the loop + didn't have any loop carried data dependencies, or the loop is being + vectorized guarded with some runtime alias checks, or couldn't + be vectorized at all, but then this field shouldn't be used. + For loop->safelen >= 2, the user has asserted that there are no + backward dependencies, but there still could be loop carried forward + dependencies in such loops. This flag will be false if normal + vectorizer data dependency analysis would fail or require versioning + for alias, but because of loop->safelen >= 2 it has been vectorized + even without versioning for alias. E.g. in: + #pragma omp simd + for (int i = 0; i < m; i++) + a[i] = a[i + k] * c; + (or #pragma simd or #pragma ivdep) we can vectorize this and it will + DTRT even for k > 0 && k < m, but without safelen we would not + vectorize this, so this field would be false. */ + bool no_data_dependencies; + /* If if-conversion versioned this loop before conversion, this is the loop version without if-conversion. */ struct loop *scalar_loop; @@ -385,6 +404,7 @@ typedef struct _loop_vec_info { #define LOOP_VINFO_PEELING_FOR_GAPS(L) (L)->peeling_for_gaps #define LOOP_VINFO_OPERANDS_SWAPPED(L) (L)->operands_swapped #define LOOP_VINFO_PEELING_FOR_NITER(L) (L)->peeling_for_niter +#define LOOP_VINFO_NO_DATA_DEPENDENCIES(L) (L)->no_data_dependencies #define LOOP_VINFO_SCALAR_LOOP(L) (L)->scalar_loop #define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \ |