[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
Sun May 1 13:26:39 PDT 2016


koriakin updated this revision to Diff 55760.

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,13 @@
       return true;
     }
   }
+  const TargetLowering *TLI = MF->getSubtarget().getTargetLowering();
+  if (!MF->getMMI().getLandingPads().empty()) {
+    const Constant *Personality = MF->getFunction()->getPersonalityFn();
+    if (TLI->getExceptionPointerRegister(Personality) == PhysReg
+        || TLI->getExceptionSelectorRegister(Personality) == PhysReg)
+      return true;
+  }
   return false;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18541.55760.patch
Type: text/x-patch
Size: 1656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160501/047719a2/attachment.bin>


More information about the llvm-commits mailing list