Skip to content

Commit 0d40472

Browse files
committed
Merging r325085:
------------------------------------------------------------------------ r325085 | rnk | 2018-02-13 16:24:29 -0800 (Tue, 13 Feb 2018) | 3 lines [X86] Remove dead code from retpoline thunk generation Follow-up to r325049 ------------------------------------------------------------------------ llvm-svn: 325091
1 parent 2caa871 commit 0d40472

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

llvm/lib/Target/X86/X86RetpolineThunks.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ class X86RetpolineThunks : public MachineFunctionPass {
7474

7575
void createThunkFunction(Module &M, StringRef Name);
7676
void insertRegReturnAddrClobber(MachineBasicBlock &MBB, unsigned Reg);
77-
void insert32BitPushReturnAddrClobber(MachineBasicBlock &MBB);
7877
void populateThunk(MachineFunction &MF, Optional<unsigned> Reg = None);
7978
};
8079

@@ -225,31 +224,6 @@ void X86RetpolineThunks::insertRegReturnAddrClobber(MachineBasicBlock &MBB,
225224
.addReg(Reg);
226225
}
227226

228-
void X86RetpolineThunks::insert32BitPushReturnAddrClobber(
229-
MachineBasicBlock &MBB) {
230-
// The instruction sequence we use to replace the return address without
231-
// a scratch register is somewhat complicated:
232-
// # Clear capture_spec from return address.
233-
// addl $4, %esp
234-
// # Top of stack words are: Callee, RA. Exchange Callee and RA.
235-
// pushl 4(%esp) # Push callee
236-
// pushl 4(%esp) # Push RA
237-
// popl 8(%esp) # Pop RA to final RA
238-
// popl (%esp) # Pop callee to next top of stack
239-
// retl # Ret to callee
240-
BuildMI(&MBB, DebugLoc(), TII->get(X86::ADD32ri), X86::ESP)
241-
.addReg(X86::ESP)
242-
.addImm(4);
243-
addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::PUSH32rmm)), X86::ESP,
244-
false, 4);
245-
addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::PUSH32rmm)), X86::ESP,
246-
false, 4);
247-
addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::POP32rmm)), X86::ESP,
248-
false, 8);
249-
addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::POP32rmm)), X86::ESP,
250-
false, 0);
251-
}
252-
253227
void X86RetpolineThunks::populateThunk(MachineFunction &MF,
254228
Optional<unsigned> Reg) {
255229
// Set MF properties. We never use vregs...

0 commit comments

Comments
 (0)