From nobody Sun Jul 21 20:41:28 2024 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 4WRwLJ6WSdz5QSBc; Sun, 21 Jul 2024 20:41:28 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WRwLJ5qS2z4FnK; Sun, 21 Jul 2024 20:41:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721594488; 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=LOShq+gt3M+3OeV+hpirKTQbIDymYv1uuozlQts6pjg=; b=geYqZcunMSeptlf81/98YzyoFTVPyvLmoFZbyY/F9k5k2fidlUMIizL9D+6bGvu07xJf/a coAVqG3zxEDlNJQAXukMe0XHSJprS83jqwrKn01oKz3a7sREnX5GfKjVDcG+03x8JlQ/be IBaXb6OuGJFR/6ib/hwvkKiJ9hleAMCMRQSB72zz7uLOpINBIogummI2zN8WiZnay0UDAR zoZ99zKHhXTcOPq0q7V152Oe4oKH1TIgh33GP316i6MClYOb9mJbHsh6d57rsfGXRFrS0P +Cs8301jX+hPtTFvcitKgPMeq7LJ4zCowncwhrh54KfIiTPceQvrgAqkJCXJ5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721594488; a=rsa-sha256; cv=none; b=cjzG4DU9FXDNUJZhFC6hHiX/uhenGhuFW/aRJHuzWPRGa0ACPRhm8bvSRPEfvcQ1RwXVbS 32Ud5Nu1if8XESuIzO6fWDW6B8Vx+YEWAHSKLumCeWhg+s5g+RnpC8BMJoibW3y1Qx4gkF 9gyEhqHVBVvXGamx47FcGBd8wM3j8/ne69WeWV7AInM5xpUQbVs2QFb/CV2HdmMUeWN8Pl hCMQaI4C7Jei/6xIDeZRWqe5tnA9NQJBaN9BIqf6+9FrxfHX+fgXEuSwjU+9lthko2v+Il LzKV4BB+HduvEu9qvcvVlfS8rzFCy3b+fgKiG5jtVwxiQ6aNmsFeI75aLOyznQ== 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=1721594488; 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=LOShq+gt3M+3OeV+hpirKTQbIDymYv1uuozlQts6pjg=; b=REPbh8R79u6HBSm9Q5tTFnbqihc6uRvjKQktocVYU3fJ/Ds5HFAu6G+grhACA5AhO3dAfJ OAMHMyL0iCEIB1Hnm4pDNzNy7dRQ1uMzKzJ2werYNL44NqoitbehcqCnr+zIM2iw8yNZBi nQIEaBAXKPghpetQKmFMIx1MNdolauXJeHPvNcVwDf/bRiHZfeShpZoi6QWhVmdNKzYdbl MjSBokmdByzZj3gYsu202g3cTdrinDnuuB1QaHDDr5Y06z2caJwvEO08CrwIJxfRf1mtmC pI5R0TdDKqpwRvtRZABHB/lnpF+JfxgIpP1KqCcMRD7Y7l0FBNE3Id1OAOeewg== 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 4WRwLJ5QghzFqL; Sun, 21 Jul 2024 20:41:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46LKfSMN082000; Sun, 21 Jul 2024 20:41:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46LKfSfZ081997; Sun, 21 Jul 2024 20:41:28 GMT (envelope-from git) Date: Sun, 21 Jul 2024 20:41:28 GMT Message-Id: <202407212041.46LKfSfZ081997@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: 397c2693fa66 - main - Fix llvm register allocator for native/cross build differences 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 397c2693fa66508cb5e6b173650a1f3bc6c4dd4f Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=397c2693fa66508cb5e6b173650a1f3bc6c4dd4f commit 397c2693fa66508cb5e6b173650a1f3bc6c4dd4f Author: Dimitry Andric AuthorDate: 2024-07-21 20:37:27 +0000 Commit: Dimitry Andric CommitDate: 2024-07-21 20:37:27 +0000 Fix llvm register allocator for native/cross build differences Work around an issue in LLVM's register allocator, which can cause slightly different i386 object files, when produced by a native or cross build of clang. This adds another volatile qualifier to a float variable declaration in the weightCalcHelper() function, which otherwise produces slightly different float results on amd64 and i386 hosts. In turn, this can lead to different (but equivalent) register choices, and thus non-identical assembly code. See https://github.com/llvm/llvm-project/issues/99396 for more details. Note this is a temporary fix, meant to merge in time for 13.4. As soon as upstream has a permanent solution we will import that. PR: 276961 Reported by: cperciva MFC after: 3 days --- contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index f3cb7fa5af61..afde8d001f88 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -256,7 +256,12 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - float Weight = 1.0f; + // FreeBSD customization: similar to the HWeight declaration below, add a + // volatile qualifier to avoid slightly different weight results on amd64 + // and i386 hosts, and possibly choosing different registers in the register + // allocator. See for + // more details. + volatile float Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) {