From nobody Sat Dec 18 11:24:37 2021 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 19DC918EB795; Sat, 18 Dec 2021 11:24:38 +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 4JGNmP5zbtz4pmc; Sat, 18 Dec 2021 11:24:37 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 A8F1C6771; Sat, 18 Dec 2021 11:24:37 +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 1BIBObHK085661; Sat, 18 Dec 2021 11:24:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BIBObQR085660; Sat, 18 Dec 2021 11:24:37 GMT (envelope-from git) Date: Sat, 18 Dec 2021 11:24:37 GMT Message-Id: <202112181124.1BIBObQR085660@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: c272602429d5 - stable/13 - Apply fix for clang incorrectly optimizing part of dns/bind916 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: c272602429d5d7efcea95d97a2ceb48f9d9d2b3c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639826677; 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=XklW0LaXXLIQyF9fswpe3EkVgrzkrgWNF8A3ofKcAwM=; b=UaKPyMgyAqIWTBBU6ZX+U8RUsIjNH2PBE2O1i1ecrl34FLP3PYCQl5qaLhC40xEdc+MI36 H3zlqceguhHK4FmjmK5fmXlQhrFJKod0bgvOdQMuYAD/LDB8h9Cxh0E/cBNSpvkipw5sbO qUi55VRvdY+OWVvybWePB1fN3JTZZoyrXq0lFMDKCCJ1lZ1SncM8WfOzJJrJUTkK6bjN7E ES1g8X5i4USjecyTsxb/wm//V2ScwdiwMYUaLsGZoo/ziEjY8u6qtWa8nFr4BivKPo74f2 yg1THQcsUvmRZUa2E8HDY5ywvjz0tRQ5ba7YhLFYi2DHzN8CHDDG1P3aEt76Qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639826677; a=rsa-sha256; cv=none; b=DOYImiNHCHmr7v3YQs5VEA5a/iknb0iGOeGCFvUwMCfXXSYUvyznMY1aGjR5iYx8hg2v3a SIMRywqkjigCesA1QCI2bIisPC1uuv612NRwBKB0LhrG7l+ezfqVgwQdLqrKR5P0CJL9Jy fHX27m8YWCRM88T116I1wsaI/Zty5PnwkQAiU4E3Kq8EKiyCAiVbP+93XNFhdmPIfBxa9x ld3M5Vclqx3NI7J1SR04+yR4QFfhnbrldixEJ0I4qA+lC/0gnHm82baqnjTfW87OL+nSfl Eu1bTQ71dKkLvmTks1sRtPdiVd/ypVGP3ntEurEJMKIdBDCI2zsj37158e53zA== 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=c272602429d5d7efcea95d97a2ceb48f9d9d2b3c commit c272602429d5d7efcea95d97a2ceb48f9d9d2b3c Author: Dimitry Andric AuthorDate: 2021-12-15 19:56:12 +0000 Commit: Dimitry Andric CommitDate: 2021-12-18 11:24:06 +0000 Apply fix for clang incorrectly optimizing part of dns/bind916 Merge commit e5a8af7a90c6 from llvm git (by Gulfem Savrun Yeniceri): [Passes] Fix relative lookup table converter pass This patch fixes the relative table converter pass for the lookup table accesses that are resulted in an instruction sequence, where gep is not immediately followed by a load, such as gep being hoisted outside the loop or another instruction is inserted in between them. The fix inserts the call to load.relative.instrinsic in the original place of load instead of gep. Issue is reported by FreeBSD via https://bugs.freebsd.org/259921. Differential Revision: https://reviews.llvm.org/D115571 PR: 259921 Reported by: O. Hartmann (cherry picked from commit 5a925e4644665b9a7a5cdd664764fb0a4d1c5797) --- .../llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp b/contrib/llvm-project/llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp index 85e5adaeaf5e..3127432dc6c9 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp @@ -144,6 +144,10 @@ static void convertToRelLookupTable(GlobalVariable &LookupTable) { Value *Offset = Builder.CreateShl(Index, ConstantInt::get(IntTy, 2), "reltable.shift"); + // Insert the call to load.relative instrinsic before LOAD. + // GEP might not be immediately followed by a LOAD, like it can be hoisted + // outside the loop or another instruction might be inserted them in between. + Builder.SetInsertPoint(Load); Function *LoadRelIntrinsic = llvm::Intrinsic::getDeclaration( &M, Intrinsic::load_relative, {Index->getType()}); Value *Base = Builder.CreateBitCast(RelLookupTable, Builder.getInt8PtrTy());