mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1207449: Conservatively mark MFilterTypeSet with phis as not float32-compatible; r=h4writer
This commit is contained in:
parent
b24b59bb6c
commit
817cda4607
6
js/src/jit-test/tests/ion/filtertypeset-float32.js
Normal file
6
js/src/jit-test/tests/ion/filtertypeset-float32.js
Normal file
@ -0,0 +1,6 @@
|
||||
function f(x) {
|
||||
return Math.fround((x ? 0 : x) | Math.max(x, x));
|
||||
}
|
||||
for (var j = 0; j < 2; ++j) {
|
||||
assertEq(f((function(){}) - 4294967297 ? 1 : 1 | 0 && 4294967297), 1);
|
||||
}
|
@ -2394,11 +2394,26 @@ MFilterTypeSet::trySpecializeFloat32(TempAllocator& alloc)
|
||||
setResultType(MIRType_Float32);
|
||||
}
|
||||
|
||||
bool
|
||||
MFilterTypeSet::canProduceFloat32() const
|
||||
{
|
||||
// A FilterTypeSet should be a producer if the input is a producer too.
|
||||
// Also, be overly conservative by marking as not float32 producer when the
|
||||
// input is a phi, as phis can be cyclic (phiA -> FilterTypeSet -> phiB ->
|
||||
// phiA) and FilterTypeSet doesn't belong in the Float32 phi analysis.
|
||||
return !input()->isPhi() && input()->canProduceFloat32();
|
||||
}
|
||||
|
||||
bool
|
||||
MFilterTypeSet::canConsumeFloat32(MUse* operand) const
|
||||
{
|
||||
MOZ_ASSERT(getUseFor(0) == operand);
|
||||
return CheckUsesAreFloat32Consumers(this);
|
||||
// A FilterTypeSet should be a consumer if all uses are consumer. See also
|
||||
// comment below MFilterTypeSet::canProduceFloat32.
|
||||
bool allConsumerUses = true;
|
||||
for (MUseDefIterator use(this); allConsumerUses && use; use++)
|
||||
allConsumerUses &= !use.def()->isPhi() && use.def()->canConsumeFloat32(use.use());
|
||||
return allConsumerUses;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -12371,7 +12371,7 @@ class MFilterTypeSet
|
||||
void computeRange(TempAllocator& alloc) override;
|
||||
|
||||
bool isFloat32Commutative() const override { return true; }
|
||||
bool canProduceFloat32() const override { return input()->canProduceFloat32(); }
|
||||
bool canProduceFloat32() const override;
|
||||
bool canConsumeFloat32(MUse* operand) const override;
|
||||
void trySpecializeFloat32(TempAllocator& alloc) override;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user