From nobody Sat Dec 25 11:56:31 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 3D93818F424B; Sat, 25 Dec 2021 11:56:36 +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 4JLj8150gGz4lqJ; Sat, 25 Dec 2021 11:56:33 +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 E877A16C5D; Sat, 25 Dec 2021 11:56:31 +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 1BPBuVqY007637; Sat, 25 Dec 2021 11:56:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BPBuVEq007636; Sat, 25 Dec 2021 11:56:31 GMT (envelope-from git) Date: Sat, 25 Dec 2021 11:56:31 GMT Message-Id: <202112251156.1BPBuVEq007636@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: 727693674594 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 7276936745949711ca7ee66589728eca167360ba Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640433394; 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=nwE5JTPjwJuFYRuBpHv0E7vKTX1z0o7WbXTSGXEw9hg=; b=MfUHDnDXwqoK0SekjoeT0sQa5R4AMSqsToY66/rJpBn++b4J8Dle688A5nW22cVj7l4Rwa JOKstYwFiyZh2IHzgn16ponyWU+Dp+Zf19BQC/Sb1EUJ3AqEAGDzuoDre4JvNzPMZ0tUub hqMNoaQCPuQDPeJyuBA1A+xKC3jTaYi47jva6EvFA+ihTZCDUWW2mCNVFviXN3gDu056Qt ohrD4aRChe8QJHCSUaTAMjpFcd1p2EjRzPDVr+BjhVKIHhb5O1LcUGnScdGmqqE474bnkn PzfKrKYr/2j2KneOOfOt/1NwSAnyRFOkIuWWApesdQjC8whmnxfqxm8esOAIuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640433394; a=rsa-sha256; cv=none; b=nQDUsnoMtnOhtPUZp5XzYR438ZBWemqSfX9nPTgyaU3i+aM5AgHzlkds0MduyU8OVd7jx5 urjFjcxkLq/6rQnScT1bn4xZJrLMaH49ryVhdZSTO1yfoOQaopnNnqQOekH8aSACTN2FUP BnJ+OmFooosnkmHW/zrVajcuuVUTTYAWZ1LOXeg+bjd9n6Ts3ayusi8RbVdl2B1oB/aVFQ ARI2tXZCUgyl8H+TfIaDyi77y6q8sVr+cKO+JEqsJKgeEt1FibWU3OH6gFoNZaWvFuTzWn n9vNVJ3OK11JBROUlHOCVcrHe/XHvqpBrWq5dYLKTvHzxaXRuT8N7CZ4+rjWcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=7276936745949711ca7ee66589728eca167360ba commit 7276936745949711ca7ee66589728eca167360ba Author: Dimitry Andric AuthorDate: 2021-12-15 19:56:12 +0000 Commit: Dimitry Andric CommitDate: 2021-12-25 11:51:44 +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 MFC after: 3 days (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());