From nobody Wed May 18 18:29:23 2022 X-Original-To: dev-commits-src-main@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 099C31B3B6A7; Wed, 18 May 2022 18:29:24 +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 4L3M2q6m91z3QLH; Wed, 18 May 2022 18:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652898564; 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=JCNp0A5B2TaQiuu6/XJPZk1AwyIiISByHOS7L4mqAyA=; b=n1ukrxqweKeIQEV+RgQh+b48WgxPMoEFchd9kS4iy3KgD0xFdmHfT182x27I0pxCn9FwdM 2NWEzbbqPFuyYINoIpwkC6qvmYtu76vvnvGnouJolc3aC4WHwaY6PM5kt+G19d4SCGgHpc M6F1DGMpAiRYcjqMEX2Jq0iUWDG8sgSnDvH808H73zIHbETUW1RSRG+1MJ3rl+gdun6pE1 uZTrzYapiKZlbonXlq0dK3SNPLhQnoGV1YbCT/Gk7tJhBOkl7vpDO28y4Ruc+A5oXF0sFi qA7CRSdEfvCyq2KHMRUycfuysLblAcGukyBBxsUudDhIvdMJfea9QHD0PLZhZw== 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 C36B65D53; Wed, 18 May 2022 18:29: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 24IITNlV036259; Wed, 18 May 2022 18:29:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24IITN9p036258; Wed, 18 May 2022 18:29:23 GMT (envelope-from git) Date: Wed, 18 May 2022 18:29:23 GMT Message-Id: <202205181829.24IITN9p036258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 1a0329799c6d - main - Apply llvm fix for "Invalid PPC CTR loop!" error on powerpcspe List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 1a0329799c6d8bfb7eca89d0c8736736b8ab446c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652898564; 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=JCNp0A5B2TaQiuu6/XJPZk1AwyIiISByHOS7L4mqAyA=; b=ZEGzPtsZzObyWlfoVldmgtbeh/mpdsFFhC/zDZ3jzIuMBHVzCMred/Fg4OEzGSCWh37XmA Xiw8h0ejrhTnDBa8AroodadYpBAK0haEUSRRGwq50Jgt6SCePQdx5urQ7Ib6ZVPFNt2lUb v7WmVT2PykiYMa/KmrIbJhqLZ+SLgB0vCMIa7bOharMIeSKxeVm0dpysHnbZQVA0gWootn /ei34di8WAQWAkUJgykYmm7BaBzox3NbQesvmAkMeRZsvi0ZcLAal0vGbe06fNrLuupx4S V6pkF7zuakD7HnrMqJHz0NDBHNroJjX29cTATcTAOyjCgP6RaenhsnHSSUQo2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652898564; a=rsa-sha256; cv=none; b=TtM+yPxy6nmwhIhJiiVwqU9XfnEtEsQyh7VQkCL1KzaBzKc+beVZ0S6YQhr6ii2sxGkINX Iny+Fw7HYJEr7mWW4t5ShUVE4xfeHPFK/vIXG0MX1AmtW+8cIzusjeTxhiTRhFFijqoEYg bvhcD1Pag6INlGElrsBR16gVYM8jy5aEfdh+xHDADIPhjJj5yR0RSVdpMUabC+MnO/MIWS NA7dPpHHqra/uH3AdirdHtDQMtGv2AYtf5FeFDbXYXFYTpKzXU001NhRMjQ1pdYhKeCsEW J4yfZBTUzjtDIuBxAKt/++4oh7kQEUaUq9KJ5IaTbnTU+OAsHvkeoEXvurZnKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1a0329799c6d8bfb7eca89d0c8736736b8ab446c commit 1a0329799c6d8bfb7eca89d0c8736736b8ab446c Author: Dimitry Andric AuthorDate: 2022-05-18 09:02:03 +0000 Commit: Dimitry Andric CommitDate: 2022-05-18 18:29:02 +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 --- ...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;