зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1763099 - Part 6: Remove MBasicBlock::discardDef(). r=jandem,nbp
Both callers to `MBasicBlock::discardDef()` can be changed to call `MBasicBlock::discard()`. Depends on D142926 Differential Revision: https://phabricator.services.mozilla.com/D142927
This commit is contained in:
Родитель
74176c41e8
Коммит
dd81e56ec0
|
@ -3390,15 +3390,15 @@ bool jit::EliminateRedundantChecks(MIRGraph& graph) {
|
|||
if (!def->isBoundsCheck()) {
|
||||
continue;
|
||||
}
|
||||
auto* boundsCheck = def->toBoundsCheck();
|
||||
|
||||
bool eliminated = false;
|
||||
if (!TryEliminateBoundsCheck(checks, index, def->toBoundsCheck(),
|
||||
&eliminated)) {
|
||||
if (!TryEliminateBoundsCheck(checks, index, boundsCheck, &eliminated)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (eliminated) {
|
||||
block->discardDef(def);
|
||||
block->discard(boundsCheck);
|
||||
}
|
||||
}
|
||||
index++;
|
||||
|
|
|
@ -670,14 +670,6 @@ void MBasicBlock::discardIgnoreOperands(MInstruction* ins) {
|
|||
instructions_.remove(ins);
|
||||
}
|
||||
|
||||
void MBasicBlock::discardDef(MDefinition* at) {
|
||||
if (at->isPhi()) {
|
||||
at->block()->discardPhi(at->toPhi());
|
||||
} else {
|
||||
at->block()->discard(at->toInstruction());
|
||||
}
|
||||
}
|
||||
|
||||
void MBasicBlock::discardAllInstructions() {
|
||||
MInstructionIterator iter = begin();
|
||||
discardAllInstructionsStartingAt(iter);
|
||||
|
|
|
@ -315,7 +315,6 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock> {
|
|||
// Removes an instruction with the intention to discard it.
|
||||
void discard(MInstruction* ins);
|
||||
void discardLastIns();
|
||||
void discardDef(MDefinition* def);
|
||||
void discardAllInstructions();
|
||||
void discardAllInstructionsStartingAt(MInstructionIterator iter);
|
||||
void discardAllPhis();
|
||||
|
|
|
@ -367,11 +367,12 @@ bool RangeAnalysis::removeBetaNodes() {
|
|||
for (MDefinitionIterator iter(*i); iter;) {
|
||||
MDefinition* def = *iter++;
|
||||
if (def->isBeta()) {
|
||||
MDefinition* op = def->getOperand(0);
|
||||
JitSpew(JitSpew_Range, " Removing beta node %u for %u", def->id(),
|
||||
auto* beta = def->toBeta();
|
||||
MDefinition* op = beta->input();
|
||||
JitSpew(JitSpew_Range, " Removing beta node %u for %u", beta->id(),
|
||||
op->id());
|
||||
def->justReplaceAllUsesWith(op);
|
||||
block->discardDef(def);
|
||||
beta->justReplaceAllUsesWith(op);
|
||||
block->discard(beta);
|
||||
} else {
|
||||
// We only place Beta nodes at the beginning of basic
|
||||
// blocks, so if we see something else, we can move on
|
||||
|
|
Загрузка…
Ссылка в новой задаче