Skip to content

Commit

Permalink
Remove unused pseudo-instructions on x86
Browse files Browse the repository at this point in the history
The following instructions are not used anywhere in the codebase nor in
any downstream projects:

- VGFENCE
- WRTBAR
- FPREGSPILL
- RestoreVMThread
- PPS_OPCount
- PPS_OPField
  • Loading branch information
fjeremic committed Jun 9, 2021
1 parent 5849cdc commit d317906
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 55 deletions.
6 changes: 0 additions & 6 deletions compiler/x/codegen/OMRInstOpCode.enum
Original file line number Diff line number Diff line change
Expand Up @@ -1037,15 +1037,9 @@
VFNMSUB213SDRegRegMem,
VFNMSUB231SDRegRegReg,
VFNMSUB231SDRegRegMem,
VGFENCE,
DQImm64,
DDImm4,
DWImm2,
DBImm1,
WRTBAR,
FPREGSPILL,
FCMPEVAL,
RestoreVMThread,
PPS_OPCount,
PPS_OPField,
AdjustFramePtr,
6 changes: 0 additions & 6 deletions compiler/x/codegen/OMRInstOpCode.enum.temp.defines
Original file line number Diff line number Diff line change
Expand Up @@ -1025,15 +1025,9 @@
#define VFNMSUB213SDRegRegMem OMR::InstOpCode::VFNMSUB213SDRegRegMem
#define VFNMSUB231SDRegRegReg OMR::InstOpCode::VFNMSUB231SDRegRegReg
#define VFNMSUB231SDRegRegMem OMR::InstOpCode::VFNMSUB231SDRegRegMem
#define VGFENCE OMR::InstOpCode::VGFENCE
#define DQImm64 OMR::InstOpCode::DQImm64
#define DDImm4 OMR::InstOpCode::DDImm4
#define DWImm2 OMR::InstOpCode::DWImm2
#define DBImm1 OMR::InstOpCode::DBImm1
#define WRTBAR OMR::InstOpCode::WRTBAR
#define FPREGSPILL OMR::InstOpCode::FPREGSPILL
#define FCMPEVAL OMR::InstOpCode::FCMPEVAL
#define RestoreVMThread OMR::InstOpCode::RestoreVMThread
#define PPS_OPCount OMR::InstOpCode::PPS_OPCount
#define PPS_OPField OMR::InstOpCode::PPS_OPField
#define AdjustFramePtr OMR::InstOpCode::AdjustFramePtr
2 changes: 1 addition & 1 deletion compiler/x/codegen/OMRInstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ OMR::X86::Instruction::initialize(TR::CodeGenerator *cg, TR::RegisterDependencyC
{
cond->useRegisters(self(), cg);

if (flag && op != FPREGSPILL && cg->enableRegisterAssociations())
if (flag && cg->enableRegisterAssociations())
{
cond->createRegisterAssociationDirective(self(), cg);
}
Expand Down
3 changes: 1 addition & 2 deletions compiler/x/codegen/OMRMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@ TR::RealRegister *OMR::X86::Machine::freeBestGPRegister(TR::Instruction
break;
}

if (cursor->getOpCodeValue() == TR::InstOpCode::fence ||
cursor->getOpCodeValue() == FPREGSPILL)
if (cursor->getOpCodeValue() == TR::InstOpCode::fence)
continue;

for (i = 0; i < numCandidates; i++)
Expand Down
13 changes: 1 addition & 12 deletions compiler/x/codegen/OMRX86Instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@ void TR::X86RegRegRegInstruction::assignRegisters(TR_RegisterKinds kindsToBeAssi

if (firstRegister->decFutureUseCount() == 0 &&
assignedFirstRegister->getState() != TR::RealRegister::Locked &&
firstRegister == getTargetRegister() &&
getOpCodeValue() != WRTBAR)
firstRegister == getTargetRegister())
{
cg()->traceRegFreed(firstRegister, assignedFirstRegister);
firstRegister->setAssignedRegister(NULL);
Expand Down Expand Up @@ -1423,16 +1422,6 @@ void TR::X86RegRegRegInstruction::assignRegisters(TR_RegisterKinds kindsToBeAssi
}
}

if (firstRegister->getFutureUseCount() == 0 &&
assignedFirstRegister->getState() != TR::RealRegister::Locked &&
getOpCodeValue() == WRTBAR)
{
cg()->traceRegFreed(firstRegister, assignedFirstRegister);
firstRegister->setAssignedRegister(NULL);
assignedFirstRegister->setAssignedRegister(NULL);
assignedFirstRegister->setState(TR::RealRegister::Free);
}

setTargetRegister(assignedFirstRegister);
setSourceRegister(assignedSecondRegister);
setSource2ndRegister(assignedThirdRegister);
Expand Down
24 changes: 0 additions & 24 deletions compiler/x/codegen/X86Ops.ins
Original file line number Diff line number Diff line change
Expand Up @@ -4084,10 +4084,6 @@ INSTRUCTION(VFNMSUB231SDRegRegMem, vfnmsub231sd,
PROPERTY1(IA32OpProp1_XMMSource | IA32OpProp1_SourceIsMemRef | IA32OpProp1_XMMTarget)),

// OpCodes beyond this point are pseudo instructions; they are for OMR internal usage only.
INSTRUCTION(VGFENCE, VGFence, // Special Fence used for patching virtual guards
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(0),
PROPERTY1(IA32OpProp1_PseudoOp)),
INSTRUCTION(DQImm64, dq, // Define 8 bytes
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_8),
PROPERTY0(0),
Expand All @@ -4104,30 +4100,10 @@ INSTRUCTION(DBImm1, db, // Define 1 byte
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_1),
PROPERTY0(IA32OpProp_ByteImmediate),
PROPERTY1(IA32OpProp1_PseudoOp)),
INSTRUCTION(WRTBAR, wrtbar, // Write barrier directive/macro for GCs that need them
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(IA32OpProp_UsesTarget | IA32OpProp_ModifiesTarget | IA32OpProp_IntSource | IA32OpProp_IntTarget | IA32OpProp_ByteTarget),
PROPERTY1(IA32OpProp1_PseudoOp)),
INSTRUCTION(FPREGSPILL, fpRegSpill, // Directive to force the FP stack to be spilled
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(0),
PROPERTY1(IA32OpProp1_PseudoOp)),
INSTRUCTION(FCMPEVAL, fcmpEval, // Instruction selection of FP comparisons at register assignment time
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(0),
PROPERTY1(IA32OpProp1_PseudoOp)),
INSTRUCTION(RestoreVMThread, RestoreVMThread, // restore VM thread register from fs:[0]
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(0),
PROPERTY1(IA32OpProp1_PseudoOp)),
INSTRUCTION(PPS_OPCount, PPS_OPCount, // Phase profiling site (object access counting)
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(IA32OpProp_UsesTarget | IA32OpProp_ModifiesOverflowFlag | IA32OpProp_ModifiesSignFlag | IA32OpProp_ModifiesZeroFlag | IA32OpProp_ModifiesParityFlag | IA32OpProp_ModifiesCarryFlag),
PROPERTY1(IA32OpProp1_PseudoOp)),
INSTRUCTION(PPS_OPField, PPS_OPField, // Phase profiling site (object field counting)
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(IA32OpProp_ModifiesOverflowFlag | IA32OpProp_ModifiesSignFlag | IA32OpProp_ModifiesZeroFlag | IA32OpProp_ModifiesParityFlag | IA32OpProp_ModifiesCarryFlag),
PROPERTY1(IA32OpProp1_PseudoOp)),
INSTRUCTION(AdjustFramePtr, AdjustFramePtr, // Adjust frame pointer
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(0),
Expand Down
4 changes: 0 additions & 4 deletions compiler/x/i386/codegen/IA32SystemLinkage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,6 @@ TR::IA32SystemLinkage::buildVolatileAndReturnDependencies(
{
deps->addPostCondition(returnReg, _properties.getFloatReturnRegister(), cg());
}
else
{
// No need for a dummy dep here because FPREGSPILL instruction takes care of it
}

// The reg dependency is left open intentionally, and need to be closed by
// the caller. The reason is because, child class might call this method, while
Expand Down

0 comments on commit d317906

Please sign in to comment.