From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12842 invoked by alias); 11 Mar 2013 09:10:27 -0000 Received: (qmail 12830 invoked by uid 22791); 11 Mar 2013 09:10:25 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-we0-f177.google.com (HELO mail-we0-f177.google.com) (74.125.82.177) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Mar 2013 09:10:09 +0000 Received: by mail-we0-f177.google.com with SMTP id d7so3245798wer.22 for ; Mon, 11 Mar 2013 02:10:08 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.194.77.129 with SMTP id s1mr17488461wjw.17.1362993007384; Mon, 11 Mar 2013 02:10:07 -0700 (PDT) Received: by 10.194.56.100 with HTTP; Mon, 11 Mar 2013 02:10:07 -0700 (PDT) In-Reply-To: References: Date: Mon, 11 Mar 2013 09:10:00 -0000 Message-ID: Subject: Re: [patch] make gcse.c respect -fno-gcse-lm From: Richard Biener To: Steven Bosscher Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-03/txt/msg00394.txt.bz2 On Mon, Mar 11, 2013 at 12:17 AM, Steven Bosscher wrote: > Hello, > > RTL PRE has an option to disable load motion. This option works fine, > except that all analysis for load motion is still performed. > > This patch stops gcse.c from recording memory sets for -fno-gcse-lm, > and conservatively returns true in oprs_unchanged_p for any MEM. > > Bootstrapped&tested on {x86_64,powerpc64}-unknown-linux-gnu. OK? Ok. Thanks, Richard. > Ciao! > Steven > > > * gcse.c (oprs_unchanged_p): Respect flag_gcse_lm. > (record_last_mem_set_info): Likewise. > > Index: gcse.c > =================================================================== > --- gcse.c (revision 196576) > +++ gcse.c (working copy) > @@ -890,8 +890,9 @@ oprs_unchanged_p (const_rtx x, const_rtx > } > > case MEM: > - if (load_killed_in_block_p (current_bb, DF_INSN_LUID (insn), > - x, avail_p)) > + if (! flag_gcse_lm > + || load_killed_in_block_p (current_bb, DF_INSN_LUID (insn), > + x, avail_p)) > return 0; > else > return oprs_unchanged_p (XEXP (x, 0), insn, avail_p); > @@ -1471,10 +1472,14 @@ canon_list_insert (rtx dest ATTRIBUTE_UN > static void > record_last_mem_set_info (rtx insn) > { > - int bb = BLOCK_FOR_INSN (insn)->index; > + int bb; > + > + if (! flag_gcse_lm) > + return; > > /* load_killed_in_block_p will handle the case of calls clobbering > everything. */ > + bb = BLOCK_FOR_INSN (insn)->index; > modify_mem_list[bb].safe_push (insn); > bitmap_set_bit (modify_mem_list_set, bb);