From patchwork Thu Sep 5 13:36:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 97174 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 3AD7A384AB42 for ; Thu, 5 Sep 2024 13:37:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 5ADF7385EC1D for ; Thu, 5 Sep 2024 13:36:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5ADF7385EC1D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5ADF7385EC1D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725543397; cv=none; b=LEblnIcJmbLNKME7+sE1QjhTVQLlw+CyG/NDLem5HyO6svNHgvk29l7BlAILMEc65+DpoNFyWRqN3yluRyCm8Uh1Yt1rcRtMKW5CvfNm7+12Tk9JsBCUAbDy+f2aILGoHrJya8QaHvnuXwiBCqj3UO3men8cub8b9ygm2nCw9ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725543397; c=relaxed/simple; bh=3d5zr12K4dB5vVG5LpVvLi4x+HPIRMuQrHee8p2bgx0=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version; b=aYvxZj7qVbiQewmSTkRLZ8B4qGq7LMsHD6xixJ+tvunWXoVMJ1Uin5D4gKs6elRV03aI4reZCl7yfc+vMMkD/jRkxKbDFIWSuPs4KY9vTqylKb17Dzu89Bnh+UY9eSB4fOSVrQxnw2IyVkRRbY3VKiAi+93VFrwU9823lskaxOs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from murzim.nue2.suse.org (unknown [10.168.4.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 707191F7D4; Thu, 5 Sep 2024 13:36:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1725543394; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=BExDlxvc+kZv9nENKrNaiPZWglk7+yeq8eBpn23aLwE=; b=Pu0cSXX4dQHnUipwSLiKWOdfINNvU65/cdl8fpTnmr6CnxHKa6cB8b7PzhTeyN8VOubfz3 OT4kRO+ZNFugTDcedN8u8/S2nQHR2LoHBaUgUS36aw2ieg7pFdS8tqZmd2TbidA31G+8zm ReNLuxeGq2HsNoZy9fZgHm9ifDin9D0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1725543394; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=BExDlxvc+kZv9nENKrNaiPZWglk7+yeq8eBpn23aLwE=; b=UgnRmR85H6Q8L3z1S4gi9XKArYddU3+GhrOqu7roBoi6S9ooK0VotirRn5gyyeJpFEu54t Dhu4ViAJ1Dty2SCA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1725543394; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=BExDlxvc+kZv9nENKrNaiPZWglk7+yeq8eBpn23aLwE=; b=Pu0cSXX4dQHnUipwSLiKWOdfINNvU65/cdl8fpTnmr6CnxHKa6cB8b7PzhTeyN8VOubfz3 OT4kRO+ZNFugTDcedN8u8/S2nQHR2LoHBaUgUS36aw2ieg7pFdS8tqZmd2TbidA31G+8zm ReNLuxeGq2HsNoZy9fZgHm9ifDin9D0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1725543394; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=BExDlxvc+kZv9nENKrNaiPZWglk7+yeq8eBpn23aLwE=; b=UgnRmR85H6Q8L3z1S4gi9XKArYddU3+GhrOqu7roBoi6S9ooK0VotirRn5gyyeJpFEu54t Dhu4ViAJ1Dty2SCA== Date: Thu, 5 Sep 2024 15:36:34 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: RISC-V CI Subject: [PATCH 2/3] tree-optimization/116610 - wrong SLP induction bias for mask peeling MIME-Version: 1.0 X-Spam-Score: -1.13 X-Spamd-Result: default: False [-1.13 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MISSING_MID(2.50)[]; NEURAL_HAM_LONG(-0.34)[-0.341]; NEURAL_HAM_SHORT(-0.19)[-0.968]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[] X-Spam-Level: X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, MISSING_MID, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Message-Id: <20240905133753.3AD7A384AB42@sourceware.org> The following fixes a mistake when applying the bias for peeling via masking to the inital value of SLP inductions. This resolves gcc.target/aarch64/sve/peel_ind_1.c (a scan-assembler only unfortunately) when forcing single-lane SLP for it. PR tree-optimization/116610 * tree-vect-loop.cc (vectorizable_induction): Use MINUS_EXPR to apply a mask peeling adjustment. --- gcc/tree-vect-loop.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 31cdc4bf53d..a879a13bbf0 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -10543,7 +10543,7 @@ vectorizable_induction (loop_vec_info loop_vinfo, vec_steps.safe_push (vec_step); tree step_mul = gimple_build_vector (&init_stmts, &mul_elts); if (peel_mul) - step_mul = gimple_build (&init_stmts, PLUS_EXPR, step_vectype, + step_mul = gimple_build (&init_stmts, MINUS_EXPR, step_vectype, step_mul, peel_mul); if (!init_node) vec_init = gimple_build_vector (&init_stmts, &init_elts);