2004-10-14 Olga Golovanevsky <olga@il.ibm.com>

* tree-vectorizer.c (vect_generate_tmps_on_preheader):
        (vect_update_ivs_after_vectorizer):
        (vect_transform_for_unknown_loop_bound):
        (tree_duplicate_loop_to_edge):
        (allocate_new_names):
        (rename_use_op):
        (rename_def_op):
        (rename_variables_in_bb):
        (free_new_names):
        (rename_variables_in_loop):
        (copy_phi_nodes):
        (update_phis_for_duplicate_loop):
        (update_phi_nodes_for_guard):
        (make_loop_iterate_ntimes):
        (tree_duplicate_loop_to_edge_cfg):
        (add_loop_guard):
        (vect_analyze_loop_with_symbolic_num_of_iters):
        (verify_loop_for_duplication):
        (vect_gen_niters_for_prolog_loop):
        (vect_update_niters_after_peeling):
        (vect_update_inits_of_dr):
        (vect_update_inits_of_drs):
        (vect_build_loop_niters):
        (vect_do_peeling_for_alignment): New functions.
        (vect_transform_loop): Add unknown and known but indivisible loop
        bound support; add peeling for unalignment support.
        (vect_analyze_loop_form): Support symbolic number of iterations.
        (vect_transform_loop_bound): New input parameter.
        (vect_get_loop_niters): Change input parameter type.
        (new_loop_vec_info): LOOP_VINFO_NITERS is tree now.
        (vectorizable_store): Allow unaligned access.
        (vectorize_loops): Add rewrite_into_loop_closed_ssa.
        (vect_analyze_data_refs_alignment): Allowed one unaligned
        store.
        * tree-vectorizer.h (LOOP_VINFO_NITERS_KNOWN_P): Redefined
        to use tree.
        (LOOP_VINFO_INT_NITERS): New macro.
        (MAX_NUMBER_OF_UNALIGNED_DATA_REFS): New define.
        (do_peeling_for_alignment):
        (unaligned_drs): New members of _loop_vec_info.
        (LOOP_DO_PEELING_FOR_ALIGNMENT): New macro.

From-SVN: r89040
This commit is contained in:
Olga Golovanevsky 2004-10-14 17:21:35 +00:00 committed by Dorit Nuzman
parent 7238c5ec25
commit a023975e42
23 changed files with 1676 additions and 96 deletions

View File

@ -1,3 +1,47 @@
2004-10-14 Olga Golovanevsky <olga@il.ibm.com>
* tree-vectorizer.c (vect_generate_tmps_on_preheader):
(vect_update_ivs_after_vectorizer):
(vect_transform_for_unknown_loop_bound):
(tree_duplicate_loop_to_edge):
(allocate_new_names):
(rename_use_op):
(rename_def_op):
(rename_variables_in_bb):
(free_new_names):
(rename_variables_in_loop):
(copy_phi_nodes):
(update_phis_for_duplicate_loop):
(update_phi_nodes_for_guard):
(make_loop_iterate_ntimes):
(tree_duplicate_loop_to_edge_cfg):
(add_loop_guard):
(vect_analyze_loop_with_symbolic_num_of_iters):
(verify_loop_for_duplication):
(vect_gen_niters_for_prolog_loop):
(vect_update_niters_after_peeling):
(vect_update_inits_of_dr):
(vect_update_inits_of_drs):
(vect_build_loop_niters):
(vect_do_peeling_for_alignment): New functions.
(vect_transform_loop): Add unknown and known but indivisible loop
bound support; add peeling for unalignment support.
(vect_analyze_loop_form): Support symbolic number of iterations.
(vect_transform_loop_bound): New input parameter.
(vect_get_loop_niters): Change input parameter type.
(new_loop_vec_info): LOOP_VINFO_NITERS is tree now.
(vectorizable_store): Allow unaligned access.
(vectorize_loops): Add rewrite_into_loop_closed_ssa.
(vect_analyze_data_refs_alignment): Allowed one unaligned
store.
* tree-vectorizer.h (LOOP_VINFO_NITERS_KNOWN_P): Redefined
to use tree.
(LOOP_VINFO_INT_NITERS): New macro.
(MAX_NUMBER_OF_UNALIGNED_DATA_REFS): New define.
(do_peeling_for_alignment):
(unaligned_drs): New members of _loop_vec_info.
(LOOP_DO_PEELING_FOR_ALIGNMENT): New macro.
2004-10-14 Ranjit Mathew <rmathew@hotmail.com>
* tree.h (TREE_STRING_POINTER): Wrap in "const char *".

View File

@ -1,3 +1,24 @@
2004-10-14 Olga GOlovanevsky <olga@il.ibm.com>
* testsuite/gcc.dg/vect/vect-28.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-30.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-31.c : Vectorize 4 loops instead of 2.
* testsuite/gcc.dg/vect/vect-33.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-44.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-46.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-50.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-52.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-54.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-58.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-60.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-64.c : Vectorize 3 loops instead of 1.
* testsuite/gcc.dg/vect/vect-66.c : Vectorize 3 loops instead of 2.
* testsuite/gcc.dg/vect/vect-68.c : Vectorize 4 loops instead of 2.
* testsuite/gcc.dg/vect/vect-69.c : Vectorize 4 loops instead of 2.
* testsuite/gcc.dg/vect/vect-8.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-80.c : Remove xfail.
* testsuite/gcc.dg/vect/vect-none.c : Vectorize 1 loops instead of 0.
2004-10-14 Dorit Naishlos <dorit@il.ibm.com>
* gcc.dg/vect/vect-82.c: New testcase.

View File

@ -37,5 +37,5 @@ int main (void)
return main1 ();
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -40,5 +40,5 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -64,4 +64,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */

View File

@ -88,4 +88,4 @@ int main (void)
return main1 ();
}
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */

View File

@ -38,4 +38,4 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -59,4 +59,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -55,4 +55,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -54,4 +54,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -56,4 +56,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -55,4 +55,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -56,4 +56,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -57,4 +57,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -83,4 +83,4 @@ int main (void)
return main1 ();
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */

View File

@ -79,4 +79,4 @@ int main (void)
return main1 ();
}
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */

View File

@ -87,4 +87,4 @@ int main (void)
return main1 ();
}
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */

View File

@ -114,4 +114,4 @@ int main (void)
return main1 ();
}
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */

View File

@ -39,4 +39,4 @@ int main (void)
return main1 (N);
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -47,4 +47,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

View File

@ -189,5 +189,5 @@ foo (int n)
}
/* { dg-final { scan-tree-dump-times "vectorized " 3 "vect"} } */
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 3 "vect"} } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect"} } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */

File diff suppressed because it is too large Load Diff

View File

@ -121,6 +121,7 @@ vinfo_for_stmt (tree stmt)
/* The misalignment of the memory access in bytes. */
#define DR_MISALIGNMENT(DR) (DR)->aux
#define MAX_NUMBER_OF_UNALIGNED_DATA_REFS 1
static inline bool
aligned_access_p (struct data_reference *data_ref_info)
@ -152,8 +153,8 @@ typedef struct _loop_vec_info {
/* The loop exit_condition. */
tree exit_cond;
/* Number of iterations. -1 if unknown. */
HOST_WIDE_INT num_iters;
/* Number of iterations. */
tree num_iters;
/* Is the loop vectorizable? */
bool vectorizable;
@ -161,6 +162,13 @@ typedef struct _loop_vec_info {
/* Unrolling factor */
int vectorization_factor;
/* Unknown DRs according to which loop was peeled. */
struct data_reference *unaligned_drs [MAX_NUMBER_OF_UNALIGNED_DATA_REFS];
/* If true, loop is peeled.
unaligned_drs show in this case DRs used for peeling. */
bool do_peeling_for_alignment;
/* All data references in the loop that are being written to. */
varray_type data_ref_writes;
@ -177,8 +185,14 @@ typedef struct _loop_vec_info {
#define LOOP_VINFO_VECT_FACTOR(L) (L)->vectorization_factor
#define LOOP_VINFO_DATAREF_WRITES(L) (L)->data_ref_writes
#define LOOP_VINFO_DATAREF_READS(L) (L)->data_ref_reads
#define LOOP_VINFO_INT_NITERS(L) (TREE_INT_CST_LOW ((L)->num_iters))
#define LOOP_DO_PEELING_FOR_ALIGNMENT(L) (L)->do_peeling_for_alignment
#define LOOP_UNALIGNED_DR(L, I) (L)->unaligned_drs[(I)]
#define LOOP_VINFO_NITERS_KNOWN_P(L) ((L)->num_iters > 0)
#define LOOP_VINFO_NITERS_KNOWN_P(L) \
(host_integerp ((L)->num_iters,0) \
&& TREE_INT_CST_LOW ((L)->num_iters) > 0)
/*-----------------------------------------------------------------*/
/* Function prototypes. */