* [PATCH] AV - Use distance vector
@ 2004-09-16 17:01 Devang Patel
2004-09-21 22:07 ` Richard Henderson
0 siblings, 1 reply; 9+ messages in thread
From: Devang Patel @ 2004-09-16 17:01 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 837 bytes --]
This patch updates auto vectorizer to use distance
vector info while analyzing data dependence. It uses
existing API to compute distance vector.
With this patch included test cases are auto vectorized.
This patch is also required to vectorize if-converted
loops.
Bootstrapped and tested on powerpc-darwin.
OK?
Thanks,
-
Devang
2004-09-15 Devang Patel <dpatel@apple.com>
* tree-data-ref.c (compute_distance_vector): Export.
* tree-data-ref.h (compute_distance_vector): Same.
* tree-vectorizer.c (vect_analyze_data_ref_dependence): new
parameter,
loop_vinfo. Use distance vector.
(vect_analyze_data_ref_dependences): Supply new parameter.
(vect_analyze_loop): Analyze operations before data dependences.
testsuite
* gcc.dg/vect/vect-20040915-1.c: New test.
[-- Attachment #2: ifc2_fsf_mainline.2.0.diff --]
[-- Type: application/octet-stream, Size: 9174 bytes --]
Index: gcc/tree-data-ref.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.c,v
retrieving revision 2.7
diff -Idpatel.pbxuser -c -3 -p -r2.7 tree-data-ref.c
*** gcc/tree-data-ref.c 10 Sep 2004 15:09:38 -0000 2.7
--- gcc/tree-data-ref.c 15 Sep 2004 20:57:33 -0000
*************** init_data_ref (tree stmt,
*** 598,604 ****
/* When there exists a dependence relation, determine its distance
vector. */
! static void
compute_distance_vector (struct data_dependence_relation *ddr)
{
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
--- 598,604 ----
/* When there exists a dependence relation, determine its distance
vector. */
! void
compute_distance_vector (struct data_dependence_relation *ddr)
{
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
Index: gcc/tree-data-ref.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.h,v
retrieving revision 2.4
diff -Idpatel.pbxuser -c -3 -p -r2.4 tree-data-ref.h
*** gcc/tree-data-ref.h 10 Sep 2004 15:09:38 -0000 2.4
--- gcc/tree-data-ref.h 15 Sep 2004 20:57:33 -0000
*************** struct data_dependence_relation
*** 147,152 ****
--- 147,153 ----
struct data_dependence_relation *initialize_data_dependence_relation
(struct data_reference *, struct data_reference *);
void compute_affine_dependence (struct data_dependence_relation *);
+ void compute_distance_vector (struct data_dependence_relation *ddr);
extern void analyze_all_data_dependences (struct loops *);
extern void compute_data_dependences_for_loop (unsigned, struct loop *,
varray_type *, varray_type *);
Index: gcc/tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vectorizer.c,v
retrieving revision 2.8
diff -Idpatel.pbxuser -c -3 -p -r2.8 tree-vectorizer.c
*** gcc/tree-vectorizer.c 10 Sep 2004 10:44:47 -0000 2.8
--- gcc/tree-vectorizer.c 15 Sep 2004 20:57:34 -0000
*************** vect_analyze_scalar_cycles (loop_vec_inf
*** 1973,1982 ****
static bool
vect_analyze_data_ref_dependence (struct data_reference *dra,
struct data_reference *drb,
! struct loop *loop)
{
bool differ_p;
struct data_dependence_relation *ddr;
if (!array_base_name_differ_p (dra, drb, &differ_p))
{
--- 2116,2130 ----
static bool
vect_analyze_data_ref_dependence (struct data_reference *dra,
struct data_reference *drb,
! struct loop *loop,
! loop_vec_info loop_info)
{
bool differ_p;
struct data_dependence_relation *ddr;
+ unsigned int i;
+ bool dep_exists = true;
+ int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_info);
+ tree vf = NULL_TREE;
if (!array_base_name_differ_p (dra, drb, &differ_p))
{
*************** vect_analyze_data_ref_dependence (struct
*** 2000,2005 ****
--- 2148,2178 ----
if (DDR_ARE_DEPENDENT (ddr) == chrec_known)
return false;
+ /* Check distance vector. */
+ compute_distance_vector (ddr);
+ vf = build_int_cst (unsigned_type_node, vectorization_factor);
+
+ for (i = 0; i < DDR_NUM_SUBSCRIPTS (ddr); i++)
+ {
+ struct subscript *subscript;
+
+ subscript = DDR_SUBSCRIPT (ddr, i);
+
+ if (SUB_DISTANCE (subscript) == integer_zero_node)
+ dep_exists = false;
+ else if (INT_CST_LT (vf, SUB_DISTANCE (subscript)))
+ {
+ dep_exists = false;
+
+ if (TREE_INT_CST_LOW (vf) == TREE_INT_CST_LOW (SUB_DISTANCE (subscript))
+ && TREE_INT_CST_HIGH (vf) == TREE_INT_CST_HIGH (SUB_DISTANCE (subscript)))
+ dep_exists = true;
+ }
+ }
+
+ if (!dep_exists)
+ return false;
+
if (vect_debug_stats (loop) || vect_debug_details (loop))
{
fprintf (dump_file,
*************** vect_analyze_data_ref_dependences (loop_
*** 2045,2051 ****
VARRAY_GENERIC_PTR (loop_write_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop))
return false;
}
}
--- 2218,2224 ----
VARRAY_GENERIC_PTR (loop_write_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop, loop_vinfo))
return false;
}
}
*************** vect_analyze_data_ref_dependences (loop_
*** 2062,2068 ****
struct data_reference *dra = VARRAY_GENERIC_PTR (loop_read_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop))
return false;
}
}
--- 2235,2241 ----
struct data_reference *dra = VARRAY_GENERIC_PTR (loop_read_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop, loop_vinfo))
return false;
}
}
*************** vect_analyze_loop (struct loop *loop)
*** 3275,3327 ****
}
! /* Analyze data dependences between the data-refs in the loop.
! FORNOW: fail at the first data dependence that we encounter. */
! ok = vect_analyze_data_ref_dependences (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data dependence.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze the access patterns of the data-refs in the loop (consecutive,
! complex, etc.). FORNOW: Only handle consecutive access pattern. */
! ok = vect_analyze_data_ref_accesses (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data access.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze the alignment of the data-refs in the loop.
! FORNOW: Only aligned accesses are handled. */
!
! ok = vect_analyze_data_refs_alignment (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data alignment.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Scan all the operations in the loop and make sure they are
! vectorizable. */
!
! ok = vect_analyze_operations (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad operation or unsupported loop bound.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
--- 3450,3500 ----
}
! /* Analyze the alignment of the data-refs in the loop.
! FORNOW: Only aligned accesses are handled. */
! ok = vect_analyze_data_refs_alignment (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data alignment.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Scan all the operations in the loop and make sure they are
! vectorizable. */
! ok = vect_analyze_operations (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad operation or unsupported loop bound.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
+ /* Analyze data dependences between the data-refs in the loop.
+ FORNOW: fail at the first data dependence that we encounter. */
! ok = vect_analyze_data_ref_dependences (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data dependence.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
+ /* Analyze the access patterns of the data-refs in the loop (consecutive,
+ complex, etc.). FORNOW: Only handle consecutive access pattern. */
! ok = vect_analyze_data_ref_accesses (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data access.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
/* { dg-do run } */
/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* x86_64-*-* } } */
#include <stdarg.h>
#include <signal.h>
#define N 64
#define MAX 42
extern void abort(void);
int main ()
{
int A[N];
int B[N];
int C[N];
int i, j;
for (i = 0; i < N; i++)
{
A[i] = i;
B[i] = i;
C[i] = i;
}
/* Vectorizable */
for (i = 0; i < 16; i++)
{
A[i] = A[i+20];
}
/* check results: */
for (i = 0; i < 16; i++)
{
if (A[i] != A[i+20])
abort ();
}
/* Vectorizable */
for (i = 0; i < 16; i++)
{
B[i] = B[i] + 5;
}
/* check results: */
for (i = 0; i < 16; i++)
{
if (B[i] != C[i] + 5)
abort ();
}
/* Not vectorizable */
for (i = 0; i < 4; i++)
{
C[i] = C[i+4];
}
/* check results: */
for (i = 0; i < 4; i++)
{
if (C[i] != C[i+4])
abort ();
}
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AV - Use distance vector
2004-09-16 17:01 [PATCH] AV - Use distance vector Devang Patel
@ 2004-09-21 22:07 ` Richard Henderson
2004-09-21 22:17 ` Devang Patel
2004-09-22 19:54 ` Devang Patel
0 siblings, 2 replies; 9+ messages in thread
From: Richard Henderson @ 2004-09-21 22:07 UTC (permalink / raw)
To: Devang Patel; +Cc: GCC Patches
On Thu, Sep 16, 2004 at 09:48:51AM -0700, Devang Patel wrote:
> + if (SUB_DISTANCE (subscript) == integer_zero_node)
integer_zerop.
> + else if (INT_CST_LT (vf, SUB_DISTANCE (subscript)))
> + {
> + dep_exists = false;
> +
> + if (TREE_INT_CST_LOW (vf) == TREE_INT_CST_LOW (SUB_DISTANCE (subscript))
> + && TREE_INT_CST_HIGH (vf) == TREE_INT_CST_HIGH (SUB_DISTANCE (subscript)))
Both can be done with one tree_int_cst_compare.
r~
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AV - Use distance vector
2004-09-21 22:07 ` Richard Henderson
@ 2004-09-21 22:17 ` Devang Patel
2004-09-22 19:54 ` Devang Patel
1 sibling, 0 replies; 9+ messages in thread
From: Devang Patel @ 2004-09-21 22:17 UTC (permalink / raw)
To: Richard Henderson; +Cc: GCC Patches
On Sep 21, 2004, at 2:43 PM, Richard Henderson wrote:
> On Thu, Sep 16, 2004 at 09:48:51AM -0700, Devang Patel wrote:
>> + if (SUB_DISTANCE (subscript) == integer_zero_node)
>
> integer_zerop.
ok
>
>> + else if (INT_CST_LT (vf, SUB_DISTANCE (subscript)))
>> + {
>> + dep_exists = false;
>> +
>> + if (TREE_INT_CST_LOW (vf) == TREE_INT_CST_LOW (SUB_DISTANCE
>> (subscript))
>> + && TREE_INT_CST_HIGH (vf) == TREE_INT_CST_HIGH (SUB_DISTANCE
>> (subscript)))
>
> Both can be done with one tree_int_cst_compare.
ok
-
Devang
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AV - Use distance vector
2004-09-21 22:07 ` Richard Henderson
2004-09-21 22:17 ` Devang Patel
@ 2004-09-22 19:54 ` Devang Patel
2004-09-22 20:37 ` Richard Henderson
1 sibling, 1 reply; 9+ messages in thread
From: Devang Patel @ 2004-09-22 19:54 UTC (permalink / raw)
To: Richard Henderson; +Cc: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]
On Sep 21, 2004, at 2:43 PM, Richard Henderson wrote:
> On Thu, Sep 16, 2004 at 09:48:51AM -0700, Devang Patel wrote:
>> + if (SUB_DISTANCE (subscript) == integer_zero_node)
>
> integer_zerop.
>
>> + else if (INT_CST_LT (vf, SUB_DISTANCE (subscript)))
>> + {
>> + dep_exists = false;
>> +
>> + if (TREE_INT_CST_LOW (vf) == TREE_INT_CST_LOW (SUB_DISTANCE
>> (subscript))
>> + && TREE_INT_CST_HIGH (vf) == TREE_INT_CST_HIGH (SUB_DISTANCE
>> (subscript)))
>
> Both can be done with one tree_int_cst_compare.
How about following? Bootstrapped and tested on powerpc-darwin. I also
included Dorit's
feedback to check subscript for given loop depth only.
ChangeLog entry is same.
OK?
Thanks,
-
Devang
2004-09-22 Devang Patel <dpatel@apple.com>
* tree-data-ref.c (compute_distance_vector): Export.
* tree-data-ref.h (compute_distance_vector): Same.
* tree-vectorizer.c (vect_analyze_data_ref_dependence): new
parameter,
loop_vinfo. Use distance vector.
(vect_analyze_data_ref_dependences): Supply new parameter.
(vect_analyze_loop): Analyze operations before data dependences.
testsuite
* gcc.dg/vect/vect-20040915-1.c: New test.
[-- Attachment #2: ifc2_fsf_mainline.2.1.diff --]
[-- Type: application/octet-stream, Size: 7814 bytes --]
Index: gcc/tree-data-ref.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.h,v
retrieving revision 2.4
diff -Idpatel.pbxuser -c -3 -p -r2.4 tree-data-ref.h
*** gcc/tree-data-ref.h 10 Sep 2004 15:09:38 -0000 2.4
--- gcc/tree-data-ref.h 22 Sep 2004 19:25:04 -0000
*************** struct data_dependence_relation
*** 147,152 ****
--- 147,153 ----
struct data_dependence_relation *initialize_data_dependence_relation
(struct data_reference *, struct data_reference *);
void compute_affine_dependence (struct data_dependence_relation *);
+ void compute_distance_vector (struct data_dependence_relation *ddr);
extern void analyze_all_data_dependences (struct loops *);
extern void compute_data_dependences_for_loop (unsigned, struct loop *,
varray_type *, varray_type *);
Index: gcc/tree-data-ref.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.c,v
retrieving revision 2.7
diff -Idpatel.pbxuser -c -3 -p -r2.7 tree-data-ref.c
*** gcc/tree-data-ref.c 10 Sep 2004 15:09:38 -0000 2.7
--- gcc/tree-data-ref.c 22 Sep 2004 19:25:04 -0000
*************** init_data_ref (tree stmt,
*** 598,604 ****
/* When there exists a dependence relation, determine its distance
vector. */
! static void
compute_distance_vector (struct data_dependence_relation *ddr)
{
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
--- 598,604 ----
/* When there exists a dependence relation, determine its distance
vector. */
! void
compute_distance_vector (struct data_dependence_relation *ddr)
{
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
Index: gcc/tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vectorizer.c,v
retrieving revision 2.8
diff -Idpatel.pbxuser -c -3 -p -r2.8 tree-vectorizer.c
*** gcc/tree-vectorizer.c 10 Sep 2004 10:44:47 -0000 2.8
--- gcc/tree-vectorizer.c 22 Sep 2004 19:25:05 -0000
*************** vect_analyze_scalar_cycles (loop_vec_inf
*** 1973,1982 ****
static bool
vect_analyze_data_ref_dependence (struct data_reference *dra,
struct data_reference *drb,
! struct loop *loop)
{
bool differ_p;
struct data_dependence_relation *ddr;
if (!array_base_name_differ_p (dra, drb, &differ_p))
{
--- 2116,2131 ----
static bool
vect_analyze_data_ref_dependence (struct data_reference *dra,
struct data_reference *drb,
! struct loop *loop,
! loop_vec_info loop_info)
{
bool differ_p;
struct data_dependence_relation *ddr;
+ unsigned int i, loop_depth = 0;
+ struct loop *tloop;
+ struct subscript *subscript;
+ int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_info);
+ tree vf = NULL_TREE;
if (!array_base_name_differ_p (dra, drb, &differ_p))
{
*************** vect_analyze_data_ref_dependence (struct
*** 2000,2005 ****
--- 2149,2166 ----
if (DDR_ARE_DEPENDENT (ddr) == chrec_known)
return false;
+ /* Check distance vector. */
+ compute_distance_vector (ddr);
+ vf = build_int_cst (unsigned_type_node, vectorization_factor);
+
+ tloop = loop->outer;
+ for (i = 0; tloop; tloop = tloop->outer, loop_depth++);
+ loop_depth--;
+ subscript = DDR_SUBSCRIPT (ddr, loop_depth);
+ if (integer_zerop (SUB_DISTANCE (subscript))
+ || (tree_int_cst_compare (SUB_DISTANCE (subscript), vf) == 1))
+ return false;
+
if (vect_debug_stats (loop) || vect_debug_details (loop))
{
fprintf (dump_file,
*************** vect_analyze_data_ref_dependences (loop_
*** 2045,2051 ****
VARRAY_GENERIC_PTR (loop_write_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop))
return false;
}
}
--- 2206,2212 ----
VARRAY_GENERIC_PTR (loop_write_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop, loop_vinfo))
return false;
}
}
*************** vect_analyze_data_ref_dependences (loop_
*** 2062,2068 ****
struct data_reference *dra = VARRAY_GENERIC_PTR (loop_read_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop))
return false;
}
}
--- 2223,2229 ----
struct data_reference *dra = VARRAY_GENERIC_PTR (loop_read_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop, loop_vinfo))
return false;
}
}
*************** vect_analyze_loop (struct loop *loop)
*** 3275,3327 ****
}
! /* Analyze data dependences between the data-refs in the loop.
! FORNOW: fail at the first data dependence that we encounter. */
! ok = vect_analyze_data_ref_dependences (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data dependence.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze the access patterns of the data-refs in the loop (consecutive,
! complex, etc.). FORNOW: Only handle consecutive access pattern. */
! ok = vect_analyze_data_ref_accesses (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data access.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze the alignment of the data-refs in the loop.
! FORNOW: Only aligned accesses are handled. */
!
! ok = vect_analyze_data_refs_alignment (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data alignment.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Scan all the operations in the loop and make sure they are
! vectorizable. */
!
! ok = vect_analyze_operations (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad operation or unsupported loop bound.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
--- 3436,3486 ----
}
! /* Analyze the alignment of the data-refs in the loop.
! FORNOW: Only aligned accesses are handled. */
! ok = vect_analyze_data_refs_alignment (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data alignment.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Scan all the operations in the loop and make sure they are
! vectorizable. */
! ok = vect_analyze_operations (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad operation or unsupported loop bound.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
+ /* Analyze data dependences between the data-refs in the loop.
+ FORNOW: fail at the first data dependence that we encounter. */
! ok = vect_analyze_data_ref_dependences (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data dependence.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
+ /* Analyze the access patterns of the data-refs in the loop (consecutive,
+ complex, etc.). FORNOW: Only handle consecutive access pattern. */
! ok = vect_analyze_data_ref_accesses (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data access.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
[-- Attachment #3: Type: text/plain, Size: 1 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AV - Use distance vector
2004-09-22 19:54 ` Devang Patel
@ 2004-09-22 20:37 ` Richard Henderson
2004-09-22 22:19 ` Devang Patel
0 siblings, 1 reply; 9+ messages in thread
From: Richard Henderson @ 2004-09-22 20:37 UTC (permalink / raw)
To: Devang Patel; +Cc: GCC Patches
On Wed, Sep 22, 2004 at 12:35:47PM -0700, Devang Patel wrote:
> + || (tree_int_cst_compare (SUB_DISTANCE (subscript), vf) == 1))
tree_int_cst_compare is a tri-state function, as for qsort.
It returns <0, ==0, >0. Not necessarily 1.
Didn't you have some test for equality in there before as well?
r~
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AV - Use distance vector
2004-09-22 20:37 ` Richard Henderson
@ 2004-09-22 22:19 ` Devang Patel
2004-09-22 23:45 ` Richard Henderson
0 siblings, 1 reply; 9+ messages in thread
From: Devang Patel @ 2004-09-22 22:19 UTC (permalink / raw)
To: Richard Henderson; +Cc: GCC Patches
On Sep 22, 2004, at 12:54 PM, Richard Henderson wrote:
> On Wed, Sep 22, 2004 at 12:35:47PM -0700, Devang Patel wrote:
>> + || (tree_int_cst_compare (SUB_DISTANCE (subscript), vf) == 1))
>
> tree_int_cst_compare is a tri-state function, as for qsort.
> It returns <0, ==0, >0. Not necessarily 1.
It returns -1, 0 or 1.
>
> Didn't you have some test for equality in there before as well?
That was a think-o on my part.
-
Devang
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AV - Use distance vector
2004-09-22 22:19 ` Devang Patel
@ 2004-09-22 23:45 ` Richard Henderson
2004-09-28 20:04 ` Devang Patel
0 siblings, 1 reply; 9+ messages in thread
From: Richard Henderson @ 2004-09-22 23:45 UTC (permalink / raw)
To: Devang Patel; +Cc: GCC Patches
On Wed, Sep 22, 2004 at 02:21:23PM -0700, Devang Patel wrote:
> >tree_int_cst_compare is a tri-state function, as for qsort.
> >It returns <0, ==0, >0. Not necessarily 1.
>
> It returns -1, 0 or 1.
Do those satisfy <0, ==0, >0? Why yes, I think they do.
I really do mean not necessarily 1, no matter what the current
implementation of the function does. Please do as I ask.
r~
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AV - Use distance vector
2004-09-22 23:45 ` Richard Henderson
@ 2004-09-28 20:04 ` Devang Patel
2004-10-12 21:36 ` Ping : " Devang Patel
0 siblings, 1 reply; 9+ messages in thread
From: Devang Patel @ 2004-09-28 20:04 UTC (permalink / raw)
To: Richard Henderson; +Cc: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 922 bytes --]
OK. Dorit reminded me that I need to check distance vector for loop
nest and not subscript. Which means I need to use classic distance
vector and in turn I can avoid using tree_int_cst_compare.
How about following?
Bootstrapped and tested on powerpc-darwin.
Also bootstrapped using -ftree-vectorize.
Thanks,
-
Devang
2004-09-28 Devang Patel <dpatel@apple.com>
* tree-data-ref.c (compute_distance_vector,
build_classic_dist_vector):
Make externally visible.
* tree-data-ref.h (compute_distance_vector,
build_classic_dist_vector):
Export.
* tree-vectorizer.c (vect_analyze_data_ref_dependence): new
parameter,
loop_vinfo. Use distance vector.
(vect_analyze_data_ref_dependences): Supply new parameter.
(vect_analyze_loop): Analyze operations before data dependences.
testsuite
* gcc.dg/vect/vect-20040915-1.c: New test.
[-- Attachment #2: ifc2_fsf_mainline.2.3.diff --]
[-- Type: application/octet-stream, Size: 11119 bytes --]
Index: gcc/tree-data-ref.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.c,v
retrieving revision 2.8
diff -Idpatel.pbxuser -c -3 -p -r2.8 tree-data-ref.c
*** gcc/tree-data-ref.c 19 Sep 2004 18:01:47 -0000 2.8
--- gcc/tree-data-ref.c 28 Sep 2004 18:46:03 -0000
*************** init_data_ref (tree stmt,
*** 598,604 ****
/* When there exists a dependence relation, determine its distance
vector. */
! static void
compute_distance_vector (struct data_dependence_relation *ddr)
{
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
--- 598,604 ----
/* When there exists a dependence relation, determine its distance
vector. */
! void
compute_distance_vector (struct data_dependence_relation *ddr)
{
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
*************** subscript_dependence_tester (struct data
*** 1433,1439 ****
NB_LOOPS is the total number of loops we are considering.
FIRST_LOOP is the loop->num of the first loop. */
! static void
build_classic_dist_vector (struct data_dependence_relation *ddr,
int nb_loops, unsigned int first_loop)
{
--- 1433,1439 ----
NB_LOOPS is the total number of loops we are considering.
FIRST_LOOP is the loop->num of the first loop. */
! void
build_classic_dist_vector (struct data_dependence_relation *ddr,
int nb_loops, unsigned int first_loop)
{
Index: gcc/tree-data-ref.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.h,v
retrieving revision 2.4
diff -Idpatel.pbxuser -c -3 -p -r2.4 tree-data-ref.h
*** gcc/tree-data-ref.h 10 Sep 2004 15:09:38 -0000 2.4
--- gcc/tree-data-ref.h 28 Sep 2004 18:46:03 -0000
*************** struct data_dependence_relation
*** 147,152 ****
--- 147,155 ----
struct data_dependence_relation *initialize_data_dependence_relation
(struct data_reference *, struct data_reference *);
void compute_affine_dependence (struct data_dependence_relation *);
+ void compute_distance_vector (struct data_dependence_relation *);
+ void build_classic_dist_vector (struct data_dependence_relation *, int,
+ unsigned int);
extern void analyze_all_data_dependences (struct loops *);
extern void compute_data_dependences_for_loop (unsigned, struct loop *,
varray_type *, varray_type *);
Index: gcc/tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vectorizer.c,v
retrieving revision 2.12
diff -Idpatel.pbxuser -c -3 -p -r2.12 tree-vectorizer.c
*** gcc/tree-vectorizer.c 25 Sep 2004 14:48:03 -0000 2.12
--- gcc/tree-vectorizer.c 28 Sep 2004 18:46:03 -0000
*************** vect_analyze_scalar_cycles (loop_vec_inf
*** 2404,2414 ****
static bool
vect_analyze_data_ref_dependence (struct data_reference *dra,
struct data_reference *drb,
! struct loop *loop)
{
bool differ_p;
struct data_dependence_relation *ddr;
!
if (!array_base_name_differ_p (dra, drb, &differ_p))
{
if (vect_debug_stats (loop) || vect_debug_details (loop))
--- 2404,2419 ----
static bool
vect_analyze_data_ref_dependence (struct data_reference *dra,
struct data_reference *drb,
! struct loop *loop,
! loop_vec_info loop_info)
{
bool differ_p;
struct data_dependence_relation *ddr;
! int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_info);
! unsigned int loop_depth = 0;
! struct loop *tloop;
! int dist;
!
if (!array_base_name_differ_p (dra, drb, &differ_p))
{
if (vect_debug_stats (loop) || vect_debug_details (loop))
*************** vect_analyze_data_ref_dependence (struct
*** 2431,2436 ****
--- 2436,2459 ----
if (DDR_ARE_DEPENDENT (ddr) == chrec_known)
return false;
+ for (tloop = loop; tloop; tloop = tloop->inner)
+ loop_depth++;
+
+ /* Check distance vector. */
+ compute_distance_vector (ddr);
+ build_classic_dist_vector (ddr, loop_depth, loop->num);
+
+ dist = DDR_DIST_VECT (ddr)[loop_depth - 1];
+
+ /* Same loop iteration. */
+ if (dist == 0)
+ return false;
+
+ if (dist >= vectorization_factor)
+ /* Dependence distance does not create dependence, as far as vectorization
+ is concerned, in this case. */
+ return false;
+
if (vect_debug_stats (loop) || vect_debug_details (loop))
{
fprintf (dump_file,
*************** vect_analyze_data_ref_dependence (struct
*** 2447,2456 ****
/* Function vect_analyze_data_ref_dependences.
Examine all the data references in the loop, and make sure there do not
! exist any data dependences between them.
!
! TODO: dependences which distance is greater than the vectorization factor
! can be ignored. */
static bool
vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo)
--- 2470,2476 ----
/* Function vect_analyze_data_ref_dependences.
Examine all the data references in the loop, and make sure there do not
! exist any data dependences between them. */
static bool
vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo)
*************** vect_analyze_data_ref_dependences (loop_
*** 2476,2482 ****
VARRAY_GENERIC_PTR (loop_write_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop))
return false;
}
}
--- 2496,2502 ----
VARRAY_GENERIC_PTR (loop_write_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop, loop_vinfo))
return false;
}
}
*************** vect_analyze_data_ref_dependences (loop_
*** 2493,2499 ****
struct data_reference *dra = VARRAY_GENERIC_PTR (loop_read_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop))
return false;
}
}
--- 2513,2519 ----
struct data_reference *dra = VARRAY_GENERIC_PTR (loop_read_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop, loop_vinfo))
return false;
}
}
*************** vect_analyze_loop (struct loop *loop)
*** 4010,4059 ****
return NULL;
}
! /* Analyze data dependences between the data-refs in the loop.
! FORNOW: fail at the first data dependence that we encounter. */
! ok = vect_analyze_data_ref_dependences (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data dependence.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze the access patterns of the data-refs in the loop (consecutive,
! complex, etc.). FORNOW: Only handle consecutive access pattern. */
! ok = vect_analyze_data_ref_accesses (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data access.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze the alignment of the data-refs in the loop.
! FORNOW: Only aligned accesses are handled. */
! ok = vect_analyze_data_refs_alignment (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data alignment.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Scan all the operations in the loop and make sure they are
! vectorizable. */
! ok = vect_analyze_operations (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad operation or unsupported loop bound.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
--- 4030,4079 ----
return NULL;
}
! /* Analyze the alignment of the data-refs in the loop.
! FORNOW: Only aligned accesses are handled. */
! ok = vect_analyze_data_refs_alignment (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data alignment.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Scan all the operations in the loop and make sure they are
! vectorizable. */
! ok = vect_analyze_operations (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad operation or unsupported loop bound.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze data dependences between the data-refs in the loop.
! FORNOW: fail at the first data dependence that we encounter. */
! ok = vect_analyze_data_ref_dependences (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data dependence.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze the access patterns of the data-refs in the loop (consecutive,
! complex, etc.). FORNOW: Only handle consecutive access pattern. */
! ok = vect_analyze_data_ref_accesses (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data access.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
Index: gcc/testsuite/gcc.dg/vect/vect-20040915-1.c
===================================================================
RCS file: gcc/testsuite/gcc.dg/vect/vect-20040915-1.c
diff -N gcc/testsuite/gcc.dg/vect/vect-20040915-1.c
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/gcc.dg/vect/vect-20040915-1.c 28 Sep 2004 18:46:08 -0000
***************
*** 0 ****
--- 1,74 ----
+ /* { dg-do run } */
+ /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+ /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* x86_64-*-* } } */
+
+ #include <stdarg.h>
+ #include <signal.h>
+
+ #define N 64
+ #define MAX 42
+
+ extern void abort(void);
+
+ int main ()
+ {
+ int A[N];
+ int B[N];
+ int C[N];
+ int D[N];
+
+ int i, j;
+
+ for (i = 0; i < N; i++)
+ {
+ A[i] = i;
+ B[i] = i;
+ C[i] = i;
+ D[i] = i;
+ }
+ /* Vectorizable */
+ for (i = 0; i < 16; i++)
+ {
+ A[i] = A[i+20];
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ if (A[i] != A[i+20])
+ abort ();
+ }
+
+ /* Vectorizable */
+ for (i = 0; i < 16; i++)
+ {
+ B[i] = B[i] + 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ if (B[i] != C[i] + 5)
+ abort ();
+ }
+
+ /* Not vectorizable */
+ for (i = 0; i < 4; i++)
+ {
+ C[i] = C[i+3];
+ }
+
+ /* check results: */
+ for (i = 0; i < 4; i++)
+ {
+ if (C[i] != D[i+3])
+ abort ();
+ }
+
+
+ return 0;
+ }
+
+
+
+ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
[-- Attachment #3: Type: text/plain, Size: 1 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Ping : [PATCH] AV - Use distance vector
2004-09-28 20:04 ` Devang Patel
@ 2004-10-12 21:36 ` Devang Patel
0 siblings, 0 replies; 9+ messages in thread
From: Devang Patel @ 2004-10-12 21:36 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 657 bytes --]
This time ping! with updated patch based on Dorit and Ira's feedback.
Thanks,
-
Devang
2004-10-12 Devang Patel <dpatel@apple.com>
* tree-data-ref.c (compute_distance_vector,
build_classic_dist_vector):
Make externally visible.
* tree-data-ref.h (compute_distance_vector,
build_classic_dist_vector):
Export.
* tree-vectorizer.c (vect_analyze_data_ref_dependence): new
parameter,
loop_vinfo. Use distance vector.
(vect_analyze_data_ref_dependences): Supply new parameter.
(vect_analyze_loop): Analyze operations before data dependences.
(vect_build_dist_vector): New.
[-- Attachment #2: ifc2_fsf_mainline.2.4.diff --]
[-- Type: application/octet-stream, Size: 11013 bytes --]
Index: gcc/tree-data-ref.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.c,v
retrieving revision 2.8
diff -Idpatel.pbxuser -c -3 -p -r2.8 tree-data-ref.c
*** gcc/tree-data-ref.c 19 Sep 2004 18:01:47 -0000 2.8
--- gcc/tree-data-ref.c 12 Oct 2004 21:14:28 -0000
*************** init_data_ref (tree stmt,
*** 598,604 ****
/* When there exists a dependence relation, determine its distance
vector. */
! static void
compute_distance_vector (struct data_dependence_relation *ddr)
{
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
--- 598,604 ----
/* When there exists a dependence relation, determine its distance
vector. */
! void
compute_distance_vector (struct data_dependence_relation *ddr)
{
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
*************** subscript_dependence_tester (struct data
*** 1433,1439 ****
NB_LOOPS is the total number of loops we are considering.
FIRST_LOOP is the loop->num of the first loop. */
! static void
build_classic_dist_vector (struct data_dependence_relation *ddr,
int nb_loops, unsigned int first_loop)
{
--- 1433,1439 ----
NB_LOOPS is the total number of loops we are considering.
FIRST_LOOP is the loop->num of the first loop. */
! void
build_classic_dist_vector (struct data_dependence_relation *ddr,
int nb_loops, unsigned int first_loop)
{
Index: gcc/tree-data-ref.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.h,v
retrieving revision 2.4
diff -Idpatel.pbxuser -c -3 -p -r2.4 tree-data-ref.h
*** gcc/tree-data-ref.h 10 Sep 2004 15:09:38 -0000 2.4
--- gcc/tree-data-ref.h 12 Oct 2004 21:14:28 -0000
*************** struct data_dependence_relation
*** 147,152 ****
--- 147,155 ----
struct data_dependence_relation *initialize_data_dependence_relation
(struct data_reference *, struct data_reference *);
void compute_affine_dependence (struct data_dependence_relation *);
+ void compute_distance_vector (struct data_dependence_relation *);
+ void build_classic_dist_vector (struct data_dependence_relation *, int,
+ unsigned int);
extern void analyze_all_data_dependences (struct loops *);
extern void compute_data_dependences_for_loop (unsigned, struct loop *,
varray_type *, varray_type *);
Index: gcc/tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vectorizer.c,v
retrieving revision 2.13
diff -Idpatel.pbxuser -c -3 -p -r2.13 tree-vectorizer.c
*** gcc/tree-vectorizer.c 28 Sep 2004 07:59:52 -0000 2.13
--- gcc/tree-vectorizer.c 12 Oct 2004 21:14:29 -0000
*************** stmt_vec_info new_stmt_vec_info (tree st
*** 214,219 ****
--- 218,226 ----
static bool vect_debug_stats (struct loop *loop);
static bool vect_debug_details (struct loop *loop);
+ /* Utilities for dependence analysis. */
+ static unsigned int vect_build_dist_vector (struct loop *,
+ struct data_dependence_relation *);
/* Function new_stmt_vec_info.
*************** vect_analyze_scalar_cycles (loop_vec_inf
*** 2394,2399 ****
--- 2586,2621 ----
return true;
}
+ /* Function vect_build_dist_vector.
+
+ Build classic dist vector for dependence relation DDR using LOOP's loop
+ nest. Return LOOP's depth in its loop nest. */
+
+ static unsigned int
+ vect_build_dist_vector (struct loop *loop,
+ struct data_dependence_relation *ddr)
+ {
+ struct loop *loop_nest = loop;
+ unsigned int loop_depth = 1;
+
+ /* Find loop nest and loop depth. */
+ while (loop_nest)
+ {
+ if (loop_nest->outer && loop_nest->outer->outer)
+ {
+ loop_nest = loop_nest->outer;
+ loop_depth++;
+ }
+ else
+ break;
+ }
+
+ /* Compute distance vector. */
+ compute_distance_vector (ddr);
+ build_classic_dist_vector (ddr, loop_depth, loop_nest->num);
+
+ return loop_depth - 1;
+ }
/* Function vect_analyze_data_ref_dependence.
*************** vect_analyze_scalar_cycles (loop_vec_inf
*** 2403,2413 ****
static bool
vect_analyze_data_ref_dependence (struct data_reference *dra,
struct data_reference *drb,
! struct loop *loop)
{
bool differ_p;
struct data_dependence_relation *ddr;
!
if (!array_base_name_differ_p (dra, drb, &differ_p))
{
if (vect_debug_stats (loop) || vect_debug_details (loop))
--- 2625,2639 ----
static bool
vect_analyze_data_ref_dependence (struct data_reference *dra,
struct data_reference *drb,
! loop_vec_info loop_info)
{
bool differ_p;
struct data_dependence_relation *ddr;
! int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_info);
! struct loop *loop = LOOP_VINFO_LOOP (loop_info);
! unsigned int loop_depth = 0;
! int dist;
!
if (!array_base_name_differ_p (dra, drb, &differ_p))
{
if (vect_debug_stats (loop) || vect_debug_details (loop))
*************** vect_analyze_data_ref_dependence (struct
*** 2429,2434 ****
--- 2655,2676 ----
if (DDR_ARE_DEPENDENT (ddr) == chrec_known)
return false;
+
+ if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
+ return true;
+
+ loop_depth = vect_build_dist_vector (loop, ddr);
+
+ dist = DDR_DIST_VECT (ddr)[loop_depth];
+
+ /* Same loop iteration. */
+ if (dist == 0)
+ return false;
+
+ if (dist >= vectorization_factor)
+ /* Dependence distance does not create dependence, as far as vectorization
+ is concerned, in this case. */
+ return false;
if (vect_debug_stats (loop) || vect_debug_details (loop))
{
*************** vect_analyze_data_ref_dependence (struct
*** 2446,2455 ****
/* Function vect_analyze_data_ref_dependences.
Examine all the data references in the loop, and make sure there do not
! exist any data dependences between them.
!
! TODO: dependences which distance is greater than the vectorization factor
! can be ignored. */
static bool
vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo)
--- 2688,2694 ----
/* Function vect_analyze_data_ref_dependences.
Examine all the data references in the loop, and make sure there do not
! exist any data dependences between them. */
static bool
vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo)
*************** vect_analyze_data_ref_dependences (loop_
*** 2457,2463 ****
unsigned int i, j;
varray_type loop_write_refs = LOOP_VINFO_DATAREF_WRITES (loop_vinfo);
varray_type loop_read_refs = LOOP_VINFO_DATAREF_READS (loop_vinfo);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
/* Examine store-store (output) dependences. */
--- 2696,2701 ----
*************** vect_analyze_data_ref_dependences (loop_
*** 2475,2481 ****
VARRAY_GENERIC_PTR (loop_write_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop))
return false;
}
}
--- 2713,2719 ----
VARRAY_GENERIC_PTR (loop_write_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop_vinfo))
return false;
}
}
*************** vect_analyze_data_ref_dependences (loop_
*** 2492,2498 ****
struct data_reference *dra = VARRAY_GENERIC_PTR (loop_read_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop))
return false;
}
}
--- 2730,2736 ----
struct data_reference *dra = VARRAY_GENERIC_PTR (loop_read_refs, i);
struct data_reference *drb =
VARRAY_GENERIC_PTR (loop_write_refs, j);
! if (vect_analyze_data_ref_dependence (dra, drb, loop_vinfo))
return false;
}
}
*************** vect_analyze_loop (struct loop *loop)
*** 4009,4058 ****
return NULL;
}
! /* Analyze data dependences between the data-refs in the loop.
! FORNOW: fail at the first data dependence that we encounter. */
! ok = vect_analyze_data_ref_dependences (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data dependence.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze the access patterns of the data-refs in the loop (consecutive,
! complex, etc.). FORNOW: Only handle consecutive access pattern. */
! ok = vect_analyze_data_ref_accesses (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data access.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze the alignment of the data-refs in the loop.
! FORNOW: Only aligned accesses are handled. */
! ok = vect_analyze_data_refs_alignment (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data alignment.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Scan all the operations in the loop and make sure they are
! vectorizable. */
! ok = vect_analyze_operations (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad operation or unsupported loop bound.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
--- 4246,4295 ----
return NULL;
}
! /* Analyze the alignment of the data-refs in the loop.
! FORNOW: Only aligned accesses are handled. */
! ok = vect_analyze_data_refs_alignment (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data alignment.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Scan all the operations in the loop and make sure they are
! vectorizable. */
! ok = vect_analyze_operations (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad operation or unsupported loop bound.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze data dependences between the data-refs in the loop.
! FORNOW: fail at the first data dependence that we encounter. */
! ok = vect_analyze_data_ref_dependences (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data dependence.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
! /* Analyze the access patterns of the data-refs in the loop (consecutive,
! complex, etc.). FORNOW: Only handle consecutive access pattern. */
! ok = vect_analyze_data_ref_accesses (loop_vinfo);
if (!ok)
{
if (vect_debug_details (loop))
! fprintf (dump_file, "bad data access.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-10-12 21:27 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-16 17:01 [PATCH] AV - Use distance vector Devang Patel
2004-09-21 22:07 ` Richard Henderson
2004-09-21 22:17 ` Devang Patel
2004-09-22 19:54 ` Devang Patel
2004-09-22 20:37 ` Richard Henderson
2004-09-22 22:19 ` Devang Patel
2004-09-22 23:45 ` Richard Henderson
2004-09-28 20:04 ` Devang Patel
2004-10-12 21:36 ` Ping : " Devang Patel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).