[PATCH] D18541: [CodeGen] Consider register modified if it's used to pass landing pad parameters.
Marcin KoĆcielnicki via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 27 17:48:37 PDT 2016
koriakin retitled this revision from "[SystemZ] Save/restore r6 and r7 if function contains landing pad." to "[CodeGen] Consider register modified if it's used to pass landing pad parameters.".
koriakin updated the summary for this revision.
koriakin added a subscriber: llvm-commits.
koriakin updated this revision to Diff 55364.
Repository:
rL LLVM
http://reviews.llvm.org/D18541
Files:
lib/CodeGen/MachineRegisterInfo.cpp
test/DebugInfo/SystemZ/eh_frame_personality.ll
Index: test/DebugInfo/SystemZ/eh_frame_personality.ll
===================================================================
--- test/DebugInfo/SystemZ/eh_frame_personality.ll
+++ 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: lib/CodeGen/MachineRegisterInfo.cpp
===================================================================
--- lib/CodeGen/MachineRegisterInfo.cpp
+++ lib/CodeGen/MachineRegisterInfo.cpp
@@ -13,9 +13,11 @@
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/raw_os_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
+#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetSubtargetInfo.h"
@@ -512,6 +514,12 @@
return true;
}
}
+ const TargetLowering *TLI = MF->getSubtarget().getTargetLowering();
+ for (const Function *Personality : MF->getMMI().getPersonalities()) {
+ if (TLI->getExceptionPointerRegister(Personality) == PhysReg
+ || TLI->getExceptionSelectorRegister(Personality) == PhysReg)
+ return true;
+ }
return false;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18541.55364.patch
Type: text/x-patch
Size: 1606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160428/1ed8a733/attachment.bin>
More information about the llvm-commits
mailing list