forked from OSchip/llvm-project
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> llvm-svn: 206765
This commit is contained in:
parent
b96ca6b0c8
commit
7af3432e22
|
@ -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…
Reference in New Issue