зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1085298 - IonMonkey: Fix for when folding ternary constructs and a branch dominates both MPhi predecessors, r=nbp
This commit is contained in:
Родитель
d09b5b8702
Коммит
e69262b1cf
|
@ -0,0 +1,7 @@
|
|||
function f(x, y) {
|
||||
return (y | 0 && x ? y | 0 : 0)
|
||||
}
|
||||
m = [1]
|
||||
assertEq(f(m[0], m[0]), 1)
|
||||
assertEq(f(m[1], m[0]), 0)
|
||||
assertEq(f(m[2], m[0]), 0)
|
|
@ -1265,14 +1265,14 @@ MPhi::foldsTernary()
|
|||
MTest *test = pred->lastIns()->toTest();
|
||||
|
||||
// True branch may only dominate one edge of MPhi.
|
||||
if (test->ifTrue()->dominates(block()->getPredecessor(0)) &&
|
||||
if (test->ifTrue()->dominates(block()->getPredecessor(0)) ==
|
||||
test->ifTrue()->dominates(block()->getPredecessor(1)))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// False branch may only dominate one edge of MPhi.
|
||||
if (test->ifFalse()->dominates(block()->getPredecessor(0)) &&
|
||||
if (test->ifFalse()->dominates(block()->getPredecessor(0)) ==
|
||||
test->ifFalse()->dominates(block()->getPredecessor(1)))
|
||||
{
|
||||
return nullptr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче