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]

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);

*************** 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]