From nobody Sat Jun 04 12:01:23 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DEDF21B56B98; Sat, 4 Jun 2022 12:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LFddJ2C3sz4cQS; Sat, 4 Jun 2022 12:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654344085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A5bOvJK1C8SYmqix6EoFZniva9gMBPAEpmGTcpcW22s=; b=mM6y4CJ3mbEYpIIbzneOJitJavUBCYUVeoyiF6VPVHxD4yKAnh1nYCS5VY/cPRZY3mELAJ 9uA4A7ZeqnhrezmUnDk5QsaR2EEnPCNUm9S8a/aAOoAlc7bmYMsaTHl0BwubbfInstUM5c ZCiU5MHBKfi69WEU18f7wIHS8NgyX5VCgLep4lnnWCm2I7BGK1Vt6FPgaXQW2z9pBUzEKq P6W/rONs/CV8y6jAWIqk+LgeUftzhZajX7OxBG+KH33zOsI7nTFGxgBR+u5gxH1dkMOke2 Nv3O6vbK8dYwCGtpX/2shH3rCtRj73W1rU+EWs3scoGR5n+OZsY86/bDeHQKlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBB891D814; Sat, 4 Jun 2022 12:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 254C1NRK093906; Sat, 4 Jun 2022 12:01:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 254C1NgH093905; Sat, 4 Jun 2022 12:01:23 GMT (envelope-from git) Date: Sat, 4 Jun 2022 12:01:23 GMT Message-Id: <202206041201.254C1NgH093905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: a8291db89851 - stable/13 - Apply llvm fix for "Invalid PPC CTR loop!" error on powerpcspe List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a8291db89851130a3efa83ea836e57372ffff7ea Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654344085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A5bOvJK1C8SYmqix6EoFZniva9gMBPAEpmGTcpcW22s=; b=sB5iN4fGZ4iDJu+stWlmARyYAcCtx8K/3sY6HXrKUgAw0olLENVh79EZJMKSV1LE+Isw6Y RdD8lDT99u8mkZ1lChWJ1/80mjLp+NpAK3U4ZIJqoiCYlY0jtetoiS0+W46zeXRXMfGjDH v0n6j/CxFhkBWajyxfrUaGlnZgqLpWmokNofZMwl2UG88zyrL3jbv8LC0xFyg632b+16Wn cQCSHZ0BG8R3K/Kq34e3oBg7gFg3VfdQt6qR+RlP+gunCc/8+R+iw/R1x4BpptSL1AqLM1 xAWDiYAPVDFGAVoA5K7jqLNsUKdv1Nxtt+SurmoP2jc67JIcYZcg0P3IhYrKig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654344085; a=rsa-sha256; cv=none; b=O+FoCSQtk39FYQV8vKkDKiqbIpcIZNr/xozkhRDcGhkiOTiAA1cNNZRYoPlWULE+DszHB7 eqq2vWvNWgVHIwRquhaa3mcnV5+u+JLZJ7+IzaHFuc8or7Q2BA1xqFPvmdns76F+fUK7yJ bpgfx42aulu94kd4pSViHztZ+FoTQPj03Yp/9Ams+TUUe9yTIDTtPae/mA4VU8vz5rQdmL xVc5YdOXx4gsYvi/6NgeuBCPoJLmBzqnh5lsdmapF+MoRfvMShE1NtpelsCP7wHVGaRmND JmF0XUtyYb+MQPNYalztqCJXVNaDUgWXxONuqtFLuwaxTdOde29Acvq353p4dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a8291db89851130a3efa83ea836e57372ffff7ea commit a8291db89851130a3efa83ea836e57372ffff7ea Author: Dimitry Andric AuthorDate: 2022-05-18 09:02:03 +0000 Commit: Dimitry Andric CommitDate: 2022-06-04 12:00:13 +0000 Apply llvm fix for "Invalid PPC CTR loop!" error on powerpcspe Merge commit d9d15af7873f from llvm git (Qiu Chaofan): [PowerPC] Treat llvm.fmuladd intrinsic as using CTR This fixes bug 55463, similar to D78668. This is a temporary fix since we will switch to post-isel CTR loop determination in the future. Reviewed By: dim, shchenz Differential Revision: https://reviews.llvm.org/D125746 MFC after: 2 weeks (cherry picked from commit 1a0329799c6d8bfb7eca89d0c8736736b8ab446c) --- ...t-d9d15af7873fe16d7a0dde4def30f40fa9901777.diff | 34 ++++++++++++++++++++++ .../lib/Target/PowerPC/PPCTargetTransformInfo.cpp | 4 +-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/commit-d9d15af7873fe16d7a0dde4def30f40fa9901777.diff b/commit-d9d15af7873fe16d7a0dde4def30f40fa9901777.diff new file mode 100644 index 000000000000..901213b03e93 --- /dev/null +++ b/commit-d9d15af7873fe16d7a0dde4def30f40fa9901777.diff @@ -0,0 +1,34 @@ +commit d9d15af7873fe16d7a0dde4def30f40fa9901777 +Author: Qiu Chaofan +Date: Wed May 18 15:55:02 2022 +0800 + + [PowerPC] Treat llvm.fmuladd intrinsic as using CTR + + This fixes bug 55463, similar to D78668. This is a temporary fix since + we will switch to post-isel CTR loop determination in the future. + + Reviewed By: dim, shchenz + + Differential Revision: https://reviews.llvm.org/D125746 + +diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp +index 501cfa07efeb..7b956fd3478e 100644 +--- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp ++++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp +@@ -491,15 +491,13 @@ bool PPCTTIImpl::mightUseCTR(BasicBlock *BB, TargetLibraryInfo *LibInfo, + case Intrinsic::experimental_constrained_sin: + case Intrinsic::experimental_constrained_cos: + return true; +- // There is no corresponding FMA instruction for PPC double double. +- // Thus, we need to disable CTR loop generation for this type. +- case Intrinsic::fmuladd: + case Intrinsic::copysign: + if (CI->getArgOperand(0)->getType()->getScalarType()-> + isPPC_FP128Ty()) + return true; + else + continue; // ISD::FCOPYSIGN is never a library call. ++ case Intrinsic::fmuladd: + case Intrinsic::fma: Opcode = ISD::FMA; break; + case Intrinsic::sqrt: Opcode = ISD::FSQRT; break; + case Intrinsic::floor: Opcode = ISD::FFLOOR; break; diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp index cc5738a5d7b6..48be7e0860df 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp @@ -491,15 +491,13 @@ bool PPCTTIImpl::mightUseCTR(BasicBlock *BB, TargetLibraryInfo *LibInfo, case Intrinsic::experimental_constrained_sin: case Intrinsic::experimental_constrained_cos: return true; - // There is no corresponding FMA instruction for PPC double double. - // Thus, we need to disable CTR loop generation for this type. - case Intrinsic::fmuladd: case Intrinsic::copysign: if (CI->getArgOperand(0)->getType()->getScalarType()-> isPPC_FP128Ty()) return true; else continue; // ISD::FCOPYSIGN is never a library call. + case Intrinsic::fmuladd: case Intrinsic::fma: Opcode = ISD::FMA; break; case Intrinsic::sqrt: Opcode = ISD::FSQRT; break; case Intrinsic::floor: Opcode = ISD::FFLOOR; break;