From patchwork Thu Apr 28 14:30:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1217 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:50:15 -0000 Delivered-To: patches@linaro.org Received: by 10.224.2.73 with SMTP id 9cs148768qai; Thu, 28 Apr 2011 07:30:42 -0700 (PDT) Received: by 10.227.153.145 with SMTP id k17mr3556216wbw.18.1304001041559; Thu, 28 Apr 2011 07:30:41 -0700 (PDT) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id k6si5451096wbc.49.2011.04.28.07.30.41 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2011 07:30:41 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of richard.sandiford@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of richard.sandiford@linaro.org) smtp.mail=richard.sandiford@linaro.org Received: by wyb33 with SMTP id 33so2591079wyb.37 for ; Thu, 28 Apr 2011 07:30:40 -0700 (PDT) Received: by 10.227.61.146 with SMTP id t18mr3512451wbh.189.1304001040735; Thu, 28 Apr 2011 07:30:40 -0700 (PDT) Received: from richards-thinkpad (gbibp9ph1--blueice2n1.emea.ibm.com [195.212.29.75]) by mx.google.com with ESMTPS id l24sm1125368wbc.64.2011.04.28.07.30.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2011 07:30:37 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, patches@linaro.org, richard.sandiford@linaro.org Cc: patches@linaro.org Subject: Move STMT_VINFO_TYPE assignment in vectorizable_reduction Date: Thu, 28 Apr 2011 15:30:35 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 When I started looking at PR 48765, I noticed that vectorizable_reduction set STMT_VINFO_TYPE before checking the reduction cost. This probably doesn't matter in practice, and certainly has nothing to do with fixing the PR (which Ira has done, thanks), but it seems like it might cause confusion. Tested on x86_64-linux-gnu. OK to install? Richard gcc/ * tree-vect-loop.c (vectorizable_reduction): Check reduction cost before setting STMT_VINFO_TYPE. Index: gcc/tree-vect-loop.c =================================================================== --- gcc/tree-vect-loop.c 2011-03-30 15:49:32.000000000 +0100 +++ gcc/tree-vect-loop.c 2011-04-27 09:11:40.000000000 +0100 @@ -4305,9 +4305,9 @@ vectorizable_reduction (gimple stmt, gim if (!vec_stmt) /* transformation not required. */ { - STMT_VINFO_TYPE (stmt_info) = reduc_vec_info_type; if (!vect_model_reduction_cost (stmt_info, epilog_reduc_code, ncopies)) return false; + STMT_VINFO_TYPE (stmt_info) = reduc_vec_info_type; return true; }