[llvm] r274017 - [SystemZ] Save/restore r6 and r7 if function contains landing pad.
Marcin Koscielnicki via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 28 07:13:11 PDT 2016
Author: koriakin
Date: Tue Jun 28 09:13:11 2016
New Revision: 274017
URL: http://llvm.org/viewvc/llvm-project?rev=274017&view=rev
Log:
[SystemZ] Save/restore r6 and r7 if function contains landing pad.
This fixes PR27102.
Differential Revision: http://reviews.llvm.org/D18541
Modified:
llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp
llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll
Modified: llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp?rev=274017&r1=274016&r2=274017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp Tue Jun 28 09:13:11 2016
@@ -81,6 +81,12 @@ void SystemZFrameLowering::determineCall
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)
Modified: llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll?rev=274017&r1=274016&r2=274017&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll (original)
+++ llvm/trunk/test/DebugInfo/SystemZ/eh_frame_personality.ll Tue Jun 28 09:13:11 2016
@@ -20,7 +20,9 @@ clean:
; 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
More information about the llvm-commits
mailing list