[PATCH] D18541: [SystemZ] Save/restore r6 and r7 if function contains landing pad.

Marcin Koƛcielnicki via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 07:21:36 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL274017: [SystemZ] Save/restore r6 and r7 if function contains landing pad. (authored by koriakin).

Changed prior to commit:
  http://reviews.llvm.org/D18541?vs=61917&id=62089#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18541

Files:
  llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp
  llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll

Index: llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll
===================================================================
--- llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll
+++ llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll
@@ -20,7 +20,9 @@
 ; CHECK-FUNC: .cfi_startproc
 ; CHECK-FUNC: .cfi_personality 0, __gxx_personality_v0
 ; CHECK-FUNC: .cfi_lsda 0, .Lexception0
-; CHECK-FUNC: stmg	%r14, %r15, 112(%r15)
+; CHECK-FUNC: stmg	%r6, %r15, 48(%r15)
+; CHECK-FUNC: .cfi_offset %r6, -112
+; CHECK-FUNC: .cfi_offset %r7, -104
 ; CHECK-FUNC: .cfi_offset %r14, -48
 ; CHECK-FUNC: .cfi_offset %r15, -40
 ; CHECK-FUNC: aghi	%r15, -160
Index: llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp
+++ llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp
@@ -81,6 +81,12 @@
     for (unsigned I = MFI->getVarArgsFirstGPR(); I < SystemZ::NumArgGPRs; ++I)
       SavedRegs.set(SystemZ::ArgGPRs[I]);
 
+  // If there are any landing pads, entering them will modify r6/r7.
+  if (!MF.getMMI().getLandingPads().empty()) {
+    SavedRegs.set(SystemZ::R6D);
+    SavedRegs.set(SystemZ::R7D);
+  }
+
   // If the function requires a frame pointer, record that the hard
   // frame pointer will be clobbered.
   if (HasFP)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18541.62089.patch
Type: text/x-patch
Size: 1370 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160628/47c96c2e/attachment.bin>


More information about the llvm-commits mailing list