From patchwork Wed Aug 4 14:52:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Use rtx_refs_may_alias_p instead of alias_sets_conflict_p in Date: Wed, 04 Aug 2010 04:52:55 -0000 From: Bingfeng Mei X-Patchwork-Id: 60857 Message-Id: <7FB04A5C213E9943A72EE127DB74F0ADA6899756DA@SJEXCHCCR02.corp.ad.broadcom.com> To: "gcc-patches@gcc.gnu.org" Cc: "Richard Guenther" 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 * 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;