Files
clang-p2996/llvm/lib/CodeGen/CalcSpillWeights.cpp
Dimitry Andric c80c09f3e3 [CalcSpillWeights] Avoid x87 excess precision influencing weight result
Fixes #99396

The result of `VirtRegAuxInfo::weightCalcHelper` can be influenced by
x87 excess precision, which can result in slightly different register
choices when the compiler is hosted on x86_64 or i386. This leads to
different object file output when cross-compiling to i386, or native.

Similar to 7af3432e22, we need to add a `volatile` qualifier to the
local `Weight` variable to force it onto the stack, and avoid the excess
precision. Define `stack_float_t` in `MathExtras.h` for this purpose,
and use it.
2024-07-26 20:47:33 +02:00

12 KiB