From patchwork Thu Oct 28 22:58:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 69510 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 4172EB70DF for ; Fri, 29 Oct 2010 09:59:27 +1100 (EST) Received: (qmail 7932 invoked by alias); 28 Oct 2010 22:59:18 -0000 Received: (qmail 7842 invoked by uid 22791); 28 Oct 2010 22:59:17 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Oct 2010 22:59:11 +0000 Received: by mail-yx0-f175.google.com with SMTP id 42so1758523yxe.20 for ; Thu, 28 Oct 2010 15:59:11 -0700 (PDT) Received: by 10.151.41.6 with SMTP id t6mr5624083ybj.444.1288306751126; Thu, 28 Oct 2010 15:59:11 -0700 (PDT) Received: from napoca ([76.244.77.0]) by mx.google.com with ESMTPS id z70sm1142786yhc.36.2010.10.28.15.59.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 28 Oct 2010 15:59:07 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Thu, 28 Oct 2010 17:59:04 -0500 From: Sebastian Pop To: gcc-patches@gcc.gnu.org Cc: rguenther@suse.de, Sebastian Pop Subject: [PATCH 4/6] if-convert even when the data dependences cannot be computed. Date: Thu, 28 Oct 2010 17:58:20 -0500 Message-Id: <1288306702-5543-5-git-send-email-sebpop@gmail.com> In-Reply-To: <1288306702-5543-1-git-send-email-sebpop@gmail.com> References: <1288306702-5543-1-git-send-email-sebpop@gmail.com> 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 2010-10-20 Sebastian Pop * tree-if-conv.c (if_convertible_loop_p_1): Do not call compute_data_dependences_for_loop. (if_convertible_loop_p): Do not free refs and ddrs. --- gcc/ChangeLog | 6 ++++++ gcc/tree-if-conv.c | 24 +++--------------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f14d9b1..4439226 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2010-10-20 Sebastian Pop + * tree-if-conv.c (if_convertible_loop_p_1): Do not call + compute_data_dependences_for_loop. + (if_convertible_loop_p): Do not free refs and ddrs. + +2010-10-20 Sebastian Pop + PR tree-optimization/46029 * doc/invoke.texi (-ftree-loop-if-convert-stores): Update description. * tree-if-conv.c (has_unaligned_memory_refs): New. diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index cb4828a..f05213e 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -855,24 +855,15 @@ predicate_bbs (loop_p loop) } /* Return true when LOOP is if-convertible. This is a helper function - for if_convertible_loop_p. REFS and DDRS are initialized and freed - in if_convertible_loop_p. */ + for if_convertible_loop_p. */ static bool -if_convertible_loop_p_1 (struct loop *loop, - VEC (data_reference_p, heap) **refs, - VEC (ddr_p, heap) **ddrs) +if_convertible_loop_p_1 (struct loop *loop) { bool res; unsigned int i; basic_block exit_bb = NULL; - /* Don't if-convert the loop when the data dependences cannot be - computed: the loop won't be vectorized in that case. */ - res = compute_data_dependences_for_loop (loop, true, refs, ddrs); - if (!res) - return false; - calculate_dominance_info (CDI_DOMINATORS); /* Allow statements that can be handled during if-conversion. */ @@ -934,9 +925,6 @@ if_convertible_loop_p (struct loop *loop) { edge e; edge_iterator ei; - bool res = false; - VEC (data_reference_p, heap) *refs; - VEC (ddr_p, heap) *ddrs; /* Handle only innermost loop. */ if (!loop || loop->inner) @@ -968,13 +956,7 @@ if_convertible_loop_p (struct loop *loop) if (loop_exit_edge_p (loop, e)) return false; - refs = VEC_alloc (data_reference_p, heap, 5); - ddrs = VEC_alloc (ddr_p, heap, 25); - res = if_convertible_loop_p_1 (loop, &refs, &ddrs); - - free_data_refs (refs); - free_dependence_relations (ddrs); - return res; + return if_convertible_loop_p_1 (loop); } /* Basic block BB has two predecessors. Using predecessor's bb