mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1029830 - IonMonkey: GVN: Now that there are foldsTo functions using dependency information, clear it when it becomes invalid r=nbp
This commit is contained in:
parent
0f6c117812
commit
7d8db9d4b5
@ -468,6 +468,21 @@ ValueNumberer::loopHasOptimizablePhi(MBasicBlock *backedge) const
|
|||||||
bool
|
bool
|
||||||
ValueNumberer::visitDefinition(MDefinition *def)
|
ValueNumberer::visitDefinition(MDefinition *def)
|
||||||
{
|
{
|
||||||
|
// If this instruction has a dependency() into an unreachable block, we'll
|
||||||
|
// need to update AliasAnalysis.
|
||||||
|
const MDefinition *dep = def->dependency();
|
||||||
|
if (dep != nullptr && dep->block()->isDead()) {
|
||||||
|
JitSpew(JitSpew_GVN, " AliasAnalysis invalidated");
|
||||||
|
if (updateAliasAnalysis_ && !dependenciesBroken_) {
|
||||||
|
// TODO: Recomputing alias-analysis could theoretically expose more
|
||||||
|
// GVN opportunities.
|
||||||
|
JitSpew(JitSpew_GVN, " Will recompute!");
|
||||||
|
dependenciesBroken_ = true;
|
||||||
|
}
|
||||||
|
// Clear its dependency for now, to protect foldsTo.
|
||||||
|
def->setDependency(def->toInstruction());
|
||||||
|
}
|
||||||
|
|
||||||
// Look for a simplified form of |def|.
|
// Look for a simplified form of |def|.
|
||||||
MDefinition *sim = simplified(def);
|
MDefinition *sim = simplified(def);
|
||||||
if (sim != def) {
|
if (sim != def) {
|
||||||
@ -523,16 +538,6 @@ ValueNumberer::visitDefinition(MDefinition *def)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this instruction has a dependency() into an unreachable block, we'll
|
|
||||||
// need to update AliasAnalysis.
|
|
||||||
if (updateAliasAnalysis_ && !dependenciesBroken_) {
|
|
||||||
const MDefinition *dep = def->dependency();
|
|
||||||
if (dep != nullptr && dep->block()->isDead()) {
|
|
||||||
JitSpew(JitSpew_GVN, " AliasAnalysis invalidated; will recompute!");
|
|
||||||
dependenciesBroken_ = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user