This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Use rtx_refs_may_alias_p instead of alias_sets_conflict_p in
- From: "Bingfeng Mei" <bmei at broadcom dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: "Richard Guenther" <richard dot guenther at gmail dot com>
- Date: Wed, 4 Aug 2010 07:52:55 -0700
- Subject: [PATCH] Use rtx_refs_may_alias_p instead of alias_sets_conflict_p in
Hi,
This patch uses rtx_refs_may_alias_p instead of alias_sets_conflict_p to
get more accurate alias set information in walk_mems_2, which is used
in building DDG. In the following example, no false cross-iteration
dependence is drawn between writing to a[i] and reading b[i] in
next iteration after the patch.
Impact for compile-time is minimal because it only applies before modulo
scheduling. Bootstrapped and tested on x86_64-unknown-linux-gnu.
OK for trunk?
void foo(int * restrict a, int * restrict b, int n)
{
int i;
for(i = 0; i < n; i++)
{
a[i] = b[i] * 100;
}
}
Cheers,
Bingfeng Mei
2010-08-04 Bingfeng Mei <bmei@broadcom.com>
* alias.c (walk_mems_2): Call rtx_refs_may_alias_p
instead of alias_sets_conflict_p to get more accurate
alias set information.
Index: alias.c
===================================================================
--- alias.c (revision 162821)
+++ alias.c (working copy)
@@ -454,7 +454,7 @@
{
if (MEM_P (*x))
{
- if (alias_sets_conflict_p (MEM_ALIAS_SET(*x), MEM_ALIAS_SET(mem)))
+ if (rtx_refs_may_alias_p (*x, mem, true))
return 1;
return -1;