From nobody Sat Dec 25 11:56:26 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 9491318F3DEE; Sat, 25 Dec 2021 11:56: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 4JLj7v4qLTz4ln4; Sat, 25 Dec 2021 11:56:27 +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 5DB1816C5C; Sat, 25 Dec 2021 11:56:26 +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 1BPBuQIV007495; Sat, 25 Dec 2021 11:56:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BPBuQKo007494; Sat, 25 Dec 2021 11:56:26 GMT (envelope-from git) Date: Sat, 25 Dec 2021 11:56:26 GMT Message-Id: <202112251156.1BPBuQKo007494@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: e06dc0bf2b96 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: e06dc0bf2b96663cf165c38eec960151881b7952 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640433387; 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=Y+ewZxSIxww6WMGr4IS3AwQ4aB7PAui8ZjBEIzupPCM=; b=gvVZzlBk8uKqBumC+fqdKyhuEXdecn12SZwxKGISgVpYPB5ff9GgWhNE1BJFVgGkP1h3jH 70TJcGHT/RiIWOXbgp3Rli4sS1/NC/zSQDm8EW5BVpk/kBYSwoXh52ycV4EO7kyn/9oUux DWdU83G61kAVJrKOz7x7yVU/2r/lxWCk+hASKF14a7Tmjz9J/2aMxWlWN5L8eTxME0EGUd YFlseCIm00ApHgzOxcyOXhksa5pYlTckM823lYZOWS6G7nkv8zCZibaUF0XkqZDyIAWTdx fRZSC96FJIUgszhh35r05VdYDYEHWL05wX0O4U3tAxw+1v1X2yMOzNJOtN+N0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640433387; a=rsa-sha256; cv=none; b=VP/YKETPhJd3CppIBx3Zc06bS+qRmEEeqMji9hoFs5uYZ/c8rxrlQlHoySRvVqzwQ+CEhh TlI5o6Yxix1g0sz0m62D7K/6GCAzDNuR2z0XN43PAm4dnKBpenBMHipPn/TEAVRR392sbN 24EgOmk58kNyNobpFYKHaUwaBdKNq0WEB+354L76b72hBkz54BRCDBmijWnFqDk2KUbgbw P8EeDFd2LZj0eQISxqDJ84j7LrzVI+Tcmp3br8aTC5eQWF2euxYKpe571573bGsI4+pcuF pVtTmVfqlIX/eU3FE3cjnT7pbHzBqh5hwT7DNwP6TfBjwq1kRcPiHDjObmnHbQ== 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=e06dc0bf2b96663cf165c38eec960151881b7952 commit e06dc0bf2b96663cf165c38eec960151881b7952 Author: Dimitry Andric AuthorDate: 2021-11-02 10:17:37 +0000 Commit: Dimitry Andric CommitDate: 2021-12-25 11:51:40 +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)