Move the personality function from LandingPadInst to Function

The personality routine currently lives in the LandingPadInst.

This isn't desirable because:
- All LandingPadInsts in the same function must have the same
  personality routine.  This means that each LandingPadInst beyond the
  first has an operand which produces no additional information.

- There is ongoing work to introduce EH IR constructs other than
  LandingPadInst.  Moving the personality routine off of any one
  particular Instruction and onto the parent function seems a lot better
  than have N different places a personality function can sneak onto an
  exceptional function.

Differential Revision: http://reviews.llvm.org/D10429

llvm-svn: 239940
diff --git a/llvm/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll b/llvm/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll
index 56493e2..1fc8aa7 100644
--- a/llvm/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll
+++ b/llvm/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll
@@ -2,7 +2,7 @@
 
 declare i32* @bar()
 
-define float* @foo() {
+define float* @foo() personality i32 (...)* @__gxx_personality_v0 {
         %tmp.11 = invoke float* bitcast (i32* ()* @bar to float* ()*)( )
                         to label %invoke_cont unwind label %X           ; <float*> [#uses=1]
 
@@ -10,7 +10,7 @@
         ret float* %tmp.11
 
 X:              ; preds = %0
-        %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+        %exn = landingpad {i8*, i32}
                  cleanup
         ret float* null
 }
diff --git a/llvm/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll b/llvm/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll
index a086c01..7471d8b 100644
--- a/llvm/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll
+++ b/llvm/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll
@@ -9,7 +9,7 @@
 
 declare i8* @test()
 
-define i32 @foo() {
+define i32 @foo() personality i32 (...)* @__gxx_personality_v0 {
 entry:
         br i1 true, label %cont, label %call
 
@@ -23,7 +23,7 @@
         ret i32 %V
 
 N:              ; preds = %call
-        %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+        %exn = landingpad {i8*, i32}
                  cleanup
         ret i32 0
 }
diff --git a/llvm/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll b/llvm/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll
index 722f8f0..4d9c19f 100644
--- a/llvm/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll
+++ b/llvm/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll
@@ -9,7 +9,7 @@
 
 declare i32** @__ctype_tolower_loc() readnone 
 
-define void @_ZNSt5ctypeIcEC2EPiPKtbm(%"struct.std::ctype<char>"* %this, i32* %unnamed_arg, i16* %__table, i8 zeroext  %__del, i64 %__refs) {
+define void @_ZNSt5ctypeIcEC2EPiPKtbm(%"struct.std::ctype<char>"* %this, i32* %unnamed_arg, i16* %__table, i8 zeroext  %__del, i64 %__refs) personality i32 (...)* @__gxx_personality_v0 {
 entry:
 	%tmp8 = invoke i32* @_ZNSt6locale5facet15_S_get_c_localeEv( )
 			to label %invcont unwind label %lpad		; <i32*> [#uses=0]
@@ -29,7 +29,7 @@
 	ret void
 
 lpad:		; preds = %invcont31, %invcont, %entry
-        %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+        %exn = landingpad {i8*, i32}
                  cleanup
 	unreachable
 }
diff --git a/llvm/test/Transforms/InstCombine/AddOverFlow.ll b/llvm/test/Transforms/InstCombine/AddOverFlow.ll
index bebfd62..a341cb0 100644
--- a/llvm/test/Transforms/InstCombine/AddOverFlow.ll
+++ b/llvm/test/Transforms/InstCombine/AddOverFlow.ll
@@ -39,7 +39,7 @@
 !0 = !{i16 0, i16 32768} ; [0, 32767]
 !1 = !{i16 0, i16 32769} ; [0, 32768]
 
-define i16 @add_bounded_values(i16 %a, i16 %b) {
+define i16 @add_bounded_values(i16 %a, i16 %b) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 ; CHECK-LABEL: @add_bounded_values(
 entry:
   %c = call i16 @bounded(i16 %a), !range !0
@@ -50,12 +50,12 @@
 ; CHECK: add nuw i16 %c, %d
   ret i16 %e
 lpad:
-  %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  %0 = landingpad { i8*, i32 }
           filter [0 x i8*] zeroinitializer
   ret i16 42
 }
 
-define i16 @add_bounded_values_2(i16 %a, i16 %b) {
+define i16 @add_bounded_values_2(i16 %a, i16 %b) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 ; CHECK-LABEL: @add_bounded_values_2(
 entry:
   %c = call i16 @bounded(i16 %a), !range !1
@@ -67,7 +67,7 @@
 ; CHECK: add i16 %c, %d
   ret i16 %e
 lpad:
-  %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  %0 = landingpad { i8*, i32 }
           filter [0 x i8*] zeroinitializer
   ret i16 42
 }
diff --git a/llvm/test/Transforms/InstCombine/LandingPadClauses.ll b/llvm/test/Transforms/InstCombine/LandingPadClauses.ll
index 0d42f7c..a4d77cb 100644
--- a/llvm/test/Transforms/InstCombine/LandingPadClauses.ll
+++ b/llvm/test/Transforms/InstCombine/LandingPadClauses.ll
@@ -11,7 +11,7 @@
 
 declare void @bar()
 
-define void @foo_generic() {
+define void @foo_generic() personality i32 (i32, i64, i8*, i8*)* @generic_personality {
 ; CHECK-LABEL: @foo_generic(
   invoke void @bar()
     to label %cont.a unwind label %lpad.a
@@ -43,7 +43,7 @@
   ret void
 
 lpad.a:
-  %a = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+  %a = landingpad { i8*, i32 }
           catch i32* @T1
           catch i32* @T2
           catch i32* @T1
@@ -55,7 +55,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.b:
-  %b = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+  %b = landingpad { i8*, i32 }
           filter [0 x i32*] zeroinitializer
           catch i32* @T1
   unreachable
@@ -64,7 +64,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.c:
-  %c = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+  %c = landingpad { i8*, i32 }
           catch i32* @T1
           filter [1 x i32*] [i32* @T1]
           catch i32* @T2
@@ -75,7 +75,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.d:
-  %d = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+  %d = landingpad { i8*, i32 }
           filter [3 x i32*] zeroinitializer
   unreachable
 ; CHECK: %d = landingpad
@@ -83,7 +83,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.e:
-  %e = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+  %e = landingpad { i8*, i32 }
           catch i32* @T1
           filter [3 x i32*] [i32* @T1, i32* @T2, i32* @T2]
   unreachable
@@ -93,7 +93,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.f:
-  %f = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+  %f = landingpad { i8*, i32 }
           filter [2 x i32*] [i32* @T2, i32* @T1]
           filter [1 x i32*] [i32* @T1]
   unreachable
@@ -102,7 +102,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.g:
-  %g = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+  %g = landingpad { i8*, i32 }
           filter [1 x i32*] [i32* @T1]
           catch i32* @T3
           filter [2 x i32*] [i32* @T2, i32* @T1]
@@ -113,7 +113,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.h:
-  %h = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+  %h = landingpad { i8*, i32 }
           filter [2 x i32*] [i32* @T1, i32* null]
           filter [1 x i32*] zeroinitializer
   unreachable
@@ -122,7 +122,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.i:
-  %i = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+  %i = landingpad { i8*, i32 }
           cleanup
           filter [0 x i32*] zeroinitializer
   unreachable
@@ -131,7 +131,7 @@
 ; CHECK-NEXT: unreachable
 }
 
-define void @foo_cxx() {
+define void @foo_cxx() personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
 ; CHECK-LABEL: @foo_cxx(
   invoke void @bar()
     to label %cont.a unwind label %lpad.a
@@ -148,7 +148,7 @@
   ret void
 
 lpad.a:
-  %a = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+  %a = landingpad { i8*, i32 }
           catch i32* null
           catch i32* @T1
   unreachable
@@ -157,7 +157,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.b:
-  %b = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+  %b = landingpad { i8*, i32 }
           filter [1 x i32*] zeroinitializer
   unreachable
 ; CHECK: %b = landingpad
@@ -165,7 +165,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.c:
-  %c = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+  %c = landingpad { i8*, i32 }
           filter [2 x i32*] [i32* @T1, i32* null]
   unreachable
 ; CHECK: %c = landingpad
@@ -173,7 +173,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.d:
-  %d = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+  %d = landingpad { i8*, i32 }
           cleanup
           catch i32* null
   unreachable
@@ -182,7 +182,7 @@
 ; CHECK-NEXT: unreachable
 }
 
-define void @foo_objc() {
+define void @foo_objc() personality i32 (i32, i64, i8*, i8*)* @__objc_personality_v0 {
 ; CHECK-LABEL: @foo_objc(
   invoke void @bar()
     to label %cont.a unwind label %lpad.a
@@ -199,7 +199,7 @@
   ret void
 
 lpad.a:
-  %a = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__objc_personality_v0
+  %a = landingpad { i8*, i32 }
           catch i32* null
           catch i32* @T1
   unreachable
@@ -208,7 +208,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.b:
-  %b = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__objc_personality_v0
+  %b = landingpad { i8*, i32 }
           filter [1 x i32*] zeroinitializer
   unreachable
 ; CHECK: %b = landingpad
@@ -216,7 +216,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.c:
-  %c = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__objc_personality_v0
+  %c = landingpad { i8*, i32 }
           filter [2 x i32*] [i32* @T1, i32* null]
   unreachable
 ; CHECK: %c = landingpad
@@ -224,7 +224,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.d:
-  %d = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__objc_personality_v0
+  %d = landingpad { i8*, i32 }
           cleanup
           catch i32* null
   unreachable
@@ -233,7 +233,7 @@
 ; CHECK-NEXT: unreachable
 }
 
-define void @foo_seh() {
+define void @foo_seh() personality i32 (...)* @__C_specific_handler {
 ; CHECK-LABEL: @foo_seh(
   invoke void @bar()
     to label %cont.a unwind label %lpad.a
@@ -250,7 +250,7 @@
   ret void
 
 lpad.a:
-  %a = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+  %a = landingpad { i8*, i32 }
           catch i32* null
           catch i32* @T1
   unreachable
@@ -259,7 +259,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.b:
-  %b = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+  %b = landingpad { i8*, i32 }
           filter [1 x i32*] zeroinitializer
   unreachable
 ; CHECK: %b = landingpad
@@ -267,7 +267,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.c:
-  %c = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+  %c = landingpad { i8*, i32 }
           filter [2 x i32*] [i32* @T1, i32* null]
   unreachable
 ; CHECK: %c = landingpad
@@ -275,7 +275,7 @@
 ; CHECK-NEXT: unreachable
 
 lpad.d:
-  %d = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+  %d = landingpad { i8*, i32 }
           cleanup
           catch i32* null
   unreachable
diff --git a/llvm/test/Transforms/InstCombine/call.ll b/llvm/test/Transforms/InstCombine/call.ll
index 47ae71f..ea338f0 100644
--- a/llvm/test/Transforms/InstCombine/call.ll
+++ b/llvm/test/Transforms/InstCombine/call.ll
@@ -123,7 +123,7 @@
 ; rdar://7590304
 declare void @test8a()
 
-define i8* @test8() {
+define i8* @test8() personality i32 (...)* @__gxx_personality_v0 {
 ; CHECK-LABEL: @test8(
 ; CHECK-NEXT: invoke void @test8a()
 ; Don't turn this into "unreachable": the callee and caller don't agree in
@@ -136,7 +136,7 @@
   unreachable
 
 try.handler:                                      ; preds = %entry
-  %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+  %exn = landingpad {i8*, i32}
             cleanup
   ret i8* null
 }
diff --git a/llvm/test/Transforms/InstCombine/cast.ll b/llvm/test/Transforms/InstCombine/cast.ll
index 68f8633..7fe54ef 100644
--- a/llvm/test/Transforms/InstCombine/cast.ll
+++ b/llvm/test/Transforms/InstCombine/cast.ll
@@ -100,7 +100,7 @@
 }
 
 declare i32 @__gxx_personality_v0(...)
-define void @test_invoke_vararg_cast(i32* %a, i32* %b) {
+define void @test_invoke_vararg_cast(i32* %a, i32* %b) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 entry:
   %0 = bitcast i32* %b to i8*
   %1 = bitcast i32* %a to i64*
@@ -111,7 +111,7 @@
   ret void
 
 lpad:                                             ; preds = %entry
-  %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  %2 = landingpad { i8*, i32 }
           cleanup
   ret void
 ; CHECK-LABEL: test_invoke_vararg_cast
diff --git a/llvm/test/Transforms/InstCombine/crash.ll b/llvm/test/Transforms/InstCombine/crash.ll
index 2d93ecd..fbb9675 100644
--- a/llvm/test/Transforms/InstCombine/crash.ll
+++ b/llvm/test/Transforms/InstCombine/crash.ll
@@ -131,11 +131,11 @@
        ret i32 0
 }
 
-define void @test5() {
+define void @test5() personality i32 (...)* @__gxx_personality_v0 {
   store i1 true, i1* undef
   %r = invoke i32 @test5a() to label %exit unwind label %unwind
 unwind:
-  %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+  %exn = landingpad {i8*, i32}
           cleanup
   br label %exit
 exit:
@@ -159,7 +159,7 @@
 %class.RuleBasedBreakIterator = type { i64 ()* }
 %class.UStack = type { i8** }
 
-define i32 @_ZN22RuleBasedBreakIterator15checkDictionaryEi(%class.RuleBasedBreakIterator* %this, i32 %x) align 2 {
+define i32 @_ZN22RuleBasedBreakIterator15checkDictionaryEi(%class.RuleBasedBreakIterator* %this, i32 %x) align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 entry:
   %breaks = alloca %class.UStack, align 4         ; <%class.UStack*> [#uses=3]
   call void @_ZN6UStackC1Ei(%class.UStack* %breaks, i32 0)
@@ -167,13 +167,13 @@
   br i1 %tobool, label %cond.end, label %cond.false
 
 terminate.handler:                                ; preds = %ehcleanup
-  %exc = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  %exc = landingpad { i8*, i32 }
            cleanup
   call void @_ZSt9terminatev() noreturn nounwind
   unreachable
 
 ehcleanup:                                        ; preds = %cond.false
-  %exc1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  %exc1 = landingpad { i8*, i32 }
            catch i8* null
   invoke void @_ZN6UStackD1Ev(%class.UStack* %breaks)
           to label %cont unwind label %terminate.handler
@@ -207,7 +207,7 @@
 
 
 ; rdar://7590304
-define i8* @test10(i8* %self, i8* %tmp3) {
+define i8* @test10(i8* %self, i8* %tmp3) personality i32 (...)* @__gxx_personality_v0 {
 entry:
   store i1 true, i1* undef
   store i1 true, i1* undef
@@ -218,7 +218,7 @@
   unreachable
 
 try.handler:                                      ; preds = %entry
-  %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+  %exn = landingpad {i8*, i32}
            catch i8* null
   ret i8* %self
 }
@@ -376,7 +376,7 @@
 declare void @test18b() noreturn
 declare void @test18foo(double**)
 declare void @test18a() noreturn
-define fastcc void @test18x(i8* %t0, i1 %b) uwtable align 2 {
+define fastcc void @test18x(i8* %t0, i1 %b) uwtable align 2 personality i32 (...)* @__gxx_personality_v0 {
 entry:
   br i1 %b, label %e1, label %e2
 e1:
@@ -389,7 +389,7 @@
           to label %u unwind label %lpad
 lpad:
   %t5 = phi double** [ %t2, %e1 ], [ %t4, %e2 ]
-  %lpad.nonloopexit262 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+  %lpad.nonloopexit262 = landingpad { i8*, i32 }
           cleanup
   call void @test18foo(double** %t5)
   unreachable
diff --git a/llvm/test/Transforms/InstCombine/gepphigep.ll b/llvm/test/Transforms/InstCombine/gepphigep.ll
index 5ae3171..b98ea4c 100644
--- a/llvm/test/Transforms/InstCombine/gepphigep.ll
+++ b/llvm/test/Transforms/InstCombine/gepphigep.ll
@@ -59,7 +59,7 @@
 
 ; Check that instcombine doesn't insert GEPs before landingpad.
 
-define i32 @test3(%struct3* %dm, i1 %tmp4, i64 %tmp9, i64 %tmp19, i64 %tmp20, i64 %tmp21) {
+define i32 @test3(%struct3* %dm, i1 %tmp4, i64 %tmp9, i64 %tmp19, i64 %tmp20, i64 %tmp21) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 bb:
   %tmp = getelementptr inbounds %struct3, %struct3* %dm, i64 0
   br i1 %tmp4, label %bb1, label %bb2
@@ -84,7 +84,7 @@
   ret i32 0
 
 bb5:
-  %tmp27 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* bitcast (i8** @_ZTIi to i8*)
+  %tmp27 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*)
   %tmp34 = getelementptr inbounds %struct4, %struct4* %phi, i64 %tmp21, i32 1
   %tmp35 = getelementptr inbounds %struct2, %struct2* %tmp34, i64 0, i32 1
   %tmp25 = load i32, i32* %tmp35, align 4
@@ -92,7 +92,7 @@
 
 ; CHECK-LABEL: @test3(
 ; CHECK: bb5:
-; CHECK-NEXT: {{.*}}landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+; CHECK-NEXT: {{.*}}landingpad { i8*, i32 }
 }
 
 @_ZTIi = external constant i8*
diff --git a/llvm/test/Transforms/InstCombine/invoke.ll b/llvm/test/Transforms/InstCombine/invoke.ll
index c4b58de..ee08ae1 100644
--- a/llvm/test/Transforms/InstCombine/invoke.ll
+++ b/llvm/test/Transforms/InstCombine/invoke.ll
@@ -8,7 +8,7 @@
 
 
 ; CHECK-LABEL: @f1(
-define i64 @f1() nounwind uwtable ssp {
+define i64 @f1() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 entry:
 ; CHECK: nvoke noalias i8* undef()
   %call = invoke noalias i8* undef()
@@ -20,7 +20,7 @@
   ret i64 %0
 
 lpad:
-  %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  %1 = landingpad { i8*, i32 }
           filter [0 x i8*] zeroinitializer
   %2 = extractvalue { i8*, i32 } %1, 0
   tail call void @__cxa_call_unexpected(i8* %2) noreturn nounwind
@@ -28,7 +28,7 @@
 }
 
 ; CHECK-LABEL: @f2(
-define i64 @f2() nounwind uwtable ssp {
+define i64 @f2() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 entry:
 ; CHECK: nvoke noalias i8* null()
   %call = invoke noalias i8* null()
@@ -40,7 +40,7 @@
   ret i64 %0
 
 lpad:
-  %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  %1 = landingpad { i8*, i32 }
           filter [0 x i8*] zeroinitializer
   %2 = extractvalue { i8*, i32 } %1, 0
   tail call void @__cxa_call_unexpected(i8* %2) noreturn nounwind
@@ -48,7 +48,7 @@
 }
 
 ; CHECK-LABEL: @f3(
-define void @f3() nounwind uwtable ssp {
+define void @f3() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 ; CHECK: invoke void @llvm.donothing()
   %call = invoke noalias i8* @_Znwm(i64 13)
           to label %invoke.cont unwind label %lpad
@@ -57,7 +57,7 @@
   ret void
 
 lpad:
-  %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  %1 = landingpad { i8*, i32 }
           filter [0 x i8*] zeroinitializer
   %2 = extractvalue { i8*, i32 } %1, 0
   tail call void @__cxa_call_unexpected(i8* %2) noreturn nounwind
diff --git a/llvm/test/Transforms/InstCombine/malloc-free-delete.ll b/llvm/test/Transforms/InstCombine/malloc-free-delete.ll
index dc04adb..138001a 100644
--- a/llvm/test/Transforms/InstCombine/malloc-free-delete.ll
+++ b/llvm/test/Transforms/InstCombine/malloc-free-delete.ll
@@ -127,7 +127,7 @@
 declare void @_ZN1AC2Ev(i8* %this)
 
 ; CHECK-LABEL: @test7(
-define void @test7() {
+define void @test7() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 entry:
   %nt = alloca i8
   ; CHECK-NOT: call {{.*}}@_ZnwmRKSt9nothrow_t(
@@ -139,7 +139,7 @@
   unreachable
 
 lpad.i:                                           ; preds = %entry
-  %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup
+  %0 = landingpad { i8*, i32 } cleanup
   ; CHECK-NOT: call {{.*}}@_ZdlPvRKSt9nothrow_t(
   call void @_ZdlPvRKSt9nothrow_t(i8* %call.i, i8* %nt) builtin nounwind
   resume { i8*, i32 } %0
diff --git a/llvm/test/Transforms/InstCombine/objsize-64.ll b/llvm/test/Transforms/InstCombine/objsize-64.ll
index 5046724..866bc4f 100644
--- a/llvm/test/Transforms/InstCombine/objsize-64.ll
+++ b/llvm/test/Transforms/InstCombine/objsize-64.ll
@@ -18,7 +18,7 @@
 
 
 ; CHECK-LABEL: @f2(
-define i64 @f2(i8** %esc) nounwind uwtable ssp {
+define i64 @f2(i8** %esc) nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 entry:
 ; CHECK: invoke noalias i8* @_Znwm(i64 13)
   %call = invoke noalias i8* @_Znwm(i64 13)
@@ -31,7 +31,7 @@
   ret i64 %0
 
 lpad:
-  %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  %1 = landingpad { i8*, i32 }
           filter [0 x i8*] zeroinitializer
   %2 = extractvalue { i8*, i32 } %1, 0
   tail call void @__cxa_call_unexpected(i8* %2) noreturn nounwind