From nobody Mon Apr 15 16:30:56 2024 X-Original-To: dev-commits-src-main@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 4VJCN05mZmz5GvSp; Mon, 15 Apr 2024 16:30:56 +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 4VJCN04wyZz3x0h; Mon, 15 Apr 2024 16:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713198656; 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=8XWtUGkcGd6UTmUnk96KPlXm8nMudZ5Gqu8GfromHbs=; b=AX2DzUz3MHcmCktSy3WFloK6DJJtS+7YKmcbOKXohXLozQOvUE2bNXkceStp7JBTbDdUSA iNdr+i6lbAYP7pK723W4TS4Fcq1j3RP9zKDz9ovqtKSMiJznRsSf54RR9OCJgCdVixrO3B vrOMf1g+qRqIASd2Q59KmWhjONTrTZqK/mp+BgrFbwEDpiOyKscftLeXEAF3n7Qfvi1U57 zU+Zy0FrkJ2YRWPNbANc0ZFETY5aao5FXabk7kbQB3e8AmQH2wdoWBE/cqf8dOxSz4X39L ClUePsGz3PezMrWetQsn1oqBx376bJPVUtRZCnLPvBy1LK7c0IlN5Wniel2rRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713198656; a=rsa-sha256; cv=none; b=WpG4Fy/6RywUUlU8BiYPZqi66lUy4W1SrB/0VvjkZM+nfaJRF0Bs5ZfJegglPUQJg6Uw5Q t6HtKhPG6+z4wCMv/FM0mF+4gPFqwMJ1hNNdUTHteHiI99WYqazkXneHOZ8ePxLvvf/NtI MrX3BfS3G1PVohZRnW6q1lwZVx9zgMgMoEHVazUFrNhhmBrNc8Cag3LKfEDooX7je6nlnn 0iJAkLYY67b8xkBDtuPnFFyTcUaOZJFqvaKq2i8fd7GAgeEVmrFPz2L+SRH5LdccZiyv7t 8KlAleM5a0O1Kl6N630tGP5DxmUeTv97OB5bv5pRDYOLOd+VbXTkxnOm3szt5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713198656; 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=8XWtUGkcGd6UTmUnk96KPlXm8nMudZ5Gqu8GfromHbs=; b=oEmG1567OUc4rJO5D5sujCucGFtJn6BCfLRUPUb57sZOV28h/MAqkDxnk9QPQYNfWxp9QL EB+9A2ASQH0IWC/5P/f+pCu3lvdcyXqro4ACCVAULRRF+9POa9MGliwBgsSIGGGChx6cJE 5p0AJUwFAys1+4tLFT3oW5CxMqaTB2cGInn3Yp7lkEqRl29tmq1Jv2wXt6JCJuPqFmhVDn DItfdgNQX37izIPoki7Yv/o9D1xyubamEREyuNFGfJC30map5LF3vH2pYBaFi1v4MjjfhT 6clfAQ8w5ywJsX/BoTwZJKrSFSTwNKgQM5bFih+z5iFucW7J65iFoHKIDaUk+g== 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 4VJCN04XSyz16W3; Mon, 15 Apr 2024 16:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43FGUuhY015032; Mon, 15 Apr 2024 16:30:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43FGUumD015028; Mon, 15 Apr 2024 16:30:56 GMT (envelope-from git) Date: Mon, 15 Apr 2024 16:30:56 GMT Message-Id: <202404151630.43FGUumD015028@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: 514c98ba14a0 - main - Merge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com): List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 514c98ba14a0f590891844d1a6bec0ac4de54489 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=514c98ba14a0f590891844d1a6bec0ac4de54489 commit 514c98ba14a0f590891844d1a6bec0ac4de54489 Author: Dimitry Andric AuthorDate: 2024-04-15 16:24:39 +0000 Commit: Dimitry Andric CommitDate: 2024-04-15 16:30:29 +0000 Merge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com): [SimplifyCFG] Fix crash when there is unreachable large index (#88616) The large case index out of scope is dead code, but it is still be created for TableContents in SwitchLookupTable::SwitchLookupTable, so make sure the table size after growing should not get smaller. Fix https://github.com/llvm/llvm-project/issues/88607 This should fix "Assertion failed: (idx < size()), function operator[]" when building the science/dynare port. PR: 276104, 278320 Reported by: yuri MFC after: 1 month --- contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 13eae549b2ce..f95dae1842fe 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -6710,9 +6710,11 @@ static bool SwitchToLookupTable(SwitchInst *SI, IRBuilder<> &Builder, return SwitchLookupTable::WouldFitInRegister( DL, UpperBound, KV.second /* ResultType */); })) { + // There may be some case index larger than the UpperBound (unreachable + // case), so make sure the table size does not get smaller. + TableSize = std::max(UpperBound, TableSize); // The default branch is unreachable after we enlarge the lookup table. // Adjust DefaultIsReachable to reuse code path. - TableSize = UpperBound; DefaultIsReachable = false; } }