forked from OSchip/llvm-project
Remove custom inserter for MWAIT. It doesn't do anything that couldn't be represented in a pattern.
llvm-svn: 161306
This commit is contained in:
parent
43ee9fae92
commit
6d0408d3a5
|
@ -11899,24 +11899,6 @@ X86TargetLowering::EmitMonitor(MachineInstr *MI, MachineBasicBlock *BB) const {
|
|||
return BB;
|
||||
}
|
||||
|
||||
MachineBasicBlock *
|
||||
X86TargetLowering::EmitMwait(MachineInstr *MI, MachineBasicBlock *BB) const {
|
||||
DebugLoc dl = MI->getDebugLoc();
|
||||
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
||||
|
||||
// First arg in ECX, the second in EAX.
|
||||
BuildMI(*BB, MI, dl, TII->get(TargetOpcode::COPY), X86::ECX)
|
||||
.addReg(MI->getOperand(0).getReg());
|
||||
BuildMI(*BB, MI, dl, TII->get(TargetOpcode::COPY), X86::EAX)
|
||||
.addReg(MI->getOperand(1).getReg());
|
||||
|
||||
// The instruction doesn't actually take any operands though.
|
||||
BuildMI(*BB, MI, dl, TII->get(X86::MWAITrr));
|
||||
|
||||
MI->eraseFromParent(); // The pseudo is gone now.
|
||||
return BB;
|
||||
}
|
||||
|
||||
MachineBasicBlock *
|
||||
X86TargetLowering::EmitVAARG64WithCustomInserter(
|
||||
MachineInstr *MI,
|
||||
|
@ -12721,8 +12703,6 @@ X86TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||
// Thread synchronization.
|
||||
case X86::MONITOR:
|
||||
return EmitMonitor(MI, BB);
|
||||
case X86::MWAIT:
|
||||
return EmitMwait(MI, BB);
|
||||
|
||||
// Atomic Lowering.
|
||||
case X86::ATOMAND32:
|
||||
|
|
|
@ -5442,16 +5442,14 @@ let usesCustomInserter = 1 in {
|
|||
def MONITOR : PseudoI<(outs), (ins i32mem:$src1, GR32:$src2, GR32:$src3),
|
||||
[(int_x86_sse3_monitor addr:$src1, GR32:$src2, GR32:$src3)]>,
|
||||
Requires<[HasSSE3]>;
|
||||
def MWAIT : PseudoI<(outs), (ins GR32:$src1, GR32:$src2),
|
||||
[(int_x86_sse3_mwait GR32:$src1, GR32:$src2)]>,
|
||||
Requires<[HasSSE3]>;
|
||||
}
|
||||
|
||||
let Uses = [EAX, ECX, EDX] in
|
||||
def MONITORrrr : I<0x01, MRM_C8, (outs), (ins), "monitor", [], IIC_SSE_MONITOR>,
|
||||
TB, Requires<[HasSSE3]>;
|
||||
let Uses = [ECX, EAX] in
|
||||
def MWAITrr : I<0x01, MRM_C9, (outs), (ins), "mwait", [], IIC_SSE_MWAIT>,
|
||||
def MWAITrr : I<0x01, MRM_C9, (outs), (ins), "mwait",
|
||||
[(int_x86_sse3_mwait ECX, EAX)], IIC_SSE_MWAIT>,
|
||||
TB, Requires<[HasSSE3]>;
|
||||
|
||||
def : InstAlias<"mwait %eax, %ecx", (MWAITrr)>, Requires<[In32BitMode]>;
|
||||
|
|
Loading…
Reference in New Issue