From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A841B3858CDB; Wed, 18 Oct 2023 08:54:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A841B3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697619297; bh=nJ4O5z4bUFtJUtdcxdTQsb3n/hpDnGdrMWyXAzrHDWI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YSs8lDFDrGuKjdP/9kNWbDfhD9H7LxGhx/QiiYrcr9xEIdpsuJI7nnXyeOailN9sI 6TIgv3WrORKLr2qKsjkEbaSJFDFOr2wHYJ9NURIFioTmpBuHkU9M1Gc4tGCI6hrq1X ZflTMXSaPC6FH3nGxW4ObXg7ztdpAhUilJQLTKtI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109154] [13/14 regression] jump threading de-optimizes nested floating point comparisons Date: Wed, 18 Oct 2023 08:54:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: tnfchris at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109154 --- Comment #70 from CVS Commits --- The master branch has been updated by Tamar Christina : https://gcc.gnu.org/g:4b39aeef594f311e2c1715f15608f1d7ebc2d868 commit r14-4713-g4b39aeef594f311e2c1715f15608f1d7ebc2d868 Author: Tamar Christina Date: Wed Oct 18 09:32:55 2023 +0100 middle-end: Fold vec_cond into conditional ternary or binary operation = when sharing operand [PR109154] When we have a vector conditional on a masked target which is doing a selection on the result of a conditional operation where one of the operands of t= he conditional operation is the other operand of the select, then we can f= old the vector conditional into the operation. Concretely this transforms c =3D mask1 ? (masked_op mask2 a b) : b into c =3D masked_op (mask1 & mask2) a b The mask is then propagated upwards by the compiler. In the SVE case we don't end up needing a mask AND here since `mask2` will end up in the instruc= tion creating `mask` which gives us a natural &. Such transformations are more common now in GCC 13+ as PRE has not star= ted unsharing of common code in case it can make one branch fully independe= nt. e.g. in this case `b` becomes a loop invariant value after PRE. This transformation removes the extra select for masked architectures b= ut doesn't fix the general case. gcc/ChangeLog: PR tree-optimization/109154 * match.pd: Add new cond_op rule. gcc/testsuite/ChangeLog: PR tree-optimization/109154 * gcc.target/aarch64/sve/pre_cond_share_1.c: New test. --- Comment #71 from CVS Commits --- The master branch has been updated by Tamar Christina : https://gcc.gnu.org/g:b0fe8f2f960d746e61debd61655f231f503bccaa commit r14-4714-gb0fe8f2f960d746e61debd61655f231f503bccaa Author: Tamar Christina Date: Wed Oct 18 09:33:30 2023 +0100 middle-end: ifcvt: Allow any const IFN in conditional blocks When ifcvt was initially added masking was not a thing and as such it w= as rather conservative in what it supported. For builtins it only allowed C99 builtin functions which it knew it can fold away. These days the vectorizer is able to deal with needing to mask IFNs its= elf. vectorizable_call is able vectorize the IFN by emitting a VEC_PERM_EXPR after the operation to emulate the masking. This is then used by match.pd to conver the IFN into a masked variant if it's available. For these reasons the restriction in ifconvert is no longer require and= we needless block vectorization when we can effectively handle the operati= ons. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Note: This patch is part of a testseries and tests for it are added in = the AArch64 patch that adds supports for the optab. gcc/ChangeLog: PR tree-optimization/109154 * tree-if-conv.cc (if_convertible_stmt_p): Allow any const IFN.=