This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Limit VDEF walking in IPA-SRA when looking for potential modifications
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Guenther <rguenther at suse dot de>
- Date: Mon, 2 Nov 2009 20:56:34 +0100
- Subject: [PATCH] Limit VDEF walking in IPA-SRA when looking for potential modifications
Hi,
the patch below limits walking of VDEFs when searching for potential
modifications of what a parameter points to by providing a common
bitmap to various invocations of walk_aliased_vdefs which look for
alias vdefs of the same thing.
This is not a regression fix but may avoid some unnecessary costly
walks and the scope of the patch is small. Therefore I'm still
proposing to commit this to trunk. I have bootstrapped and tested the
patch on x86_64-linux with "yes" and "release" checking (both with
Ada).
What do you think?
Martin
2009-11-02 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (analyze_modified_params): Pass a common bitmap to
walk_aliased_vdefs.
Index: mine/gcc/tree-sra.c
===================================================================
--- mine.orig/gcc/tree-sra.c
+++ mine/gcc/tree-sra.c
@@ -2825,6 +2825,7 @@ analyze_modified_params (VEC (access_p,
repr = repr->next_grp)
{
VEC (access_p, heap) *access_vec;
+ bitmap visited;
int j, access_count;
tree parm;
@@ -2835,6 +2836,7 @@ analyze_modified_params (VEC (access_p,
|| repr->grp_maybe_modified)
continue;
+ visited = BITMAP_ALLOC (NULL);
access_vec = get_base_access_vector (parm);
access_count = VEC_length (access_p, access_vec);
for (j = 0; j < access_count; j++)
@@ -2847,10 +2849,11 @@ analyze_modified_params (VEC (access_p,
access = VEC_index (access_p, access_vec, j);
ao_ref_init (&ar, access->expr);
walk_aliased_vdefs (&ar, gimple_vuse (access->stmt),
- mark_maybe_modified, repr, NULL);
+ mark_maybe_modified, repr, &visited);
if (repr->grp_maybe_modified)
break;
}
+ BITMAP_FREE (visited);
}
}
}