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

Dimitry Andric via All-commits all-commits at lists.llvm.org
Fri Jul 26 11:49:08 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c80c09f3e380a0a2b00b36bebf72f43271a564c1
      https://github.com/llvm/llvm-project/commit/c80c09f3e380a0a2b00b36bebf72f43271a564c1
  Author: Dimitry Andric <dimitry at andric.com>
  Date:   2024-07-26 (Fri, 26 Jul 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.



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