aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2024-07-28 11:08:50 +0000
committerDimitry Andric <dim@FreeBSD.org>2024-07-31 07:29:57 +0000
commitc8d0dca5e5f75b98c90ccfb60f8a65523072a8c7 (patch)
tree49bbd2f3d419a27446b00600c05b0f6301a9f1d3
parentdbda7355908fc536e2b1fc6cd5b39c285fd88cc9 (diff)
Revert "Fix llvm register allocator for native/cross build differences"
In preparation for applying the fix that landed upstream, this reverts commit 397c2693fa66508cb5e6b173650a1f3bc6c4dd4f: 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 (cherry picked from commit 52552d7572a6d3d7d3ce0d6862de9a9d203c5d01)
-rw-r--r--contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp
index afde8d001f88..f3cb7fa5af61 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp
+++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp
@@ -256,12 +256,7 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start,
return -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 <https://github.com/llvm/llvm-project/issues/99396> for
- // more details.
- volatile float Weight = 1.0f;
+ float Weight = 1.0f;
if (IsSpillable) {
// Get loop info for mi.
if (MI->getParent() != MBB) {