From nobody Fri Jun 23 23:38:04 2023 X-Original-To: dev-commits-ports-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 4Qntvw5726z4gQyX; Fri, 23 Jun 2023 23:38:04 +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 4Qntvw4gTfz3p3q; Fri, 23 Jun 2023 23:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687563484; 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=pUW26NhOlIKNk1TtvFg0VJBpLeh5g1IwXrVIh4SRIPI=; b=X3kiy0maEiJb2R1oVNzqYp2qtqbJPPikdoQCI2INjSl2owVjSRSDpzJWHMTCKj42tuw4fx 85SNrvMvY8++ZEXvGHOVz+I7cK96glyWu1SycVNXvT8IsrAl0T4X/tZvJhcZ4D0VzOuidk HnGBjzSNKR8L/OkjpwhjXsUGE8iDBiEGDPpz0lZim7lSi+UJSm7omNvZPrvGrNecRHzdv4 NEDPYpI33g64wQOTmz+nPAiMlrhTJiD90hpg4rpBimuzLIBuPxw9AEAbTA2tL38f31alTp 8V6zh26+T74/CwtzGAoaKY4kal7mhSsh56QjfwWnIj+GUOF3jF++zaIOKB2R7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687563484; 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=pUW26NhOlIKNk1TtvFg0VJBpLeh5g1IwXrVIh4SRIPI=; b=UB9RrGb5G5+ZP0/UzaTLTY2a3SuApGLQtBSWTtUkNfKpEvu9YOuJ92Ct6TjIramMMqIR+T ssvED/tSkrNpqKHy4cUjc5va1YVHENLQh9nBJ8uJjrytIlAlPMBrp/IdTfmyKuxtR0CcCF mwcUdz3kCoABF32//38JFouoeAM8vKh8xFTkiBbrJ7Bt6F1aHzXgzfYQSj7fEVQz1rw4ML uOFk8fT0nXtAxPP67bRKTMoLNMsarD4aXehxccYMWN5Q2reGvgBeujAe6BtjycDpXOsJvs 4xLY+FoRpk/VKcMl2D8zv6OLvg8bODiqseSidNoH9YfR3Ax7pYEFLy2uG7u71A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687563484; a=rsa-sha256; cv=none; b=WXxhI/Ova19SHv44DdpQBxJ2TwyZQMbxteQD2KL9NZaUdHbWg0tDj6uYZEpv02ygoIkOr1 Pnu/Xih75lbACxCga0dqO11Ijg95gUhHO/b/Jh9uCXRys9+2ziV41+H5ED8RFS0ZmXMS8S FtMTAMkSjxjWYPrbwOC2c1XnEFrpRpwKSLoshgjYKj2RYNMDt8OM+52raVlkjQDM+SqBcd OXArTycaxbnL9BVoM0b5+aDxk1FaumWXdCYgJciVq8iJOQAY7DZh427DVh/e7gia0KYFpn winTgTQJrddiqmOjmO8wh4HxK/peMO/tQj01z0l/jf/ONLme6eaD5qNDTkqE3A== 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 4Qntvw3lC3zNgT; Fri, 23 Jun 2023 23:38:04 +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 35NNc4Gg076831; Fri, 23 Jun 2023 23:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35NNc45t076830; Fri, 23 Jun 2023 23:38:04 GMT (envelope-from git) Date: Fri, 23 Jun 2023 23:38:04 GMT Message-Id: <202306232338.35NNc45t076830@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Brooks Davis Subject: git: 880ad3b00f27 - 2023Q2 - devel/llvm15: arm fixes, lite default change List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: ports X-Git-Refname: refs/heads/2023Q2 X-Git-Reftype: branch X-Git-Commit: 880ad3b00f273d47831d183ac44f3b3074d0875a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch 2023Q2 has been updated by brooks: URL: https://cgit.FreeBSD.org/ports/commit/?id=880ad3b00f273d47831d183ac44f3b3074d0875a commit 880ad3b00f273d47831d183ac44f3b3074d0875a Author: Brooks Davis AuthorDate: 2023-06-19 18:44:05 +0000 Commit: Brooks Davis CommitDate: 2023-06-23 21:01:37 +0000 devel/llvm15: arm fixes, lite default change Change the lite flavor to default to BE_FREEBSD rather than BE_NATIVE to allow its use in cross-build CI pipelines. Backport fix for LLVM bug 61396. [0] This fixes miscompilation of gcc on 32-bit arm. Remove an obsolete patch which breaks arm64. [1] PR: 271992 [0], 271616 [1] Reported by: jfc@mit.edu [0,1] (cherry picked from commit f67260aafd1cfb5eb91cfc72df80a00ef8b87e13) --- devel/llvm15/Makefile | 4 +- devel/llvm15/files/patch-backport-962c306a1 | 42 +++++++++++++ devel/llvm15/files/patch-freebsd-r352318 | 93 ----------------------------- 3 files changed, 44 insertions(+), 95 deletions(-) diff --git a/devel/llvm15/Makefile b/devel/llvm15/Makefile index 7a5ba01e3dd9..8fc1fc372b0c 100644 --- a/devel/llvm15/Makefile +++ b/devel/llvm15/Makefile @@ -1,6 +1,6 @@ PORTNAME= llvm DISTVERSION= 15.0.7 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= devel lang MASTER_SITES= https://github.com/llvm/llvm-project/releases/download/llvmorg-${DISTVERSION:S/rc/-rc/}/ \ https://${PRE_}releases.llvm.org/${LLVM_RELEASE}${RCDIR}/ @@ -97,7 +97,7 @@ OPTIONS_SINGLE_BACKENDS=BE_FREEBSD BE_NATIVE BE_STANDARD OPTIONS_SUB= yes .if ${FLAVOR:Mlite} -OPTIONS_DEFAULT+= BE_NATIVE +OPTIONS_DEFAULT+= BE_FREEBSD .else OPTIONS_DEFINE+= EXTRAS FLANG LIT LLDB MLIR OPENMP PYCLANG OPTIONS_DEFINE_aarch64= OPENMP diff --git a/devel/llvm15/files/patch-backport-962c306a1 b/devel/llvm15/files/patch-backport-962c306a1 new file mode 100644 index 000000000000..1b37decff88b --- /dev/null +++ b/devel/llvm15/files/patch-backport-962c306a1 @@ -0,0 +1,42 @@ +commit 8e1222aee4c657e572b7d7841daf7f48ec6ba035 +Author: John F. Carr +Date: Tue Jun 13 14:10:00 2023 -0400 + + LLVM commit 962c306a11d0a21c884c12e18825b8a41ba1bd7d + +diff --git a/contrib/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/contrib/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +index 5fd4e45d80fb..9d95cb25efa0 100644 +--- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp ++++ llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +@@ -4627,11 +4627,17 @@ void LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) { + WideningDecision == CM_Interleave); + }; + +- + // Returns true if Ptr is the pointer operand of a memory access instruction +- // I, and I is known to not require scalarization. ++ // I, I is known to not require scalarization, and the pointer is not also ++ // stored. + auto isVectorizedMemAccessUse = [&](Instruction *I, Value *Ptr) -> bool { +- return getLoadStorePointerOperand(I) == Ptr && isUniformDecision(I, VF); ++ auto GetStoredValue = [I]() -> Value * { ++ if (!isa(I)) ++ return nullptr; ++ return I->getOperand(0); ++ }; ++ return getLoadStorePointerOperand(I) == Ptr && isUniformDecision(I, VF) && ++ GetStoredValue() != Ptr; + }; + + // Holds a list of values which are known to have at least one uniform use. +@@ -4679,8 +4685,8 @@ void LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) { + if (isa(I) && Legal->isUniformMemOp(I)) + addToWorklistIfAllowed(&I); + +- if (isUniformDecision(&I, VF)) { +- assert(isVectorizedMemAccessUse(&I, Ptr) && "consistency check"); ++ if (isVectorizedMemAccessUse(&I, Ptr)) { ++ assert(isUniformDecision(&I, VF) && "consistency check"); + HasUniformUse.insert(Ptr); + } + } diff --git a/devel/llvm15/files/patch-freebsd-r352318 b/devel/llvm15/files/patch-freebsd-r352318 deleted file mode 100644 index 4fe5c836b6ea..000000000000 --- a/devel/llvm15/files/patch-freebsd-r352318 +++ /dev/null @@ -1,93 +0,0 @@ -commit 24b1a5b926832f68fa0a008b2484d4b44f58ee8e -Author: dim -Date: Sat Sep 14 10:55:33 2019 +0000 - - Revert commit from upstream llvm trunk (by Hans Wennborg): - - Re-commit r357452 (take 3): "SimplifyCFG - SinkCommonCodeFromPredecessors: Also sink function calls without used - results (PR41259)" - - Third time's the charm. - - This was reverted in r363220 due to being suspected of an internal - benchmark regression and a test failure, none of which turned out to - be caused by this. - - As reported in https://bugs.llvm.org/show_bug.cgi?id=43269, this causes - UNREACHABLE errors when compiling if_malo_pci.c for arm and aarch64. - -Notes: - svn path=/projects/clang900-import/; revision=352318 - -diff --git lib/Transforms/Utils/SimplifyCFG.cpp lib/Transforms/Utils/SimplifyCFG.cpp -index 11651d040dc0..6e2ef67408d9 100644 ---- llvm/lib/Transforms/Utils/SimplifyCFG.cpp -+++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp -@@ -1428,10 +1428,9 @@ static bool HoistThenElseCodeToIf(BranchInst *BI, - static bool canSinkInstructions( - ArrayRef Insts, - DenseMap> &PHIOperands) { -- // Prune out obviously bad instructions to move. Each instruction must have -- // exactly zero or one use, and we check later that use is by a single, common -- // PHI instruction in the successor. -- bool HasUse = !Insts.front()->user_empty(); -+ // Prune out obviously bad instructions to move. Any non-store instruction -+ // must have exactly one use, and we check later that use is by a single, -+ // common PHI instruction in the successor. - for (auto *I : Insts) { - // These instructions may change or break semantics if moved. - if (isa(I) || I->isEHPad() || isa(I) || -@@ -1445,10 +1444,9 @@ static bool canSinkInstructions( - if (C->isInlineAsm()) - return false; - -- // Each instruction must have zero or one use. -- if (HasUse && !I->hasOneUse()) -- return false; -- if (!HasUse && !I->user_empty()) -+ // Everything must have only one use too, apart from stores which -+ // have no uses. -+ if (!isa(I) && !I->hasOneUse()) - return false; - } - -@@ -1457,11 +1455,11 @@ static bool canSinkInstructions( - if (!I->isSameOperationAs(I0)) - return false; - -- // All instructions in Insts are known to be the same opcode. If they have a -- // use, check that the only user is a PHI or in the same block as the -- // instruction, because if a user is in the same block as an instruction we're -- // contemplating sinking, it must already be determined to be sinkable. -- if (HasUse) { -+ // All instructions in Insts are known to be the same opcode. If they aren't -+ // stores, check the only user of each is a PHI or in the same block as the -+ // instruction, because if a user is in the same block as an instruction -+ // we're contemplating sinking, it must already be determined to be sinkable. -+ if (!isa(I0)) { - auto *PNUse = dyn_cast(*I0->user_begin()); - auto *Succ = I0->getParent()->getTerminator()->getSuccessor(0); - if (!all_of(Insts, [&PNUse,&Succ](const Instruction *I) -> bool { -@@ -1539,7 +1537,7 @@ static bool sinkLastInstruction(ArrayRef Blocks) { - // it is slightly over-aggressive - it gets confused by commutative instructions - // so double-check it here. - Instruction *I0 = Insts.front(); -- if (!I0->user_empty()) { -+ if (!isa(I0)) { - auto *PNUse = dyn_cast(*I0->user_begin()); - if (!all_of(Insts, [&PNUse](const Instruction *I) -> bool { - auto *U = cast(*I->user_begin()); -@@ -1597,10 +1595,11 @@ static bool sinkLastInstruction(ArrayRef Blocks) { - I0->andIRFlags(I); - } - -- if (!I0->user_empty()) { -+ if (!isa(I0)) { - // canSinkLastInstruction checked that all instructions were used by - // one and only one PHI node. Find that now, RAUW it to our common - // instruction and nuke it. -+ assert(I0->hasOneUse()); - auto *PN = cast(*I0->user_begin()); - PN->replaceAllUsesWith(I0); - PN->eraseFromParent();