From patchwork Fri May 4 21:00:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 8415 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 35E9B23E37 for ; Fri, 4 May 2012 21:30:03 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id DAA41A180FA for ; Fri, 4 May 2012 21:30:02 +0000 (UTC) Received: by yhpp61 with SMTP id p61so4074622yhp.11 for ; Fri, 04 May 2012 14:30:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:mime-version:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding :x-system-of-record:x-gm-message-state; bh=MfklBHHWe9gFeoDFY5cS+b3ccQJPzq/IFQc8M2tc/7U=; b=bkpZFoHDlh1m3/E1Ds/lkVhufV+zMP0yJc/Y+oazZa/tviCS/slKimW8TxY+iBD454 DPUI5kAwm4VBYhxitcODyv+yQGigN7t/cNq1rW6t8K6tQnLaBucsEPuhDxQsOfr2SsXE 1AwWYAGtPXptse9za80WfbKGK+vGMJu38ZuuTjj2sBIVF+J5MhUT6jR3uPO5o0s0RxnY KFMEzastqsrEmMg2/wESkt0wTx6DUclsqHLDPmCy/NyVetq2jBH5+c/vXrvqIXe6Kjcw A1+4s+ueLIwz0/AJq9NiLvy6lv5vZRFxbSZ/S2bZ/1eG7nR9m9Go76NRElryJIlSeViP WyWA== Received: by 10.50.183.225 with SMTP id ep1mr4172704igc.1.1336167002212; Fri, 04 May 2012 14:30:02 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.73.147 with SMTP id q19csp590ibj; Fri, 4 May 2012 14:30:01 -0700 (PDT) Received: by 10.68.200.74 with SMTP id jq10mr11431349pbc.66.1336165241189; Fri, 04 May 2012 14:00:41 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id pc5si943750pbc.66.2012.05.04.14.00.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 May 2012 14:00:41 -0700 (PDT) Received-SPF: pass (google.com: domain of iant@google.com designates 209.85.160.50 as permitted sender) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of iant@google.com designates 209.85.160.50 as permitted sender) smtp.mail=iant@google.com; dkim=pass header.i=@google.com Received: by pbbrr4 with SMTP id rr4so5214413pbb.37 for ; Fri, 04 May 2012 14:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record; bh=MfklBHHWe9gFeoDFY5cS+b3ccQJPzq/IFQc8M2tc/7U=; b=GoRCFvH8PRy2Ag8nVOoPOvmLKZu0R0NBeV9HWR9ywanuZXfWarmcI8lOTj0I6bDUFb EgpcLHfiJKr/AyWuT1yAB3JXhbXK98grzZtNXoHgsddO5oTgDfBzpFOtMyRj6AvPcsov Vno2IAcfQ3Q3M6lF/vxCFatM6Ntm+1voAIzY3+lmAyDq54iAXMCeVFDD4eTpSB9f2xfB anMz59+JaaTENj9RhNWN8aioJw/KCnB0CUi/YwDclH28MigDbrBtqPNmu3As5zNMxCP4 QetT0HQOYEqDfea8n2/3EafWUtwTscTJYRzjfriDz7/U5z7wazBpmPjYiE79eXKSvGs1 z9JQ== Received: by 10.68.202.130 with SMTP id ki2mr22363061pbc.52.1336165240923; Fri, 04 May 2012 14:00:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.202.130 with SMTP id ki2mr22363032pbc.52.1336165240728; Fri, 04 May 2012 14:00:40 -0700 (PDT) Received: by 10.68.41.226 with HTTP; Fri, 4 May 2012 14:00:40 -0700 (PDT) In-Reply-To: <201205041230.q44CUU6x005935@d06av02.portsmouth.uk.ibm.com> References: <201205041230.q44CUU6x005935@d06av02.portsmouth.uk.ibm.com> Date: Fri, 4 May 2012 14:00:40 -0700 Message-ID: Subject: Re: [PATCH 2/2] Minor refactoring of tree-vect-patterns.c From: Ian Lance Taylor To: Ulrich Weigand Cc: Richard Guenther , gcc-patches@gcc.gnu.org, patches@linaro.org X-System-Of-Record: true X-Gm-Message-State: ALoCoQmFLdmW67rWg8v5JHD3zAPHrZ19til7C58Oc5AwjxIBDrBj8d/ed521Vw8eEjczQP3XWRE3 On Fri, May 4, 2012 at 5:30 AM, Ulrich Weigand wrote: > Richard Guenther wrote: >> On Mon, Apr 30, 2012 at 6:19 PM, Ulrich Weigand wrote: >> > Hello, >> > >> > as a second step in refactoring this patch introduces a routine >> > vect_find_single_use to determine whether a defining statement >> > has one single use within the current vectorization domain. >> > >> > The helper is then called wherever that check is currently >> > open-coded. =A0There should be no change in behaviour. >> > >> > Tested on i386-linux-gnu and arm-linux-gnueabi with no regressions. >> > >> > OK for mainline? >> >> You can use single_imm_use to avoid the loop and simplify the factored >> routine. >> >> Ok with that change. > > I've checked in the version appended below. > > ChangeLog: > >        * tree-vect-patterns.c (vect_single_imm_use): New function. >        (vect_recog_widen_mult_pattern): Use it instead of open-coding loop. >        (vect_recog_over_widening_pattern): Likewise. >        (vect_recog_widen_shift_pattern): Likewise. It looks like you checked in a version of this patch to gcc-4_7-branch. However, the version you committed used "false" where it should have used "NULL", causing a bootstrap failure in stage 2 when not using building in release mode: ../../gccgo-gcc/gcc/tree-vect-patterns.c: In function ‘gimple_statement_d* vect_single_imm_use(gimple)’: ../../gccgo-gcc/gcc/tree-vect-patterns.c:104:12: error: converting ‘false’ to pointer type ‘gimple’ [-Werror=conversion-null] ../../gccgo-gcc/gcc/tree-vect-patterns.c:107:12: error: converting ‘false’ to pointer type ‘gimple’ [-Werror=conversion-null] I committed the appended patch to fix this problem. Please double-check the code to make sure it is correct. Thanks. Patch bootstrapped on x86_64-unknown-linux-gnu but not tested. Committed to 4.7 branch as obvious. Ian 2012-05-04 Ian Lance Taylor * tree-vect-patterns.c (vect_single_imm_use): Correct return values from false to NULL. Index: gcc/tree-vect-patterns.c =================================================================== --- gcc/tree-vect-patterns.c (revision 187181) +++ gcc/tree-vect-patterns.c (working copy) @@ -101,10 +101,10 @@ vect_single_imm_use (gimple def_stmt) return NULL; if (!gimple_bb (use_stmt)) - return false; + return NULL; if (!flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))) - return false; + return NULL; gcc_assert (vinfo_for_stmt (use_stmt)); return use_stmt;