From patchwork Thu Sep 5 09:23:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 97141 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 6B7FE3865491 for ; Thu, 5 Sep 2024 09:24:18 +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 [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 69A9D3860C34 for ; Thu, 5 Sep 2024 09:23:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 69A9D3860C34 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 69A9D3860C34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725528228; cv=none; b=M47ewXvc7VyDXw/xS/hhDxTETqm5t759AeLmbK+xQcnCL0myRzL8Q+nTrAI7Mgta0/W4vEK3n5Uklgbf+dDQJWXzLZwQekZ9UpWT2dmtIB+ZvSH3EvHY91ksPNz3OQ6XZRtQqGCvmVGmhrGZePvylf+y+81eLxJHHJ7Jw5jDNo8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725528228; c=relaxed/simple; bh=w8ApJqZN1Yiel9wA1N8NeSBWJSbcxLHmcrZOQwwGhvk=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version; b=kLTN7MDNMI6L74au6Y/YhW86aIID3EdWLiaXnB+s4r1y8fzorj1cQBIxpxY2VqasUdpT2I6nmXGbMstcMvfQPn4iDMx8lnmoopGKKE7s6sZPAhw9m6GPgAXRQySgad+ZMXe7C/naJrtb5Rk4AcHfbqSMFA6x2qh9SyAi7IE4+38= 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 60F161F7D7; Thu, 5 Sep 2024 09:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1725528225; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=ZY6KkNn3O08HbbEoAuXbgLGpH0UcJnVW6dKljL1LX+Y=; b=llieJ+OHP2wo6J5qUuo1m7c92hayWorIrH2I5JsUs1a/ZQ+ytoQ+ySFOJkDRwJ8yRFar94 qHTTbahx5CuXitHQHkEPs9Y3tX9PrJOJU+HoZZneXC266mQb/if51Yrh2lnra4Jc6r6Z7j Voyt9EB3jhpM9Xz8M7jjrEFI5/UIrjY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1725528225; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=ZY6KkNn3O08HbbEoAuXbgLGpH0UcJnVW6dKljL1LX+Y=; b=nG0hC5DyLgXoai7snhkFBD/Dwp3fFCKuhaUb7s9TEeJI2tKNQRFByRYc8iFOA5os91cvvk dheMil1PKoWAhhBg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1725528225; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=ZY6KkNn3O08HbbEoAuXbgLGpH0UcJnVW6dKljL1LX+Y=; b=llieJ+OHP2wo6J5qUuo1m7c92hayWorIrH2I5JsUs1a/ZQ+ytoQ+ySFOJkDRwJ8yRFar94 qHTTbahx5CuXitHQHkEPs9Y3tX9PrJOJU+HoZZneXC266mQb/if51Yrh2lnra4Jc6r6Z7j Voyt9EB3jhpM9Xz8M7jjrEFI5/UIrjY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1725528225; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=ZY6KkNn3O08HbbEoAuXbgLGpH0UcJnVW6dKljL1LX+Y=; b=nG0hC5DyLgXoai7snhkFBD/Dwp3fFCKuhaUb7s9TEeJI2tKNQRFByRYc8iFOA5os91cvvk dheMil1PKoWAhhBg== Date: Thu, 5 Sep 2024 11:23:45 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: RISC-V CI Subject: [PATCH] tree-optimization/116610 - wrong SLP induction bias for mask peeling MIME-Version: 1.0 X-Spam-Level: X-Spamd-Result: default: False [-1.14 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MISSING_MID(2.50)[]; NEURAL_HAM_LONG(-0.34)[-0.343]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MISSING_XM_UA(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; RCPT_COUNT_TWO(0.00)[2]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[gcc.target:url] X-Spam-Score: -1.14 X-Spam-Status: No, score=-10.5 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: <20240905092418.6B7FE3865491@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. Bootstrap and regtest running on x86_64-unknown-linux-gnu. 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 62cf9205059..c981ab656ae 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);