From patchwork Wed Aug 4 14:52:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bingfeng Mei X-Patchwork-Id: 60857 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5308DB70A5 for ; Thu, 5 Aug 2010 00:53:22 +1000 (EST) Received: (qmail 17592 invoked by alias); 4 Aug 2010 14:53:20 -0000 Received: (qmail 17577 invoked by uid 22791); 4 Aug 2010 14:53:18 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mms1.broadcom.com (HELO mms1.broadcom.com) (216.31.210.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Aug 2010 14:53:10 +0000 Received: from [10.16.192.232] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Wed, 04 Aug 2010 07:53:01 -0700 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from SJEXCHCCR02.corp.ad.broadcom.com ([10.16.192.130]) by SJEXCHHUB02.corp.ad.broadcom.com ([10.16.192.232]) with mapi; Wed, 4 Aug 2010 07:53:01 -0700 From: "Bingfeng Mei" To: "gcc-patches@gcc.gnu.org" cc: "Richard Guenther" Date: Wed, 4 Aug 2010 07:52:55 -0700 Subject: [PATCH] Use rtx_refs_may_alias_p instead of alias_sets_conflict_p in Message-ID: <7FB04A5C213E9943A72EE127DB74F0ADA6899756DA@SJEXCHCCR02.corp.ad.broadcom.com> x-cr-puzzleid: {B747F369-6704-4969-81EB-7A04E0D4E9BB} x-cr-hashedpuzzle: Al3/ A2ZB BPG8 DpO2 DwXK EnUp HRQm Hsq+ I3cm JA54 J4U9 K6Lc MdSl PFn1 Rzqf Sfam; 2; ZwBjAGMALQBwAGEAdABjAGgAZQBzAEAAZwBjAGMALgBnAG4AdQAuAG8AcgBnADsAcgBpAGMAaABhAHIAZAAuAGcAdQBlAG4AdABoAGUAcgBAAGcAbQBhAGkAbAAuAGMAbwBtAA==; Sosha1_v1; 7; {B747F369-6704-4969-81EB-7A04E0D4E9BB}; YgBtAGUAaQBAAGIAcgBvAGEAZABjAG8AbQAuAGMAbwBtAA==; Wed, 04 Aug 2010 14:52:55 GMT; WwBQAEEAVABDAEgAXQAgAFUAcwBlACAAcgB0AHgAXwByAGUAZgBzAF8AbQBhAHkAXwBhAGwAaQBhAHMAXwBwACAAaQBuAHMAdABlAGEAZAAgAG8AZgAgAGEAbABpAGEAcwBfAHMAZQB0AHMAXwBjAG8AbgBmAGwAaQBjAHQAXwBwACAAaQBuAA== MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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;