From patchwork Wed Aug 30 09:08:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andre Vieira (lists)" X-Patchwork-Id: 1827663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=rufXsPtA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RbJPh4L4Lz1ygM for ; Wed, 30 Aug 2023 19:08:55 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0759738582A3 for ; Wed, 30 Aug 2023 09:08:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0759738582A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693386534; bh=j8676XM4anbmPESOHlcFpK/LcZFIt14s9aOs4HYdSO4=; h=Date:Subject:To:References:Cc:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=rufXsPtAQmmlVrVAVSyNLXN8MAU9UNFDFUm7GY61uUVSrCVR/39kd7LABWI+LGzeL zfDr+cSGSmUk30OzsZcWP+AzK4DcQNzFEnImWh68YyxNOfMQYmsgU+xuXbHWsrjtFN G/1yqi2cquG4kSI1L85vxoEPZcYx3FgEyqpnfqkU= 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 C84953858C30 for ; Wed, 30 Aug 2023 09:08:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C84953858C30 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 D067C2F4; Wed, 30 Aug 2023 02:09:12 -0700 (PDT) Received: from [10.57.64.216] (unknown [10.57.64.216]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AE2CC3F64C; Wed, 30 Aug 2023 02:08:32 -0700 (PDT) Message-ID: <0942baa7-f186-4d0b-f556-3b8f926a24ad@arm.com> Date: Wed, 30 Aug 2023 10:08:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: [Patch 2/8] parloops: Allow poly nit and bound Content-Language: en-US To: gcc-patches@gcc.gnu.org References: <73b53052-c3a4-4028-2836-ade419431eda@arm.com> Cc: Richard Sandiford , Richard Biener In-Reply-To: <73b53052-c3a4-4028-2836-ade419431eda@arm.com> X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Andre Vieira \(lists\) via Gcc-patches" From: "Andre Vieira (lists)" Reply-To: "Andre Vieira \(lists\)" Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Teach parloops how to handle a poly nit and bound e ahead of the changes to enable non-constant simdlen. gcc/ChangeLog: * tree-parloops.cc (try_to_transform_to_exit_first_loop_alt): Accept poly NIT and ALT_BOUND. diff --git a/gcc/tree-parloops.cc b/gcc/tree-parloops.cc index a35f3d5023b06e5ef96eb4222488fcb34dd7bd45..cf713e53d712fb5ad050e274f373adba5a90c5a7 100644 --- a/gcc/tree-parloops.cc +++ b/gcc/tree-parloops.cc @@ -2531,14 +2531,16 @@ try_transform_to_exit_first_loop_alt (class loop *loop, tree nit_type = TREE_TYPE (nit); /* Figure out whether nit + 1 overflows. */ - if (TREE_CODE (nit) == INTEGER_CST) + if (TREE_CODE (nit) == INTEGER_CST + || TREE_CODE (nit) == POLY_INT_CST) { if (!tree_int_cst_equal (nit, TYPE_MAX_VALUE (nit_type))) { alt_bound = fold_build2_loc (UNKNOWN_LOCATION, PLUS_EXPR, nit_type, nit, build_one_cst (nit_type)); - gcc_assert (TREE_CODE (alt_bound) == INTEGER_CST); + gcc_assert (TREE_CODE (alt_bound) == INTEGER_CST + || TREE_CODE (alt_bound) == POLY_INT_CST); transform_to_exit_first_loop_alt (loop, reduction_list, alt_bound); return true; }