[all-commits] [llvm/llvm-project] 1eae7f: [CalcSpillWeights] Avoid x87 excess precision infl...

Dimitry Andric via All-commits all-commits at lists.llvm.org
Sat Aug 10 03:05:49 PDT 2024


  Branch: refs/heads/release/19.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 1eae7f714a6ce9499bc115d5880b81f146cb7eee
      https://github.com/llvm/llvm-project/commit/1eae7f714a6ce9499bc115d5880b81f146cb7eee
  Author: Dimitry Andric <dimitry at andric.com>
  Date:   2024-08-10 (Sat, 10 Aug 2024)

  Changed paths:
    M llvm/include/llvm/Support/MathExtras.h
    M llvm/lib/CodeGen/CalcSpillWeights.cpp
    A llvm/test/CodeGen/X86/pr99396.ll

  Log Message:
  -----------
  [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 7af3432e22b0, 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.

(cherry picked from commit c80c09f3e380a0a2b00b36bebf72f43271a564c1)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list