From nobody Wed Dec 15 21:27:49 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 8AC4618D469D; Wed, 15 Dec 2021 21:27:50 +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 4JDpHp15VXz4ZLQ; Wed, 15 Dec 2021 21:27:50 +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 F3480232E6; Wed, 15 Dec 2021 21:27:49 +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 1BFLRnsx000999; Wed, 15 Dec 2021 21:27:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BFLRnar000998; Wed, 15 Dec 2021 21:27:49 GMT (envelope-from git) Date: Wed, 15 Dec 2021 21:27:49 GMT Message-Id: <202112152127.1BFLRnar000998@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: 5a925e464466 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 5a925e4644665b9a7a5cdd664764fb0a4d1c5797 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639603670; 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=+fxbiezOe7ALwyThmVWqILiuM2ZVOekvpp8GhTNSmLk=; b=JWJr7SCjcdjPJU7BKT9tueZbrpJEoJzJ9VOwZ9Z733IvHFhgXMn3kH63LgiAOAHMC95cuO E6k6tfVrc3dIyoiAF9HhQH+RcKUIXfWAbjRNQWWhu49egnyQu7vYvcMf/IqNVrIZXKvfEX 7vGXPdlSbIS61AQwTFLf2tjRMMBceKv9dmtfC8dr6KXXprOEiTRLBZu/YzJYsre9IZ/sIs D+aLadj4WI/JgvYh0P3igz7Gx+Pus0ltpiWGqOL2g6oHSoy2MLvmX1xFS9aI/ehOm+QdO2 dyJWKbo/trSjmLhs18KRisbFpUPHUaSfxBvlzBf1WqHTHmZXR7r0dN2RFGRBqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639603670; a=rsa-sha256; cv=none; b=Ta+Awh6/kHfLzTMSTNtmmx3egNKG0ssig1eUjmbHeTmdH3icHa8Iy4Mzx38noPV7XXW3mD ILGs7scE/kguTp2uRQo1ef4mkGzUxtvXsCcSdtsR0glZHNgPceCWy9JlVbGSk4dzfIoL0i veP7PTS4C36XJmChrST5vF672sCPG3+3nfmPSJUsdO0Is3hitnpeSBApwM0mXYfInQzj3F 3ScKAWYrt7f2l0vAl/O0TtAcknsmfddBeu/l+gMoVJSz114a0yncizdHrRuSX9Zk6GfVaK nN8wyaW8tRUNtkPHxO9XVwzq6PohiKXCizJi6L4pDUD7pWGlMMzMb3OPqmJTJw== 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=5a925e4644665b9a7a5cdd664764fb0a4d1c5797 commit 5a925e4644665b9a7a5cdd664764fb0a4d1c5797 Author: Dimitry Andric AuthorDate: 2021-12-15 19:56:12 +0000 Commit: Dimitry Andric CommitDate: 2021-12-15 21:27:39 +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 --- .../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());