From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 9B63A3858D28 for ; Tue, 14 Dec 2021 09:53:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9B63A3858D28 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-135-t6A30tTeM76dcJBjC79DLA-1; Tue, 14 Dec 2021 04:53:21 -0500 X-MC-Unique: t6A30tTeM76dcJBjC79DLA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 94924801B0C; Tue, 14 Dec 2021 09:53:19 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.2.16.169]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CAB701972E; Tue, 14 Dec 2021 09:53:18 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 1BE9rFgL707326 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 14 Dec 2021 10:53:16 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 1BE9rEOL707325; Tue, 14 Dec 2021 10:53:14 +0100 Date: Tue, 14 Dec 2021 10:53:13 +0100 From: Jakub Jelinek To: Joel Hutton Cc: Richard Biener , "gcc-patches@gcc.gnu.org" , Tobias Burnus , Richard Sandiford , Richard Biener Subject: Re: GCC 11 backport does not build (no "directly_supported_p") - was: Re: pr103523: Check for PLUS/MINUS support Message-ID: <20211214095313.GT2646553@tucnak> Reply-To: Jakub Jelinek References: <0cf2edb4-f9f4-4623-e2b2-d0952385174d@codesourcery.com> <5BD5E539-4E9C-440D-B01B-068DF5D0571F@gmail.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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-List-Received-Date: Tue, 14 Dec 2021 09:53:29 -0000 On Tue, Dec 14, 2021 at 09:37:03AM +0000, Joel Hutton via Gcc-patches wrote: > Bootstrapped and regression tested on releases/gcc-11 on aarch64. > > Ok for 11? > > Previous commit broke build as it relied on directly_supported_p which > is not in 11. This reworks to avoid using directly_supported_p. > > gcc/ChangeLog: > > PR bootstrap/103688 > * tree-vect-loop.c (vectorizable_induction): Rework to avoid > directly_supported_p Missing . after directly_supported_p --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -7997,8 +7997,14 @@ vectorizable_induction (loop_vec_info loop_vinfo, tree step_vectype = get_same_sized_vectype (TREE_TYPE (step_expr), vectype); /* Check for backend support of PLUS/MINUS_EXPR. */ - if (!directly_supported_p (PLUS_EXPR, step_vectype) - || !directly_supported_p (MINUS_EXPR, step_vectype)) + direct_optab ot_plus = optab_for_tree_code (tree_code (PLUS_EXPR), + step_vectype, optab_default); + direct_optab ot_minus = optab_for_tree_code (tree_code (MINUS_EXPR), + step_vectype, optab_default); Why tree_code (PLUS_EXPR) instead of just PLUS_EXPR (ditto MINUS_EXPR)? The formatting is off, step_vectype isn't aligned below tree_code. + if (ot_plus == unknown_optab + || ot_minus == unknown_optab + || optab_handler (ot_minus, TYPE_MODE (step_vectype)) == CODE_FOR_nothing + || optab_handler (ot_plus, TYPE_MODE (step_vectype)) == CODE_FOR_nothing) return false; Won't optab_handler just return CODE_FOR_nothing for unknown_optab? Anyway, I think best would be to write it as: if (!target_supports_op_p (step_vectype, PLUS_EXPR, optab_default) || !target_supports_op_p (step_vectype, MINUS_EXPR, optab_default)) return false; Jakub