Bug 1096138 - IonMonkey: Augment Nops with Mops to avoid collisions with fixed live ranges r=jandem

This commit is contained in:
Dan Gohman 2014-12-23 13:52:51 -08:00
parent f85e7a0f62
commit b2b9b81990
5 changed files with 23 additions and 0 deletions

View File

@ -1791,6 +1791,11 @@ CodeGenerator::visitNop(LNop *lir)
{
}
void
CodeGenerator::visitMop(LMop *lir)
{
}
void
CodeGenerator::visitOsiPoint(LOsiPoint *lir)
{

View File

@ -63,6 +63,7 @@ class CodeGenerator : public CodeGeneratorSpecific
void visitLabel(LLabel *lir);
void visitNop(LNop *lir);
void visitMop(LMop *lir);
void visitOsiPoint(LOsiPoint *lir);
void visitGoto(LGoto *lir);
void visitTableSwitch(LTableSwitch *ins);

View File

@ -43,6 +43,12 @@ class LNop : public LInstructionHelper<0, 0, 0>
LIR_HEADER(Nop)
};
class LMop : public LInstructionHelper<0, 0, 0>
{
public:
LIR_HEADER(Mop)
};
// An LOsiPoint captures a snapshot after a call and ensures enough space to
// patch in a call to the invalidation mechanism.
//

View File

@ -10,6 +10,7 @@
#define LIR_COMMON_OPCODE_LIST(_) \
_(Label) \
_(Nop) \
_(Mop) \
_(OsiPoint) \
_(MoveGroup) \
_(Integer) \

View File

@ -4117,10 +4117,20 @@ LIRGenerator::visitInstruction(MInstruction *ins)
ins->setInWorklistUnchecked();
#endif
// If we added a Nop for this instruction, we'll also add a Mop, so that
// that live-ranges for fixed register defs, which with LSRA extend through
// the Nop so that they can extend through the OsiPoint don't, with their
// one-extra extension, extend into a position where they use the input
// move group for the following instruction.
bool needsMop = !current->instructions().empty() && current->rbegin()->isNop();
// If no safepoint was created, there's no need for an OSI point.
if (LOsiPoint *osiPoint = popOsiPoint())
add(osiPoint);
if (needsMop)
add(new(alloc()) LMop);
return !gen->errored();
}