From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 8B0933858025 for ; Mon, 21 Aug 2023 12:24:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B0933858025 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BC0A822C43; Mon, 21 Aug 2023 12:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1692620695; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=3LOfYNSkSE3Sml4DoivZKp9lq5a8FwQuJPutdTB2QLk=; b=0wmrwmDiTbdry1q277dsCqqLNlDV6sfVBCvMue+jbt2iuU0KtdompRWooSb2JaMWxeFekm rDRiBxELUOCdqvvMNKHJ175EhmWrJWp54gl+1u/IFo7J3lFV8i/XWDcu1Ql6sy3QgheFW6 0OSjVjm3YFeKaL3wIWz4bmNk3qxv800= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1692620695; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=3LOfYNSkSE3Sml4DoivZKp9lq5a8FwQuJPutdTB2QLk=; b=IJZMaz8xyX15+LPF/gVCPPpVz3ZAdKMCfB+oNt9BUvmy6iYP4sYeqvEjIWNRUrjQZS0CgN Ws8BEbr87PiptECA== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 8A08D2C146; Mon, 21 Aug 2023 12:24:55 +0000 (UTC) Date: Mon, 21 Aug 2023 12:24:55 +0000 (UTC) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: hongtao.liu@intel.com, hjl.tools@gmail.com Subject: [PATCH] Fix FAIL: gcc.target/i386/pr87007-5.c User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Message-ID: <20230821122455.jT2Om_mRD-7OGlbP-ObZUXuU4rRUD73Y4Ch45d2VQVg@z> The following fixes the gcc.target/i386/pr87007-5.c testcase which changed code generation again after the recent sinking improvements. We now have vxorps %xmm0, %xmm0, %xmm0 vsqrtsd d2(%rip), %xmm0, %xmm0 and an unnecessary xor again in one case, the other vsqrtsd has a register source and a properly zeroing load: vmovsd d3(%rip), %xmm0 testl %esi, %esi jg .L11 .L3: vsqrtsd %xmm0, %xmm0, %xmm0 the following patch XFAILs the scan. I'm not sure what's at fault here, there are no loops in the CFG, but somehow r84:DF=sqrt(['d2']) gets a pxor but r84:DF=sqrt(r83:DF) doesn't. I guess I don't really understand what remove_partial_avx_dependency is supposed to do so can't really assess whether the pxor is necessary or not. OK? * gcc.target/i386/pr87007-5.c: Update comment, XFAIL subtest. --- gcc/testsuite/gcc.target/i386/pr87007-5.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.target/i386/pr87007-5.c b/gcc/testsuite/gcc.target/i386/pr87007-5.c index a6cdf11522e..5902616d1f1 100644 --- a/gcc/testsuite/gcc.target/i386/pr87007-5.c +++ b/gcc/testsuite/gcc.target/i386/pr87007-5.c @@ -1,6 +1,8 @@ /* { dg-do compile } */ /* { dg-options "-Ofast -march=skylake-avx512 -mfpmath=sse -fno-tree-vectorize -fdump-tree-cddce3-details -fdump-tree-lsplit-optimized" } */ -/* Load of d2/d3 is hoisted out, vrndscalesd will reuse loades register to avoid partial dependence. */ +/* Load of d2/d3 is hoisted out, the loop is split, store of d1 and sqrt + are sunk out of the loop and the loop is elided. One vsqrtsd with + memory operand will need a xor to avoid partial dependence. */ #include @@ -17,4 +19,4 @@ foo (int n, int k) /* { dg-final { scan-tree-dump "optimized: loop split" "lsplit" } } */ /* { dg-final { scan-tree-dump-times "removing loop" 2 "cddce3" } } */ -/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 0 } } */ +/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 1 } } */ -- 2.35.3