This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug tree-optimization/32377] can't determine dependence (source/destination overlap without more than size)
- From: "Sebastian Pop" <sebpop at gmail dot com>
- To: gcc-bugzilla at gcc dot gnu dot org, "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 4 Jul 2007 09:21:10 +0200
- Subject: Re: [Bug tree-optimization/32377] can't determine dependence (source/destination overlap without more than size)
- References: <bug-32377-33@http.gcc.gnu.org/bugzilla/> <20070703164358.24373.qmail@sourceware.org>
> I can submit a patch for merging that part of code in trunk if you need
> this flag to test if you are in one or the other case.
I guess we can't vectorize the loop in this PR without it, since we have to
distinguish between the cases in comment #7 (the first loop should not be
vectorized and the second one should).
I have committed the attached patch to trunk.
Sebastian
2007-07-04 Sebastian Pop <sebpop@gmail.com>
* tree-data-ref.h (data_dependence_relation): New flag reversed_p.
(DDR_REVERSED_P): New.
* tree-data-ref.c (initialize_data_dependence_relation,
build_classic_dist_vector): Set DDR_REVERSED_P.
Index: tree-data-ref.c
===================================================================
--- tree-data-ref.c (revision 126305)
+++ tree-data-ref.c (working copy)
@@ -1208,6 +1208,7 @@ initialize_data_dependence_relation (str
DDR_A (res) = a;
DDR_B (res) = b;
DDR_LOOP_NEST (res) = NULL;
+ DDR_REVERSED_P (res) = false;
if (a == NULL || b == NULL)
{
@@ -2996,6 +2997,7 @@ build_classic_dist_vector (struct data_d
build_classic_dist_vector_1 (ddr, DDR_B (ddr), DDR_A (ddr),
save_v, &init_b, &index_carry);
save_dist_v (ddr, save_v);
+ DDR_REVERSED_P (ddr) = true;
/* In this case there is a dependence forward for all the
outer loops:
Index: tree-data-ref.h
===================================================================
--- tree-data-ref.h (revision 126304)
+++ tree-data-ref.h (working copy)
@@ -251,6 +251,9 @@ struct data_dependence_relation
/* The classic distance vector. */
VEC (lambda_vector, heap) *dist_vects;
+
+ /* Is the dependence reversed with respect to the lexicographic order? */
+ bool reversed_p;
};
typedef struct data_dependence_relation *ddr_p;
@@ -281,6 +284,7 @@ DEF_VEC_ALLOC_P(ddr_p,heap);
VEC_index (lambda_vector, DDR_DIR_VECTS (DDR), I)
#define DDR_DIST_VECT(DDR, I) \
VEC_index (lambda_vector, DDR_DIST_VECTS (DDR), I)
+#define DDR_REVERSED_P(DDR) DDR->reversed_p