From patchwork Tue Aug 24 16:17:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 62608 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 F0CECB70A7 for ; Wed, 25 Aug 2010 02:18:19 +1000 (EST) Received: (qmail 26497 invoked by alias); 24 Aug 2010 16:18:15 -0000 Received: (qmail 26396 invoked by uid 22791); 24 Aug 2010 16:18:12 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_TM X-Spam-Check-By: sourceware.org Received: from mail-pv0-f175.google.com (HELO mail-pv0-f175.google.com) (74.125.83.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Aug 2010 16:18:07 +0000 Received: by pvg6 with SMTP id 6so2967515pvg.20 for ; Tue, 24 Aug 2010 09:18:05 -0700 (PDT) Received: by 10.114.60.5 with SMTP id i5mr7921091waa.146.1282666685379; Tue, 24 Aug 2010 09:18:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.163.145 with HTTP; Tue, 24 Aug 2010 09:17:25 -0700 (PDT) In-Reply-To: References: <1278625285-12667-1-git-send-email-sebpop@gmail.com> <1278625285-12667-4-git-send-email-sebpop@gmail.com> From: Sebastian Pop Date: Tue, 24 Aug 2010 11:17:25 -0500 Message-ID: Subject: Re: [PATCH 3/4] Do not check whether memory references accessed in every iteration trap. To: Richard Guenther Cc: gcc-patches@gcc.gnu.org, matz@suse.de 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 On Tue, Aug 24, 2010 at 10:11, Sebastian Pop wrote: > On Tue, Aug 24, 2010 at 05:00, Richard Guenther wrote: >> Now I just noticed that -ftree-loop-if-convert-memory-writes is long >> for -ftree-loop-if-convert-stores.  But I suppose it doesn't really > > This sounds much better, thanks for the suggestion. Here are the changes on top of the previous patches. Sebastian From b72f67fe79aa1eca277c150a99c7d2e8210dd601 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Tue, 24 Aug 2010 11:12:29 -0500 Subject: [PATCH] Rename flag -ftree-loop-if-convert-stores. --- gcc/common.opt | 4 ++-- gcc/doc/invoke.texi | 2 +- gcc/tree-if-conv.c | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt index bffc39b..675ca35 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -712,8 +712,8 @@ ftree-loop-if-convert Common Report Var(flag_tree_loop_if_convert) Init(-1) Optimization Convert conditional jumps in innermost loops to branchless equivalents -ftree-loop-if-convert-memory-writes -Common Report Var(flag_tree_loop_if_convert_memory_writes) Optimization +ftree-loop-if-convert-stores +Common Report Var(flag_tree_loop_if_convert_stores) Optimization Also if-convert conditional jumps containing memory writes ; -finhibit-size-directive inhibits output of .size for ELF. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 23559ba..7e069f0 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -6932,7 +6932,7 @@ the innermost loops in order to improve the ability of the vectorization pass to handle these loops. This is enabled by default if vectorization is enabled. -@item -ftree-loop-if-convert-memory-writes +@item -ftree-loop-if-convert-stores Attempt to also if-convert conditional jumps containing memory writes. This transformation can be unsafe for multi-threaded programs as it transforms conditional memory writes into unconditional memory writes. diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index cc06522..86b8f26 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -393,7 +393,7 @@ bb_with_exit_edge_p (struct loop *loop, basic_block bb) PHI is not if-convertible if: - it has more than 2 arguments. - When the flag_tree_loop_if_convert_memory_writes is not set, PHI is not + When the flag_tree_loop_if_convert_stores is not set, PHI is not if-convertible if: - a virtual PHI is immediately used in another PHI node, - there is a virtual PHI in a BB other than the loop->header. */ @@ -414,10 +414,10 @@ if_convertible_phi_p (struct loop *loop, basic_block bb, gimple phi) return false; } - if (flag_tree_loop_if_convert_memory_writes) + if (flag_tree_loop_if_convert_stores) return true; - /* When the flag_tree_loop_if_convert_memory_writes is not set, check + /* When the flag_tree_loop_if_convert_stores is not set, check that there are no memory writes in the branches of the loop to be if-converted. */ if (!is_gimple_reg (SSA_NAME_VAR (gimple_phi_result (phi)))) @@ -648,7 +648,7 @@ if_convertible_gimple_assign_stmt_p (gimple stmt, return false; } - if (flag_tree_loop_if_convert_memory_writes) + if (flag_tree_loop_if_convert_stores) { if (ifcvt_could_trap_p (stmt, refs)) { @@ -1013,7 +1013,7 @@ if_convertible_loop_p_1 (struct loop *loop, if (!res) return false; - if (flag_tree_loop_if_convert_memory_writes) + if (flag_tree_loop_if_convert_stores) { data_reference_p dr; @@ -1098,7 +1098,7 @@ if_convertible_loop_p (struct loop *loop) ddrs = VEC_alloc (ddr_p, heap, 25); res = if_convertible_loop_p_1 (loop, &refs, &ddrs); - if (flag_tree_loop_if_convert_memory_writes) + if (flag_tree_loop_if_convert_stores) { data_reference_p dr; unsigned int i; @@ -1335,7 +1335,7 @@ insert_gimplified_predicates (loop_p loop) stmts = bb_predicate_gimplified_stmts (bb); if (stmts) { - if (flag_tree_loop_if_convert_memory_writes) + if (flag_tree_loop_if_convert_stores) { /* Insert the predicate of the BB just after the label, as the if-conversion of memory writes will use this @@ -1561,7 +1561,7 @@ combine_blocks (struct loop *loop) insert_gimplified_predicates (loop); predicate_all_scalar_phis (loop); - if (flag_tree_loop_if_convert_memory_writes) + if (flag_tree_loop_if_convert_stores) predicate_mem_writes (loop); /* Merge basic blocks: first remove all the edges in the loop, @@ -1665,7 +1665,7 @@ tree_if_conversion (struct loop *loop) on-the-fly. */ combine_blocks (loop); - if (flag_tree_loop_if_convert_memory_writes) + if (flag_tree_loop_if_convert_stores) mark_sym_for_renaming (gimple_vop (cfun)); changed = true; @@ -1704,7 +1704,7 @@ main_tree_if_conversion (void) if (changed) todo |= TODO_cleanup_cfg; - if (changed && flag_tree_loop_if_convert_memory_writes) + if (changed && flag_tree_loop_if_convert_stores) todo |= TODO_update_ssa_only_virtuals; return todo; @@ -1717,7 +1717,7 @@ gate_tree_if_conversion (void) { return ((flag_tree_vectorize && flag_tree_loop_if_convert != 0) || flag_tree_loop_if_convert == 1 - || flag_tree_loop_if_convert_memory_writes == 1); + || flag_tree_loop_if_convert_stores == 1); } struct gimple_opt_pass pass_if_conversion = -- 1.7.0.4