Ira Rosen - Re: [patch, 4.1.2, 4.2.1, 4.3] Fix a bug in pointer dependency test (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
- From: Ira Rosen
- To: Diego Novillo
- Cc: gcc-patches at gnu dot org, Zdenek Dvorak
- Date: Thu, 22 Feb 2007 14:54:30 +0200
- Subject: Re: [patch, 4.1.2, 4.2.1, 4.3] Fix a bug in pointer dependency test
Diego Novillo dnovillo@redhat.com wrote on 03/02/2007 00:02:21:
Ira Rosen wrote on 01/15/07 05:49:
+/* Given two tags return TRUE if their may-alias sets intersect. */ + +bool +may_aliases_intersect (tree tag1, tree tag2) +{
- struct pointer_set_t *set1 = pointer_set_create ();
- unsigned i;
- VEC(tree,gc) *may_aliases1 = may_aliases (tag1);
- VEC(tree,gc) *may_aliases2 = may_aliases (tag2);
- tree sym;
- /* Insert all the symbols from the first may-alias set into the
pointer-set. */
- for (i = 0; VEC_iterate (tree, may_aliases1, i, sym); i++)
- pointer_set_insert (set1, sym);
- /* Go through the second may-alias set and check if it contains symbols that
are common with the first set. */
- for (i = 0; VEC_iterate (tree, may_aliases2, i, sym); i++)
- if (pointer_set_contains (set1, sym))
{
pointer_set_destroy (set1);
return true;
}
- pointer_set_destroy (set1);
- return false; +}
- In mainline you no longer need this after Dan's bitmap conversion for alias sets.
Right. I can commit then the relevant part of Zdenek's predictive commoning patch along with the test case (bootstrapped and tested on ppc-linux):
Index: tree-data-ref.c
*** tree-data-ref.c (revision 122221) --- tree-data-ref.c (working copy) *************** ptr_ptr_may_alias_p (tree ptr_a, tree pt *** 172,177 **** --- 172,178 ---- tree tag_a = NULL_TREE, tag_b = NULL_TREE; struct ptr_info_def *pi_a = DR_PTR_INFO (dra); struct ptr_info_def *pi_b = DR_PTR_INFO (drb);
bitmap bal1, bal2;
if (pi_a && pi_a->name_mem_tag && pi_b && pi_b->name_mem_tag) {
*************** ptr_ptr_may_alias_p (tree ptr_a, tree pt *** 192,198 **** if (!tag_b) return false; } ! *aliased = (tag_a == tag_b); return true; }
--- 193,211 ---- if (!tag_b) return false; } ! bal1 = BITMAP_ALLOC (NULL); ! bitmap_set_bit (bal1, DECL_UID (tag_a)); ! if (MTAG_P (tag_a) && MTAG_ALIASES (tag_a)) ! bitmap_ior_into (bal1, MTAG_ALIASES (tag_a)); ! ! bal2 = BITMAP_ALLOC (NULL); ! bitmap_set_bit (bal2, DECL_UID (tag_b)); ! if (MTAG_P (tag_b) && MTAG_ALIASES (tag_b)) ! bitmap_ior_into (bal2, MTAG_ALIASES (tag_b)); ! *aliased = bitmap_intersect_p (bal1, bal2); ! ! BITMAP_FREE (bal1); ! BITMAP_FREE (bal2); return true; }
Or just to wait until predictive commoning goes in?
Thanks, Ira
- Follow-Ups:
- Re: [patch, 4.1.2, 4.2.1, 4.3] Fix a bug in pointer dependency test
* From: Diego Novillo - Re: [patch, 4.1.2, 4.2.1, 4.3] Fix a bug in pointer dependency test
* From: Daniel Berlin
- Re: [patch, 4.1.2, 4.2.1, 4.3] Fix a bug in pointer dependency test
- References:
- Re: [patch, 4.1.2, 4.2.1, 4.3] Fix a bug in pointer dependency test
* From: Diego Novillo
- Re: [patch, 4.1.2, 4.2.1, 4.3] Fix a bug in pointer dependency test
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |