From patchwork Thu Oct 14 10:57:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 46204 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C9B03858412 for ; Thu, 14 Oct 2021 10:58:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C9B03858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1634209123; bh=4EY93+xLTHkTC3zRftcGRpAXaTmUozqC698PVrH3A3c=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=HkbutgY2qIzFZcw2j+eeXfNHUImHSg9TczWBm3eJpdS87I0oAaJ3KTIFTBOFBH0lx Vm6Jwun6JCXWTucZuHrpm7X0shTxWHZB4rZFwa0ybtefzRFWtk3xewrsV0mjJEFzpi 3pkaN4ui2ySElH0dkBBrR8MdMUJfUMirQgvjJKTI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 830633858433 for ; Thu, 14 Oct 2021 10:57:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 830633858433 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1EE452F; Thu, 14 Oct 2021 03:57:24 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 47FC93F66F; Thu, 14 Oct 2021 03:57:23 -0700 (PDT) To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, nickc@redhat.com, richard.earnshaw@arm.com, ramana.radhakrishnan@arm.com, kyrylo.tkachov@arm.com, richard.sandiford@arm.com Subject: [PATCH] arm: Remove add_stmt_cost hook Date: Thu, 14 Oct 2021 11:57:22 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Sandiford via Gcc-patches From: Richard Sandiford Reply-To: Richard Sandiford Cc: richard.earnshaw@arm.com, ramana.radhakrishnan@arm.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The arm implementation of add_stmt_cost was added alongside arm_builtin_vectorization_cost. At that time it was necessary to override the latter when overriding the former, since default_add_stmt_cost didn't indirect through the builtin_vectorization_cost target hook: int stmt_cost = default_builtin_vectorization_cost (kind, vectype, misalign); That was fixed by: 2014-06-06 Bingfeng Mei * targhooks.c (default_add_stmt_cost): Call target specific hook instead of default one. so the arm definition of add_stmt_cost is now equivalent to the default. Bootrapped & regression-tested on arm-linux-gnueabihf. OK to install? Richard gcc/ * config/arm/arm.c (arm_add_stmt_cost): Delete. (TARGET_VECTORIZE_ADD_STMT_COST): Delete. --- gcc/config/arm/arm.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index d8c5d2bc7db..e51f60a1841 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -304,11 +304,6 @@ static bool aarch_macro_fusion_pair_p (rtx_insn*, rtx_insn*); static int arm_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost, tree vectype, int misalign ATTRIBUTE_UNUSED); -static unsigned arm_add_stmt_cost (vec_info *vinfo, void *data, int count, - enum vect_cost_for_stmt kind, - struct _stmt_vec_info *stmt_info, - tree vectype, int misalign, - enum vect_cost_model_location where); static void arm_canonicalize_comparison (int *code, rtx *op0, rtx *op1, bool op0_preserve_value); @@ -769,8 +764,6 @@ static const struct attribute_spec arm_attribute_table[] = #undef TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST #define TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST \ arm_builtin_vectorization_cost -#undef TARGET_VECTORIZE_ADD_STMT_COST -#define TARGET_VECTORIZE_ADD_STMT_COST arm_add_stmt_cost #undef TARGET_CANONICALIZE_COMPARISON #define TARGET_CANONICALIZE_COMPARISON \ @@ -12242,39 +12235,6 @@ arm_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost, } } -/* Implement targetm.vectorize.add_stmt_cost. */ - -static unsigned -arm_add_stmt_cost (vec_info *vinfo, void *data, int count, - enum vect_cost_for_stmt kind, - struct _stmt_vec_info *stmt_info, tree vectype, - int misalign, enum vect_cost_model_location where) -{ - unsigned *cost = (unsigned *) data; - unsigned retval = 0; - - if (flag_vect_cost_model) - { - int stmt_cost = arm_builtin_vectorization_cost (kind, vectype, misalign); - - /* Statements in an inner loop relative to the loop being - vectorized are weighted more heavily. The value here is - arbitrary and could potentially be improved with analysis. */ - if (where == vect_body && stmt_info - && stmt_in_inner_loop_p (vinfo, stmt_info)) - { - loop_vec_info loop_vinfo = dyn_cast (vinfo); - gcc_assert (loop_vinfo); - count *= LOOP_VINFO_INNER_LOOP_COST_FACTOR (loop_vinfo); /* FIXME. */ - } - - retval = (unsigned) (count * stmt_cost); - cost[where] += retval; - } - - return retval; -} - /* Return true if and only if this insn can dual-issue only as older. */ static bool cortexa7_older_only (rtx_insn *insn)