llvm.org GIT mirror llvm / de9a0f9
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 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@325091 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 1 year, 6 months ago
1 changed file(s) with 0 addition(s) and 26 deletion(s). Raw diff Collapse all Expand all
7373
7474 void createThunkFunction(Module &M, StringRef Name);
7575 void insertRegReturnAddrClobber(MachineBasicBlock &MBB, unsigned Reg);
76 void insert32BitPushReturnAddrClobber(MachineBasicBlock &MBB);
7776 void populateThunk(MachineFunction &MF, Optional Reg = None);
7877 };
7978
224223 .addReg(Reg);
225224 }
226225
227 void X86RetpolineThunks::insert32BitPushReturnAddrClobber(
228 MachineBasicBlock &MBB) {
229 // The instruction sequence we use to replace the return address without
230 // a scratch register is somewhat complicated:
231 // # Clear capture_spec from return address.
232 // addl $4, %esp
233 // # Top of stack words are: Callee, RA. Exchange Callee and RA.
234 // pushl 4(%esp) # Push callee
235 // pushl 4(%esp) # Push RA
236 // popl 8(%esp) # Pop RA to final RA
237 // popl (%esp) # Pop callee to next top of stack
238 // retl # Ret to callee
239 BuildMI(&MBB, DebugLoc(), TII->get(X86::ADD32ri), X86::ESP)
240 .addReg(X86::ESP)
241 .addImm(4);
242 addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::PUSH32rmm)), X86::ESP,
243 false, 4);
244 addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::PUSH32rmm)), X86::ESP,
245 false, 4);
246 addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::POP32rmm)), X86::ESP,
247 false, 8);
248 addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::POP32rmm)), X86::ESP,
249 false, 0);
250 }
251
252226 void X86RetpolineThunks::populateThunk(MachineFunction &MF,
253227 Optional Reg) {
254228 // Set MF properties. We never use vregs...