tstellar / rpms / llvm

Forked from rpms/llvm 5 years ago
Clone
2653f00
From de9a0f9c449d4b13c70eff8c9a3023948dc21cb7 Mon Sep 17 00:00:00 2001
2653f00
From: Reid Kleckner <rnk@google.com>
2653f00
Date: Wed, 14 Feb 2018 00:34:35 +0000
2653f00
Subject: [PATCH 4/4] Merging r325085:
2653f00
 ------------------------------------------------------------------------
2653f00
 r325085 | rnk | 2018-02-13 16:24:29 -0800 (Tue, 13 Feb 2018) | 3 lines
2653f00
2653f00
[X86] Remove dead code from retpoline thunk generation
2653f00
2653f00
Follow-up to r325049
2653f00
------------------------------------------------------------------------
2653f00
2653f00
2653f00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@325091 91177308-0d34-0410-b5e6-96231b3b80d8
2653f00
---
2653f00
 lib/Target/X86/X86RetpolineThunks.cpp | 26 --------------------------
2653f00
 1 file changed, 26 deletions(-)
2653f00
2653f00
diff --git a/lib/Target/X86/X86RetpolineThunks.cpp b/lib/Target/X86/X86RetpolineThunks.cpp
2653f00
index 59ace3f..d03826b 100644
2653f00
--- a/lib/Target/X86/X86RetpolineThunks.cpp
2653f00
+++ b/lib/Target/X86/X86RetpolineThunks.cpp
2653f00
@@ -74,7 +74,6 @@ private:
2653f00
 
2653f00
   void createThunkFunction(Module &M, StringRef Name);
2653f00
   void insertRegReturnAddrClobber(MachineBasicBlock &MBB, unsigned Reg);
2653f00
-  void insert32BitPushReturnAddrClobber(MachineBasicBlock &MBB);
2653f00
   void populateThunk(MachineFunction &MF, Optional<unsigned> Reg = None);
2653f00
 };
2653f00
 
2653f00
@@ -225,31 +224,6 @@ void X86RetpolineThunks::insertRegReturnAddrClobber(MachineBasicBlock &MBB,
2653f00
       .addReg(Reg);
2653f00
 }
2653f00
 
2653f00
-void X86RetpolineThunks::insert32BitPushReturnAddrClobber(
2653f00
-    MachineBasicBlock &MBB) {
2653f00
-  // The instruction sequence we use to replace the return address without
2653f00
-  // a scratch register is somewhat complicated:
2653f00
-  //   # Clear capture_spec from return address.
2653f00
-  //   addl $4, %esp
2653f00
-  //   # Top of stack words are: Callee, RA. Exchange Callee and RA.
2653f00
-  //   pushl 4(%esp)  # Push callee
2653f00
-  //   pushl 4(%esp)  # Push RA
2653f00
-  //   popl 8(%esp)   # Pop RA to final RA
2653f00
-  //   popl (%esp)    # Pop callee to next top of stack
2653f00
-  //   retl           # Ret to callee
2653f00
-  BuildMI(&MBB, DebugLoc(), TII->get(X86::ADD32ri), X86::ESP)
2653f00
-      .addReg(X86::ESP)
2653f00
-      .addImm(4);
2653f00
-  addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::PUSH32rmm)), X86::ESP,
2653f00
-               false, 4);
2653f00
-  addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::PUSH32rmm)), X86::ESP,
2653f00
-               false, 4);
2653f00
-  addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::POP32rmm)), X86::ESP,
2653f00
-               false, 8);
2653f00
-  addRegOffset(BuildMI(&MBB, DebugLoc(), TII->get(X86::POP32rmm)), X86::ESP,
2653f00
-               false, 0);
2653f00
-}
2653f00
-
2653f00
 void X86RetpolineThunks::populateThunk(MachineFunction &MF,
2653f00
                                        Optional<unsigned> Reg) {
2653f00
   // Set MF properties. We never use vregs...
2653f00
-- 
2653f00
1.8.3.1
2653f00