From nobody Mon Dec 06 16:33:25 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 32A7018B3AF3; Mon, 6 Dec 2021 16:33:29 +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 4J78BG0dm0z3CG4; Mon, 6 Dec 2021 16:33:25 +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 3094E739E; Mon, 6 Dec 2021 16:33:25 +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 1B6GXPFR087663; Mon, 6 Dec 2021 16:33:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B6GXPjr087662; Mon, 6 Dec 2021 16:33:25 GMT (envelope-from git) Date: Mon, 6 Dec 2021 16:33:25 GMT Message-Id: <202112061633.1B6GXPjr087662@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: c009c03b3731 - stable/13 - Fix assertion when building devel/glog with new pass manager 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: c009c03b3731dbbc0461172eb729da461eed5181 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638808407; 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=orBRkEAjqhq/pkOR5SvECtWTHR4uL8Y+8DZ2ufXT3Qw=; b=yjd5qCYcnQUEKoONtk8/B9UEdxLAvjbJD/rZErXmxEjFJt+L8mii2zKXVH8x93hgrtCHi9 oC+ymINFSikRu5jLtpMLiiH3Y/3VCE7Qr4y69UTOk3Indq9n86RxG8nJtFjEz2zvWL+FLo moyPnLbsEnKRrsSuL/kiY4dLwoL3k+U8GKf3aEDMUPKi0XtZkv6e/dANidyOpfm5zmJxI1 qxAYjyXTA6h7GKUEwdLTLr9tuYf88Bzsf4A1oDmGwODM1bC3G/LHe+/Ld16jQ4BbX0gunn St3tWthApy1kes3fusOUWndR+f2gMt4cLPjI0d7Ejv1HvTuTA3J8AUxBSVARWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638808407; a=rsa-sha256; cv=none; b=dYXI/YEdTOH9pCn1nLNHgYUkT85GJZV6A1vIImbzfAgbiCUfIhxnkBLGflqA9ilyPx2mlZ sHjSx+8GqKVZ+OYz8WNvVstsTTFuWkeakGdBaLcLfo2TdlwHj+fT/EwpopRKW1evK05Ofw lpAqNk2nVCpSmQk6MWSA2YXGabiRccAvFuYXVJrmvnvNj5GSq4UHvrNrJEFhO48k0ukue0 4GGjuafqjUlRHfwV3XQZiHayBKmW9dMlE64mllMJOZOfcrM+2YwqtIkQbKfdczZzyAfeJK YyswZTkrlPnxAtRuvBpaZ7CMhuwFmKND80Qn6FAcPdtzPvIHOY8MTTWqzsDUdw== 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=c009c03b3731dbbc0461172eb729da461eed5181 commit c009c03b3731dbbc0461172eb729da461eed5181 Author: Dimitry Andric AuthorDate: 2021-11-02 10:17:37 +0000 Commit: Dimitry Andric CommitDate: 2021-12-06 16:30:09 +0000 Fix assertion when building devel/glog with new pass manager Merge commit 029f1a534489 from llvm git (by Arthur Eubanks): [LazyCallGraph] Skip blockaddresses blockaddresses do not participate in the call graph since the only instructions that use them must all return to someplace within the current function. And passes cannot retrieve a function address from a blockaddress. This was suggested by efriedma in D58260. Fixes PR50881. Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D112178 (cherry picked from commit a18c6161efc903f636c41b8e521e917a5b315ce8) --- .../llvm/include/llvm/Analysis/LazyCallGraph.h | 24 +++------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/contrib/llvm-project/llvm/include/llvm/Analysis/LazyCallGraph.h b/contrib/llvm-project/llvm/include/llvm/Analysis/LazyCallGraph.h index 81500905c0f5..148be34aa73b 100644 --- a/contrib/llvm-project/llvm/include/llvm/Analysis/LazyCallGraph.h +++ b/contrib/llvm-project/llvm/include/llvm/Analysis/LazyCallGraph.h @@ -1098,28 +1098,10 @@ public: continue; } - // The blockaddress constant expression is a weird special case, we can't - // generically walk its operands the way we do for all other constants. - if (BlockAddress *BA = dyn_cast(C)) { - // If we've already visited the function referred to by the block - // address, we don't need to revisit it. - if (Visited.count(BA->getFunction())) - continue; - - // If all of the blockaddress' users are instructions within the - // referred to function, we don't need to insert a cycle. - if (llvm::all_of(BA->users(), [&](User *U) { - if (Instruction *I = dyn_cast(U)) - return I->getFunction() == BA->getFunction(); - return false; - })) - continue; - - // Otherwise we should go visit the referred to function. - Visited.insert(BA->getFunction()); - Worklist.push_back(BA->getFunction()); + // blockaddresses are weird and don't participate in the call graph anyway, + // skip them. + if (isa(C)) continue; - } for (Value *Op : C->operand_values()) if (Visited.insert(cast(Op)).second)