From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111898 invoked by alias); 29 Nov 2019 10:13:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 111890 invoked by uid 89); 29 Nov 2019 10:13:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1800 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Nov 2019 10:13:17 +0000 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 B068930E for ; Fri, 29 Nov 2019 02:13:15 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 593AA3F52E for ; Fri, 29 Nov 2019 02:13:15 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [2/5] Make vectorizable_operation punt early on codes it doesn't handle References: Date: Fri, 29 Nov 2019 10:14:00 -0000 In-Reply-To: (Richard Sandiford's message of "Fri, 29 Nov 2019 10:10:44 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg02620.txt.bz2 vectorizable_operation returned false for codes that are handled by vectorizable_shift, but only after it had already done a lot of work. Checking earlier should be more efficient and avoid polluting the logs with duplicate info. Also, there was no such early-out for comparisons or COND_EXPRs. Fixing that avoids a false scan-tree-dump hit with a later patch. 2019-11-29 Richard Sandiford gcc/ * tree-vect-stmts.c (vectorizable_operation): Punt early on codes that are handled elsewhere. Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c 2019-11-29 08:28:12.015121876 +0000 +++ gcc/tree-vect-stmts.c 2019-11-29 09:11:24.553108756 +0000 @@ -5999,6 +5999,21 @@ vectorizable_operation (stmt_vec_info st orig_code = code = gimple_assign_rhs_code (stmt); + /* Shifts are handled in vectorizable_shift. */ + if (code == LSHIFT_EXPR + || code == RSHIFT_EXPR + || code == LROTATE_EXPR + || code == RROTATE_EXPR) + return false; + + /* Comparisons are handled in vectorizable_comparison. */ + if (TREE_CODE_CLASS (code) == tcc_comparison) + return false; + + /* Conditions are handled in vectorizable_condition. */ + if (code == COND_EXPR) + return false; + /* For pointer addition and subtraction, we should use the normal plus and minus for the vector operation. */ if (code == POINTER_PLUS_EXPR) @@ -6123,11 +6138,6 @@ vectorizable_operation (stmt_vec_info st gcc_assert (ncopies >= 1); - /* Shifts are handled in vectorizable_shift (). */ - if (code == LSHIFT_EXPR || code == RSHIFT_EXPR || code == LROTATE_EXPR - || code == RROTATE_EXPR) - return false; - /* Supportable by target? */ vec_mode = TYPE_MODE (vectype);