mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
CalcSpillWeights: Hack to prevent x87 nonsense
This gross hack forces `hweight` into memory, preventing hidden precision from making `1 > 1` occasionally equal `true`. <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206765 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
85af3e7445
commit
d5ebbc5edf
@ -149,7 +149,11 @@ VirtRegAuxInfo::calculateSpillWeightAndHint(LiveInterval &li) {
|
||||
unsigned hint = copyHint(mi, li.reg, tri, mri);
|
||||
if (!hint)
|
||||
continue;
|
||||
float hweight = Hint[hint] += weight;
|
||||
// Force hweight onto the stack so that x86 doesn't add hidden precision,
|
||||
// making the comparison incorrectly pass (i.e., 1 > 1 == true??).
|
||||
//
|
||||
// FIXME: we probably shouldn't use floats at all.
|
||||
volatile float hweight = Hint[hint] += weight;
|
||||
if (TargetRegisterInfo::isPhysicalRegister(hint)) {
|
||||
if (hweight > bestPhys && mri.isAllocatable(hint))
|
||||
bestPhys = hweight, hintPhys = hint;
|
||||
|
Loading…
x
Reference in New Issue
Block a user