[llvm] cdd685e - [WinEH] Convert some tests to opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 04:09:21 PST 2022


Author: Nikita Popov
Date: 2022-12-19T13:09:05+01:00
New Revision: cdd685e17c91b517e3a011988f9c1d9a30594d06

URL: https://github.com/llvm/llvm-project/commit/cdd685e17c91b517e3a011988f9c1d9a30594d06
DIFF: https://github.com/llvm/llvm-project/commit/cdd685e17c91b517e3a011988f9c1d9a30594d06.diff

LOG: [WinEH] Convert some tests to opaque pointers (NFC)

Added: 
    

Modified: 
    llvm/test/CodeGen/WinEH/wineh-asm.ll
    llvm/test/CodeGen/WinEH/wineh-cloning.ll
    llvm/test/CodeGen/WinEH/wineh-comdat.ll
    llvm/test/CodeGen/WinEH/wineh-demotion.ll
    llvm/test/CodeGen/WinEH/wineh-intrinsics.ll
    llvm/test/CodeGen/WinEH/wineh-nested-unwind.ll
    llvm/test/CodeGen/WinEH/wineh-no-demotion.ll
    llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
    llvm/test/CodeGen/WinEH/wineh-setjmp.ll
    llvm/test/CodeGen/WinEH/wineh-statenumbering-cleanups.ll
    llvm/test/CodeGen/WinEH/wineh-statenumbering.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/WinEH/wineh-asm.ll b/llvm/test/CodeGen/WinEH/wineh-asm.ll
index ed99411810e76..c9e1632ebdbab 100644
--- a/llvm/test/CodeGen/WinEH/wineh-asm.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-asm.ll
@@ -2,7 +2,7 @@
 
 target triple = "x86_64-pc-windows-msvc"
 
-define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test1() personality ptr @__CxxFrameHandler3 {
 entry:
   invoke void @f(i32 1)
      to label %exit unwind label %cleanup

diff  --git a/llvm/test/CodeGen/WinEH/wineh-cloning.ll b/llvm/test/CodeGen/WinEH/wineh-cloning.ll
index 22d6ee3b95367..045aeadb4f7e7 100644
--- a/llvm/test/CodeGen/WinEH/wineh-cloning.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-cloning.ll
@@ -11,7 +11,7 @@ declare void @llvm.bar() nounwind
 declare i32 @llvm.qux() nounwind
 declare i1 @llvm.baz() nounwind
 
-define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test1() personality ptr @__CxxFrameHandler3 {
 entry:
   ; %x def colors: {entry} subset of use colors; must spill
   %x = call i32 @llvm.qux()
@@ -44,7 +44,7 @@ noreturn:
 ; CHECK:   call void @llvm.foo(i32 %x)
 
 
-define void @test2() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test2() personality ptr @__CxxFrameHandler3 {
 entry:
   invoke void @f()
     to label %exit unwind label %cleanup
@@ -71,7 +71,7 @@ exit:
 ; CHECK-NEXT: ret void
 
 
-define void @test3() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test3() personality ptr @__CxxFrameHandler3 {
 entry:
   invoke void @f()
     to label %invoke.cont unwind label %catch.switch
@@ -110,7 +110,7 @@ exit:
 ; CHECK:   ret void
 
 
-define void @test4() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test4() personality ptr @__CxxFrameHandler3 {
 entry:
   invoke void @f()
     to label %shared unwind label %catch.switch
@@ -195,7 +195,7 @@ exit:
 ; CHECK:    unreachable
 
 
-define void @test5() personality i32 (...)* @__C_specific_handler {
+define void @test5() personality ptr @__C_specific_handler {
 entry:
   invoke void @f()
     to label %exit unwind label %outer
@@ -233,7 +233,7 @@ exit:
 ; CHECK-NEXT:   br label %outer.ret
 
 
-define void @test10() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test10() personality ptr @__CxxFrameHandler3 {
 entry:
   invoke void @f()
     to label %unreachable unwind label %inner
@@ -268,7 +268,7 @@ unreachable:
 ; CHECK:      exit:
 ; CHECK-NEXT:   ret void
 
-define void @test11() personality i32 (...)* @__C_specific_handler {
+define void @test11() personality ptr @__C_specific_handler {
 entry:
   invoke void @f()
     to label %exit unwind label %cleanup.outer
@@ -295,7 +295,7 @@ exit:
 ; CHECK-NEXT: call void @llvm.bar()
 ; CHECK-NEXT: unreachable
 
-define void @test12() personality i32 (...)* @__CxxFrameHandler3 !dbg !5 {
+define void @test12() personality ptr @__CxxFrameHandler3 !dbg !5 {
 entry:
   invoke void @f()
     to label %cont unwind label %left, !dbg !8
@@ -319,7 +319,7 @@ exit:
 
 ; CHECK-LABEL: define void @test13()
 ; CHECK: ret void
-define void @test13() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test13() personality ptr @__CxxFrameHandler3 {
 entry:
   ret void
 
@@ -328,7 +328,7 @@ unreachable:
   unreachable
 }
 
-define void @test14() personality void (...)* @ProcessCLRException {
+define void @test14() personality ptr @ProcessCLRException {
 entry:
   invoke void @f()
     to label %cont unwind label %cleanup

diff  --git a/llvm/test/CodeGen/WinEH/wineh-comdat.ll b/llvm/test/CodeGen/WinEH/wineh-comdat.ll
index 2ef1650d29eb4..3f75d1b773fe9 100644
--- a/llvm/test/CodeGen/WinEH/wineh-comdat.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-comdat.ll
@@ -2,7 +2,7 @@
 
 $f = comdat any
 
-define void @f() comdat personality i32 (...)* @__CxxFrameHandler3 {
+define void @f() comdat personality ptr @__CxxFrameHandler3 {
   invoke void @g() to label %return unwind label %unwind
 return:
   ret void
@@ -14,4 +14,4 @@ unwind:
 declare void @g()
 declare i32 @__CxxFrameHandler3(...)
 
-; CHECK: define internal i32 @"__ehhandler$f"(i8* %0, i8* %1, i8* %2, i8* %3){{ .+}} comdat($f) {
+; CHECK: define internal i32 @"__ehhandler$f"(ptr %0, ptr %1, ptr %2, ptr %3){{ .+}} comdat($f) {

diff  --git a/llvm/test/CodeGen/WinEH/wineh-demotion.ll b/llvm/test/CodeGen/WinEH/wineh-demotion.ll
index 411952d84bb6c..43676d57ad08c 100644
--- a/llvm/test/CodeGen/WinEH/wineh-demotion.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-demotion.ll
@@ -13,7 +13,7 @@ declare i1 @i()
 declare void @llvm.bar() nounwind
 
 ; CHECK-LABEL: @test1(
-define void @test1(i1 %B) personality i32 (...)* @__CxxFrameHandler3 {
+define void @test1(i1 %B) personality ptr @__CxxFrameHandler3 {
 entry:
   ; Spill slot should be inserted here
   ; CHECK: [[Slot:%[^ ]+]] = alloca
@@ -24,13 +24,13 @@ entry:
   br i1 %B, label %left, label %right
 left:
   ; CHECK: left:
-  ; CHECK-NEXT: store i32 %x, i32* [[Slot]]
+  ; CHECK-NEXT: store i32 %x, ptr [[Slot]]
   ; CHECK-NEXT: invoke void @f
   invoke void @f()
           to label %exit unwind label %merge
 right:
   ; CHECK: right:
-  ; CHECK-NEXT: store i32 %y, i32* [[Slot]]
+  ; CHECK-NEXT: store i32 %y, ptr [[Slot]]
   ; CHECK-NEXT: invoke void @f
   invoke void @f()
           to label %exit unwind label %merge
@@ -43,7 +43,7 @@ merge:
 catch:
   %cp = catchpad within %cs1 []
   ; CHECK: catch:
-  ; CHECK: [[Reload:%[^ ]+]] = load i32, i32* [[Slot]]
+  ; CHECK: [[Reload:%[^ ]+]] = load i32, ptr [[Slot]]
   ; CHECK-NEXT: call void @h(i32 [[Reload]])
   call void @h(i32 %phi) [ "funclet"(token %cp) ]
   catchret from %cp to label %exit
@@ -53,22 +53,22 @@ exit:
 }
 
 ; CHECK-LABEL: @test2(
-define void @test2(i1 %B) personality i32 (...)* @__CxxFrameHandler3 {
+define void @test2(i1 %B) personality ptr @__CxxFrameHandler3 {
 entry:
   br i1 %B, label %left, label %right
 left:
   ; Need two stores here because %x and %y interfere so they need 2 slots
   ; CHECK: left:
-  ; CHECK:   store i32 1, i32* [[Slot1:%[^ ]+]]
-  ; CHECK:   store i32 1, i32* [[Slot2:%[^ ]+]]
+  ; CHECK:   store i32 1, ptr [[Slot1:%[^ ]+]]
+  ; CHECK:   store i32 1, ptr [[Slot2:%[^ ]+]]
   ; CHECK-NEXT: invoke void @f
   invoke void @f()
           to label %exit unwind label %merge.inner
 right:
   ; Need two stores here because %x and %y interfere so they need 2 slots
   ; CHECK: right:
-  ; CHECK-DAG:   store i32 2, i32* [[Slot1]]
-  ; CHECK-DAG:   store i32 2, i32* [[Slot2]]
+  ; CHECK-DAG:   store i32 2, ptr [[Slot1]]
+  ; CHECK-DAG:   store i32 2, ptr [[Slot2]]
   ; CHECK: invoke void @f
   invoke void @f()
           to label %exit unwind label %merge.inner
@@ -105,8 +105,8 @@ catch.outer:
   ; CHECK: [[CatchPad:%[^ ]+]] = catchpad within %cs2 []
   ; Need to load x and y from two 
diff erent slots since they're both live
   ; and can have 
diff erent values (if we came from catch.inner)
-  ; CHECK-DAG: load i32, i32* [[Slot1]]
-  ; CHECK-DAG: load i32, i32* [[Slot2]]
+  ; CHECK-DAG: load i32, ptr [[Slot1]]
+  ; CHECK-DAG: load i32, ptr [[Slot2]]
   ; CHECK: catchret from [[CatchPad]] to label
   call void @h(i32 %x) [ "funclet"(token %cpouter) ]
   call void @h(i32 %y) [ "funclet"(token %cpouter) ]
@@ -119,7 +119,7 @@ exit:
 ; test4: don't need stores for %phi.inner, as its only use is to feed %phi.outer
 ;        %phi.outer needs stores in %left, %right, and %join
 ; CHECK-LABEL: @test4(
-define void @test4(i1 %B) personality i32 (...)* @__CxxFrameHandler3 {
+define void @test4(i1 %B) personality ptr @__CxxFrameHandler3 {
 entry:
   ; CHECK:      entry:
   ; CHECK:        [[Slot:%[^ ]+]] = alloca
@@ -128,7 +128,7 @@ entry:
 left:
   ; CHECK: left:
   ; CHECK-NOT: store
-  ; CHECK: store i32 %l, i32* [[Slot]]
+  ; CHECK: store i32 %l, ptr [[Slot]]
   ; CHECK-NEXT: invoke void @f
   %l = call i32 @g()
   invoke void @f()
@@ -136,7 +136,7 @@ left:
 right:
   ; CHECK: right:
   ; CHECK-NOT: store
-  ; CHECK: store i32 %r, i32* [[Slot]]
+  ; CHECK: store i32 %r, ptr [[Slot]]
   ; CHECK-NEXT: invoke void @f
   %r = call i32 @g()
   invoke void @f()
@@ -152,7 +152,7 @@ catch.inner:
 join:
   ; CHECK: join:
   ; CHECK-NOT: store
-  ; CHECK: store i32 %j, i32* [[Slot]]
+  ; CHECK: store i32 %j, ptr [[Slot]]
   ; CHECK-NEXT: invoke void @f
    %j = call i32 @g()
    invoke void @f()
@@ -165,7 +165,7 @@ catchpad.outer:
    %cs2 = catchswitch within none [label %catch.outer] unwind to caller
 catch.outer:
    ; CHECK: catch.outer:
-   ; CHECK:   [[Reload:%[^ ]+]] = load i32, i32* [[Slot]]
+   ; CHECK:   [[Reload:%[^ ]+]] = load i32, ptr [[Slot]]
    ; CHECK:   call void @h(i32 [[Reload]])
    %cp2 = catchpad within %cs2 []
    call void @h(i32 %phi.outer) [ "funclet"(token %cp2) ]
@@ -175,11 +175,11 @@ exit:
 }
 
 ; CHECK-LABEL: @test5(
-define void @test5() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test5() personality ptr @__CxxFrameHandler3 {
 entry:
   ; need store for %phi.cleanup
   ; CHECK:      entry:
-  ; CHECK:        store i32 1, i32* [[CleanupSlot:%[^ ]+]]
+  ; CHECK:        store i32 1, ptr [[CleanupSlot:%[^ ]+]]
   ; CHECK-NEXT:   invoke void @f
   invoke void @f()
           to label %invoke.cont unwind label %cleanup
@@ -187,7 +187,7 @@ entry:
 invoke.cont:
   ; need store for %phi.cleanup
   ; CHECK:      invoke.cont:
-  ; CHECK-NEXT:   store i32 2, i32* [[CleanupSlot]]
+  ; CHECK-NEXT:   store i32 2, ptr [[CleanupSlot]]
   ; CHECK-NEXT:   invoke void @f
   invoke void @f()
           to label %invoke.cont2 unwind label %cleanup
@@ -196,7 +196,7 @@ cleanup:
   ; cleanup phi can be loaded at cleanup entry
   ; CHECK: cleanup:
   ; CHECK-NEXT: cleanuppad within none []
-  ; CHECK: [[CleanupReload:%[^ ]+]] = load i32, i32* [[CleanupSlot]]
+  ; CHECK: [[CleanupReload:%[^ ]+]] = load i32, ptr [[CleanupSlot]]
   %phi.cleanup = phi i32 [ 1, %entry ], [ 2, %invoke.cont ]
   %cp = cleanuppad within none []
   %b = call i1 @i() [ "funclet"(token %cp) ]
@@ -217,14 +217,14 @@ right:
 merge:
   ; need store for %phi.catch
   ; CHECK:      merge:
-  ; CHECK-NEXT:   store i32 [[CleanupReload]], i32* [[CatchSlot:%[^ ]+]]
+  ; CHECK-NEXT:   store i32 [[CleanupReload]], ptr [[CatchSlot:%[^ ]+]]
   ; CHECK-NEXT:   cleanupret
   cleanupret from %cp unwind label %catchswitch
 
 invoke.cont2:
   ; need store for %phi.catch
   ; CHECK:      invoke.cont2:
-  ; CHECK-NEXT:   store i32 3, i32* [[CatchSlot]]
+  ; CHECK-NEXT:   store i32 3, ptr [[CatchSlot]]
   ; CHECK-NEXT:   invoke void @f
   invoke void @f()
           to label %exit unwind label %catchswitch
@@ -238,7 +238,7 @@ catchswitch:
 catch:
   ; CHECK: catch:
   ; CHECK:   catchpad within %cs1
-  ; CHECK:   [[CatchReload:%[^ ]+]] = load i32, i32* [[CatchSlot]]
+  ; CHECK:   [[CatchReload:%[^ ]+]] = load i32, ptr [[CatchSlot]]
   ; CHECK:   call void @h(i32 [[CatchReload]]
   %cp2 = catchpad within %cs1 []
   call void @h(i32 %phi.catch) [ "funclet"(token %cp2) ]
@@ -250,7 +250,7 @@ exit:
 
 ; We used to demote %x, but we don't need to anymore.
 ; CHECK-LABEL: @test6(
-define void @test6() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test6() personality ptr @__CxxFrameHandler3 {
 entry:
   ; CHECK: entry:
   ; CHECK: %x = invoke i32 @g()
@@ -272,18 +272,18 @@ cleanup:
 }
 
 ; CHECK-LABEL: @test7(
-define void @test7() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test7() personality ptr @__CxxFrameHandler3 {
 entry:
   ; %x is an EH pad phi, so gets stored in pred here
   ; CHECK: entry:
-  ; CHECK:   store i32 1, i32* [[SlotX:%[^ ]+]]
+  ; CHECK:   store i32 1, ptr [[SlotX:%[^ ]+]]
   ; CHECK:   invoke void @f()
   invoke void @f()
      to label %invoke.cont unwind label %catchpad
 invoke.cont:
   ; %x is an EH pad phi, so gets stored in pred here
   ; CHECK: invoke.cont:
-  ; CHECK:   store i32 2, i32* [[SlotX]]
+  ; CHECK:   store i32 2, ptr [[SlotX]]
   ; CHECK:   invoke void @f()
   invoke void @f()
     to label %exit unwind label %catchpad
@@ -306,7 +306,7 @@ left:
   ; CHECK-NEXT: catchret from %[[CatchPad]] to label %[[SplitLeft:[^ ]+]]
   catchret from %cp to label %join
   ; CHECK: [[SplitLeft]]:
-  ; CHECK:   [[LoadX:%[^ ]+]] = load i32, i32* [[SlotX]]
+  ; CHECK:   [[LoadX:%[^ ]+]] = load i32, ptr [[SlotX]]
   ; CHECK:   br label %join
 right:
   ; Edge from %right to %join needs to be split so that
@@ -327,7 +327,7 @@ exit:
 }
 
 ; CHECK-LABEL: @test8(
-define void @test8() personality i32 (...)* @__CxxFrameHandler3 { entry:
+define void @test8() personality ptr @__CxxFrameHandler3 { entry:
   invoke void @f()
           to label %done unwind label %cleanup1
   invoke void @f()

diff  --git a/llvm/test/CodeGen/WinEH/wineh-intrinsics.ll b/llvm/test/CodeGen/WinEH/wineh-intrinsics.ll
index 75d8bfdcd8317..d62799ec38427 100644
--- a/llvm/test/CodeGen/WinEH/wineh-intrinsics.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-intrinsics.ll
@@ -5,12 +5,12 @@
 
 target triple = "x86_64-pc-windows-msvc"
 
-declare i8* @llvm.eh.exceptionpointer.p0i8(token)
-declare i8 addrspace(1)* @llvm.eh.exceptionpointer.p1i8(token)
+declare ptr @llvm.eh.exceptionpointer.p0(token)
+declare ptr addrspace(1) @llvm.eh.exceptionpointer.p1(token)
 
 declare void @f(...)
 
-define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
+define void @test1() personality ptr @__CxxFrameHandler3 {
 entry:
   invoke void (...) @f(i32 1)
      to label %exit unwind label %catchpad
@@ -18,14 +18,14 @@ catchpad:
   %cs1 = catchswitch within none [label %do_catch] unwind to caller
 do_catch:
   %catch = catchpad within %cs1 [i32 1]
-  %exn = call i8* @llvm.eh.exceptionpointer.p0i8(token %catch)
-  call void (...) @f(i8* %exn)
+  %exn = call ptr @llvm.eh.exceptionpointer.p0(token %catch)
+  call void (...) @f(ptr %exn)
   catchret from %catch to label %exit
 exit:
   ret void
 }
 
-define void @test2() personality i32 (...)* @ProcessManagedException {
+define void @test2() personality ptr @ProcessManagedException {
 entry:
   invoke void (...) @f(i32 1)
      to label %exit unwind label %catchpad
@@ -33,8 +33,8 @@ catchpad:
   %cs1 = catchswitch within none [label %do_catch] unwind to caller
 do_catch:
   %catch = catchpad within %cs1 [i32 1]
-  %exn = call i8 addrspace(1)* @llvm.eh.exceptionpointer.p1i8(token %catch)
-  call void (...) @f(i8 addrspace(1)* %exn)
+  %exn = call ptr addrspace(1) @llvm.eh.exceptionpointer.p1(token %catch)
+  call void (...) @f(ptr addrspace(1) %exn)
   catchret from %catch to label %exit
 exit:
   ret void

diff  --git a/llvm/test/CodeGen/WinEH/wineh-nested-unwind.ll b/llvm/test/CodeGen/WinEH/wineh-nested-unwind.ll
index b568be5216075..bde6d60dca3cd 100644
--- a/llvm/test/CodeGen/WinEH/wineh-nested-unwind.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-nested-unwind.ll
@@ -3,7 +3,7 @@ target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc18.0.0"
 
 ; Function Attrs: uwtable
-define void @f() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+define void @f() #0 personality ptr @__CxxFrameHandler3 {
 entry:
   invoke void @g()
           to label %try.cont unwind label %catch.dispatch
@@ -12,7 +12,7 @@ catch.dispatch:                                   ; preds = %entry
   %0 = catchswitch within none [label %catch] unwind label %ehcleanup
 
 catch:                                            ; preds = %catch.dispatch
-  %1 = catchpad within %0 [i8* null, i32 64, i8* null]
+  %1 = catchpad within %0 [ptr null, i32 64, ptr null]
   invoke void @g() [ "funclet"(token %1) ]
           to label %dtor.exit unwind label %catch.dispatch.i
 
@@ -20,7 +20,7 @@ catch.dispatch.i:                                 ; preds = %catch
   %2 = catchswitch within %1 [label %catch.i] unwind to caller
 
 catch.i:                                          ; preds = %catch.dispatch.i
-  %3 = catchpad within %2 [i8* null, i32 64, i8* null]
+  %3 = catchpad within %2 [ptr null, i32 64, ptr null]
   catchret from %3 to label %dtor.exit
 
 dtor.exit:

diff  --git a/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll b/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll
index 277dd5c0e6a89..421d0bd763cdf 100644
--- a/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll
@@ -11,7 +11,7 @@ declare i32 @g()
 declare void @h(i32)
 
 ; CHECK-LABEL: @test1(
-define void @test1(i1 %bool) personality i32 (...)* @__C_specific_handler {
+define void @test1(i1 %bool) personality ptr @__C_specific_handler {
 entry:
   invoke void @f()
           to label %invoke.cont unwind label %left
@@ -54,7 +54,7 @@ exit:
 }
 
 ; CHECK-LABEL: @test2(
-define void @test2(i1 %bool) personality i32 (...)* @__C_specific_handler {
+define void @test2(i1 %bool) personality ptr @__C_specific_handler {
 entry:
   invoke void @f()
           to label %shared.cont unwind label %left
@@ -92,7 +92,7 @@ exit:
 }
 
 ; CHECK-LABEL: @test4(
-define void @test4(i1 %x) personality i32 (...)* @__CxxFrameHandler3 {
+define void @test4(i1 %x) personality ptr @__CxxFrameHandler3 {
 entry:
   invoke void @f()
           to label %invoke.cont1 unwind label %left

diff  --git a/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll b/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
index 836062da2dda5..e42b005cf64bd 100644
--- a/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
@@ -7,8 +7,8 @@ declare void @dummy_filter()
 
 declare void @f(i32)
 
-;Cxx: define void @test() personality i32 (...)* @__CxxFrameHandler3 {
-;Seh: define void @test() personality i32 (...)* @__C_specific_handler {
+;Cxx: define void @test() personality ptr @__CxxFrameHandler3 {
+;Seh: define void @test() personality ptr @__C_specific_handler {
 entry:
   invoke void @f(i32 1)
           to label %invoke.cont unwind label %catch.dispatch
@@ -17,8 +17,8 @@ catch.dispatch:
   %cs1 = catchswitch within none [label %catch.body] unwind label %catch.dispatch.2
 
 catch.body:
-;Cxx: %catch = catchpad within %cs1 [i8* null, i32 u0x40, i8* null]
-;Seh: %catch = catchpad within %cs1 [void ()* @dummy_filter]
+;Cxx: %catch = catchpad within %cs1 [ptr null, i32 u0x40, ptr null]
+;Seh: %catch = catchpad within %cs1 [ptr @dummy_filter]
   invoke void @f(i32 2) [ "funclet"(token %catch) ]
           to label %unreachable unwind label %terminate
 
@@ -37,8 +37,8 @@ catch.dispatch.2:
   %cs2 = catchswitch within none [label %catch.body.2] unwind to caller
 
 catch.body.2:
-;Cxx: %catch2 = catchpad within %cs2 [i8* null, i32 u0x40, i8* null]
-;Seh: %catch2 = catchpad within %cs2 [void ()* @dummy_filter]
+;Cxx: %catch2 = catchpad within %cs2 [ptr null, i32 u0x40, ptr null]
+;Seh: %catch2 = catchpad within %cs2 [ptr @dummy_filter]
   unreachable
 }
 

diff  --git a/llvm/test/CodeGen/WinEH/wineh-setjmp.ll b/llvm/test/CodeGen/WinEH/wineh-setjmp.ll
index bf459d98bdea7..20f86dd97ca4a 100644
--- a/llvm/test/CodeGen/WinEH/wineh-setjmp.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-setjmp.ll
@@ -4,56 +4,56 @@ target triple = "i686-pc-windows-msvc"
 
 @jb = external global i8
 
-define i32 @test1() personality i32 (...)* @__CxxFrameHandler3 {
+define i32 @test1() personality ptr @__CxxFrameHandler3 {
 entry:
 ; CHECK-LABEL: define i32 @test1(
 ; CHECK: %[[eh_reg:.*]] = alloca
 ; CHECK: %[[gep:.*]] = getelementptr inbounds {{.*}}, {{.*}} %[[eh_reg]], i32 0, i32 2
-; CHECK: store i32 -1, i32* %[[gep]]
+; CHECK: store i32 -1, ptr %[[gep]]
 ; CHECK: %[[gep:.*]] = getelementptr inbounds {{.*}}, {{.*}} %[[eh_reg]], i32 0, i32 2
-; CHECK: store i32 0, i32* %[[gep]]
-; CHECK: %[[lsda:.*]] = call i8* @llvm.x86.seh.lsda(i8* bitcast (i32 ()* @test1 to i8*))
-; CHECK: invoke i32 (i8*, i32, ...) @_setjmp3(i8* @jb, i32 3, void (i8*)* @__CxxLongjmpUnwind, i32 0, i8* %[[lsda]])
-  %inv = invoke i32 (i8*, i32, ...) @_setjmp3(i8* @jb, i32 0) #2
+; CHECK: store i32 0, ptr %[[gep]]
+; CHECK: %[[lsda:.*]] = call ptr @llvm.x86.seh.lsda(ptr @test1)
+; CHECK: invoke i32 (ptr, i32, ...) @_setjmp3(ptr @jb, i32 3, ptr @__CxxLongjmpUnwind, i32 0, ptr %[[lsda]])
+  %inv = invoke i32 (ptr, i32, ...) @_setjmp3(ptr @jb, i32 0) #2
           to label %invoke.cont unwind label %ehcleanup
 
 invoke.cont:
 ; CHECK: %[[gep:.*]] = getelementptr inbounds {{.*}}, {{.*}} %[[eh_reg]], i32 0, i32 2
-; CHECK: store i32 -1, i32* %[[gep]]
-; CHECK: %[[lsda:.*]] = call i8* @llvm.x86.seh.lsda(i8* bitcast (i32 ()* @test1 to i8*))
-; CHECK: call i32 (i8*, i32, ...) @_setjmp3(i8* @jb, i32 3, void (i8*)* @__CxxLongjmpUnwind, i32 -1, i8* %[[lsda]])
-  call i32 (i8*, i32, ...) @_setjmp3(i8* @jb, i32 0)
+; CHECK: store i32 -1, ptr %[[gep]]
+; CHECK: %[[lsda:.*]] = call ptr @llvm.x86.seh.lsda(ptr @test1)
+; CHECK: call i32 (ptr, i32, ...) @_setjmp3(ptr @jb, i32 3, ptr @__CxxLongjmpUnwind, i32 -1, ptr %[[lsda]])
+  call i32 (ptr, i32, ...) @_setjmp3(ptr @jb, i32 0)
   call void @cleanup()
   ret i32 %inv
 
 ehcleanup:
   %cp = cleanuppad within none []
 ; CHECK: %[[gep:.*]] = getelementptr inbounds {{.*}}, {{.*}} %[[eh_reg]], i32 0, i32 2
-; CHECK: %[[load:.*]] = load i32, i32* %[[gep]]
-; CHECK: %[[lsda:.*]] = call i8* @llvm.x86.seh.lsda(i8* bitcast (i32 ()* @test1 to i8*))
-; CHECK: call i32 (i8*, i32, ...) @_setjmp3(i8* @jb, i32 3, void (i8*)* @__CxxLongjmpUnwind, i32 %[[load]], i8* %[[lsda]]) [ "funclet"(token %cp) ]
-  %cal = call i32 (i8*, i32, ...) @_setjmp3(i8* @jb, i32 0) [ "funclet"(token %cp) ]
+; CHECK: %[[load:.*]] = load i32, ptr %[[gep]]
+; CHECK: %[[lsda:.*]] = call ptr @llvm.x86.seh.lsda(ptr @test1)
+; CHECK: call i32 (ptr, i32, ...) @_setjmp3(ptr @jb, i32 3, ptr @__CxxLongjmpUnwind, i32 %[[load]], ptr %[[lsda]]) [ "funclet"(token %cp) ]
+  %cal = call i32 (ptr, i32, ...) @_setjmp3(ptr @jb, i32 0) [ "funclet"(token %cp) ]
   call void @cleanup() [ "funclet"(token %cp) ]
   cleanupret from %cp unwind to caller
 }
 
-define i32 @test2() personality i32 (...)* @_except_handler3 {
+define i32 @test2() personality ptr @_except_handler3 {
 entry:
 ; CHECK-LABEL: define i32 @test2(
 ; CHECK: %[[eh_reg:.*]] = alloca
 ; CHECK: %[[gep:.*]] = getelementptr inbounds {{.*}}, {{.*}} %[[eh_reg]], i32 0, i32 4
-; CHECK: store i32 -1, i32* %[[gep]]
+; CHECK: store i32 -1, ptr %[[gep]]
 ; CHECK: %[[gep:.*]] = getelementptr inbounds {{.*}}, {{.*}} %[[eh_reg]], i32 0, i32 4
-; CHECK: store i32 0, i32* %[[gep]]
-; CHECK: invoke i32 (i8*, i32, ...) @_setjmp3(i8* @jb, i32 2, void (i8*)* @_seh_longjmp_unwind, i32 0)
-  %inv = invoke i32 (i8*, i32, ...) @_setjmp3(i8* @jb, i32 0) #2
+; CHECK: store i32 0, ptr %[[gep]]
+; CHECK: invoke i32 (ptr, i32, ...) @_setjmp3(ptr @jb, i32 2, ptr @_seh_longjmp_unwind, i32 0)
+  %inv = invoke i32 (ptr, i32, ...) @_setjmp3(ptr @jb, i32 0) #2
           to label %invoke.cont unwind label %ehcleanup
 
 invoke.cont:
 ; CHECK: %[[gep:.*]] = getelementptr inbounds {{.*}}, {{.*}} %[[eh_reg]], i32 0, i32 4
-; CHECK: store i32 -1, i32* %[[gep]]
-; CHECK: call i32 (i8*, i32, ...) @_setjmp3(i8* @jb, i32 2, void (i8*)* @_seh_longjmp_unwind, i32 -1)
-  call i32 (i8*, i32, ...) @_setjmp3(i8* @jb, i32 0)
+; CHECK: store i32 -1, ptr %[[gep]]
+; CHECK: call i32 (ptr, i32, ...) @_setjmp3(ptr @jb, i32 2, ptr @_seh_longjmp_unwind, i32 -1)
+  call i32 (ptr, i32, ...) @_setjmp3(ptr @jb, i32 0)
   call void @cleanup()
   ret i32 %inv
 
@@ -64,7 +64,7 @@ ehcleanup:
 }
 
 ; Function Attrs: returns_twice
-declare i32 @_setjmp3(i8*, i32, ...) #2
+declare i32 @_setjmp3(ptr, i32, ...) #2
 
 declare i32 @__CxxFrameHandler3(...)
 

diff  --git a/llvm/test/CodeGen/WinEH/wineh-statenumbering-cleanups.ll b/llvm/test/CodeGen/WinEH/wineh-statenumbering-cleanups.ll
index 4a7189a0ed65d..6ba7005931103 100644
--- a/llvm/test/CodeGen/WinEH/wineh-statenumbering-cleanups.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-statenumbering-cleanups.ll
@@ -8,8 +8,8 @@ declare void @dummy_filter()
 declare void @f(i32)
 
 ; CHECK-LABEL: define void @test2(
-;Cxx: define void @test2(i1 %b) personality i32 (...)* @__CxxFrameHandler3 {
-;SEH: define void @test2(i1 %b) personality i32 (...)* @_except_handler3 {
+;Cxx: define void @test2(i1 %b) personality ptr @__CxxFrameHandler3 {
+;SEH: define void @test2(i1 %b) personality ptr @_except_handler3 {
 entry:
   ; CHECK: entry:
   ; CHECK:   store i32 1
@@ -26,16 +26,16 @@ right:
 catch.pad:
   %cs1 = catchswitch within none [label %catch.body] unwind to caller
 catch.body:
-;Cxx: %catch = catchpad within %cs1 [i8* null, i32 u0x40, i8* null]
-;SEH: %catch = catchpad within %cs1 [void ()* @dummy_filter]
+;Cxx: %catch = catchpad within %cs1 [ptr null, i32 u0x40, ptr null]
+;SEH: %catch = catchpad within %cs1 [ptr @dummy_filter]
   catchret from %catch to label %exit
 exit:
   ret void
 }
 
 ; CHECK-LABEL: define void @test3(
-;Cxx: define void @test3() personality i32 (...)* @__CxxFrameHandler3 {
-;SEH: define void @test3() personality i32 (...)* @_except_handler3 {
+;Cxx: define void @test3() personality ptr @__CxxFrameHandler3 {
+;SEH: define void @test3() personality ptr @_except_handler3 {
 entry:
   ; CHECK: entry:
   ; CHECK:   store i32 0
@@ -53,8 +53,8 @@ unreachable:
 catch.pad:
   %cs1 = catchswitch within none [label %catch.body] unwind to caller
 catch.body:
-;Cxx: %catch = catchpad within %cs1 [i8* null, i32 u0x40, i8* null]
-;SEH: %catch = catchpad within %cs1 [void ()* @dummy_filter]
+;Cxx: %catch = catchpad within %cs1 [ptr null, i32 u0x40, ptr null]
+;SEH: %catch = catchpad within %cs1 [ptr @dummy_filter]
   catchret from %catch to label %exit
 exit:
   ret void

diff  --git a/llvm/test/CodeGen/WinEH/wineh-statenumbering.ll b/llvm/test/CodeGen/WinEH/wineh-statenumbering.ll
index 733724cb4129a..a00287b2c7652 100644
--- a/llvm/test/CodeGen/WinEH/wineh-statenumbering.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-statenumbering.ll
@@ -3,10 +3,10 @@
 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
 target triple = "i686-pc-windows-msvc"
 
-%rtti.TypeDescriptor2 = type { i8**, i8*, [3 x i8] }
-%eh.CatchableType = type { i32, i8*, i32, i32, i32, i32, i8* }
-%eh.CatchableTypeArray.1 = type { i32, [1 x %eh.CatchableType*] }
-%eh.ThrowInfo = type { i32, i8*, i8*, i8* }
+%rtti.TypeDescriptor2 = type { ptr, ptr, [3 x i8] }
+%eh.CatchableType = type { i32, ptr, i32, i32, i32, i32, ptr }
+%eh.CatchableTypeArray.1 = type { i32, [1 x ptr] }
+%eh.ThrowInfo = type { i32, ptr, ptr, ptr }
 
 $"\01??_R0H at 8" = comdat any
 
@@ -16,13 +16,13 @@ $_CTA1H = comdat any
 
 $_TI1H = comdat any
 
-@"\01??_7type_info@@6B@" = external constant i8*
-@"\01??_R0H at 8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat
-@"_CT??_R0H at 84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H at 8" to i8*), i32 0, i32 -1, i32 0, i32 4, i8* null }, section ".xdata", comdat
- at _CTA1H = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.1 { i32 1, [1 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0H at 84"] }, section ".xdata", comdat
- at _TI1H = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i8* null, i8* null, i8* bitcast (%eh.CatchableTypeArray.1* @_CTA1H to i8*) }, section ".xdata", comdat
+@"\01??_7type_info@@6B@" = external constant ptr
+@"\01??_R0H at 8" = linkonce_odr global %rtti.TypeDescriptor2 { ptr @"\01??_7type_info@@6B@", ptr null, [3 x i8] c".H\00" }, comdat
+@"_CT??_R0H at 84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 1, ptr @"\01??_R0H at 8", i32 0, i32 -1, i32 0, i32 4, ptr null }, section ".xdata", comdat
+ at _CTA1H = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.1 { i32 1, [1 x ptr] [ptr @"_CT??_R0H at 84"] }, section ".xdata", comdat
+ at _TI1H = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, ptr null, ptr null, ptr @_CTA1H }, section ".xdata", comdat
 
-define i32 @main() #0 personality i32 (...)* @__CxxFrameHandler3 {
+define i32 @main() #0 personality ptr @__CxxFrameHandler3 {
 entry:
   %tmp = alloca i32, align 4
   ; CHECK: entry:
@@ -33,28 +33,27 @@ entry:
   call void @g(i32 3)
   call void @g(i32 4)
   call void @g(i32 5)
-  store i32 0, i32* %tmp, align 4
-  %0 = bitcast i32* %tmp to i8*
+  store i32 0, ptr %tmp, align 4
   ; CHECK:   store i32 0
   ; CHECK:   invoke void @_CxxThrowException(
-  invoke void @_CxxThrowException(i8* %0, %eh.ThrowInfo* nonnull @_TI1H) #1
+  invoke void @_CxxThrowException(ptr %tmp, ptr nonnull @_TI1H) #1
           to label %unreachable.for.entry unwind label %catch.dispatch
 
 catch.dispatch:                                   ; preds = %entry
   %cs1 = catchswitch within none [label %catch] unwind to caller
 
 catch:                                            ; preds = %catch.dispatch
-  %1 = catchpad within %cs1 [i8* null, i32 u0x40, i8* null]
+  %0 = catchpad within %cs1 [ptr null, i32 u0x40, ptr null]
   ; CHECK: catch:
   ; CHECK:   store i32 2
   ; CHECK:   invoke void @_CxxThrowException(
-  invoke void @_CxxThrowException(i8* null, %eh.ThrowInfo* null) [ "funclet"(token %1) ]
+  invoke void @_CxxThrowException(ptr null, ptr null) [ "funclet"(token %0) ]
           to label %unreachable unwind label %catch.dispatch.1
 
 catch.dispatch.1:                                 ; preds = %catch
-  %cs2 = catchswitch within %1 [label %catch.3] unwind to caller
+  %cs2 = catchswitch within %0 [label %catch.3] unwind to caller
 catch.3:                                          ; preds = %catch.dispatch.1
-  %2 = catchpad within %cs2 [i8* null, i32 u0x40, i8* null]
+  %1 = catchpad within %cs2 [ptr null, i32 u0x40, ptr null]
   ; CHECK: catch.3:
   ; CHECK:   store i32 3
   ; CHECK:   call void @g(i32 1)
@@ -63,7 +62,7 @@ catch.3:                                          ; preds = %catch.dispatch.1
   call void @g(i32 1)
   call void @g(i32 2)
   call void @g(i32 3)
-  catchret from %2 to label %try.cont
+  catchret from %1 to label %try.cont
 
 try.cont:                                         ; preds = %catch.3
   ; CHECK: try.cont:
@@ -83,7 +82,7 @@ unreachable.for.entry:                            ; preds = %entry
   unreachable
 }
 
-define i32 @nopads() #0 personality i32 (...)* @__CxxFrameHandler3 {
+define i32 @nopads() #0 personality ptr @__CxxFrameHandler3 {
   ret i32 0
 }
 
@@ -92,31 +91,31 @@ define i32 @nopads() #0 personality i32 (...)* @__CxxFrameHandler3 {
 ; CHECK-NOT: __ehhandler$nopads
 
 ; CHECK-LABEL: define void @PR25926()
-define void @PR25926() personality i32 (...)* @__CxxFrameHandler3 {
+define void @PR25926() personality ptr @__CxxFrameHandler3 {
 entry:
   ; CHECK: entry:
   ; CHECK:   store i32 -1
   ; CHECK:   store i32 0
   ; CHECK:   invoke void @_CxxThrowException(
-  invoke void @_CxxThrowException(i8* null, %eh.ThrowInfo* null)
+  invoke void @_CxxThrowException(ptr null, ptr null)
           to label %unreachable unwind label %catch.dispatch
 
 catch.dispatch:                                   ; preds = %entry
   %0 = catchswitch within none [label %catch] unwind to caller
 
 catch:                                            ; preds = %catch.dispatch
-  %1 = catchpad within %0 [i8* null, i32 64, i8* null]
+  %1 = catchpad within %0 [ptr null, i32 64, ptr null]
   ; CHECK: catch:
   ; CHECK:   store i32 3
   ; CHECK:   invoke void @_CxxThrowException(
-  invoke void @_CxxThrowException(i8* null, %eh.ThrowInfo* null) [ "funclet"(token %1) ]
+  invoke void @_CxxThrowException(ptr null, ptr null) [ "funclet"(token %1) ]
           to label %unreachable1 unwind label %catch.dispatch1
 
 catch.dispatch1:                                  ; preds = %catch
   %2 = catchswitch within %1 [label %catch2] unwind label %ehcleanup
 
 catch2:                                           ; preds = %catch.dispatch1
-  %3 = catchpad within %2 [i8* null, i32 64, i8* null]
+  %3 = catchpad within %2 [ptr null, i32 64, ptr null]
   catchret from %3 to label %try.cont
 
 try.cont:                                         ; preds = %catch2
@@ -148,10 +147,10 @@ unreachable1:                                     ; preds = %catch
 }
 
 ; CHECK-LABEL: define void @required_state_store(
-define void @required_state_store(i1 zeroext %cond) personality i32 (...)* @_except_handler3 {
+define void @required_state_store(i1 zeroext %cond) personality ptr @_except_handler3 {
 entry:
   %__exception_code = alloca i32, align 4
-  call void (...) @llvm.localescape(i32* nonnull %__exception_code)
+  call void (...) @llvm.localescape(ptr nonnull %__exception_code)
 ; CHECK:   store i32 -1
 ; CHECK:   call void @g(i32 0)
   call void @g(i32 0)
@@ -167,7 +166,7 @@ catch.dispatch:                                   ; preds = %if.then
   %0 = catchswitch within none [label %__except.ret] unwind to caller
 
 __except.ret:                                     ; preds = %catch.dispatch
-  %1 = catchpad within %0 [i8* bitcast (i32 ()* @"\01?filt$0 at 0@required_state_store@@" to i8*)]
+  %1 = catchpad within %0 [ptr @"\01?filt$0 at 0@required_state_store@@"]
   catchret from %1 to label %if.end
 
 if.end:                                           ; preds = %if.then, %__except.ret, %entry
@@ -179,17 +178,15 @@ if.end:                                           ; preds = %if.then, %__except.
 
 define internal i32 @"\01?filt$0 at 0@required_state_store@@"() {
 entry:
-  %0 = tail call i8* @llvm.frameaddress(i32 1)
-  %1 = tail call i8* @llvm.eh.recoverfp(i8* bitcast (void (i1)* @required_state_store to i8*), i8* %0)
-  %2 = tail call i8* @llvm.localrecover(i8* bitcast (void (i1)* @required_state_store to i8*), i8* %1, i32 0)
-  %__exception_code = bitcast i8* %2 to i32*
-  %3 = getelementptr inbounds i8, i8* %0, i32 -20
-  %4 = bitcast i8* %3 to { i32*, i8* }**
-  %5 = load { i32*, i8* }*, { i32*, i8* }** %4, align 4
-  %6 = getelementptr inbounds { i32*, i8* }, { i32*, i8* }* %5, i32 0, i32 0
-  %7 = load i32*, i32** %6, align 4
-  %8 = load i32, i32* %7, align 4
-  store i32 %8, i32* %__exception_code, align 4
+  %0 = tail call ptr @llvm.frameaddress(i32 1)
+  %1 = tail call ptr @llvm.eh.recoverfp(ptr @required_state_store, ptr %0)
+  %2 = tail call ptr @llvm.localrecover(ptr @required_state_store, ptr %1, i32 0)
+  %3 = getelementptr inbounds i8, ptr %0, i32 -20
+  %4 = load ptr, ptr %3, align 4
+  %5 = getelementptr inbounds { ptr, ptr }, ptr %4, i32 0, i32 0
+  %6 = load ptr, ptr %5, align 4
+  %7 = load i32, ptr %6, align 4
+  store i32 %7, ptr %2, align 4
   ret i32 1
 }
 
@@ -197,15 +194,15 @@ declare void @g(i32) #0
 
 declare void @dtor()
 
-declare x86_stdcallcc void @_CxxThrowException(i8*, %eh.ThrowInfo*)
+declare x86_stdcallcc void @_CxxThrowException(ptr, ptr)
 
 declare i32 @__CxxFrameHandler3(...)
 
-declare i8* @llvm.frameaddress(i32)
+declare ptr @llvm.frameaddress(i32)
 
-declare i8* @llvm.eh.recoverfp(i8*, i8*)
+declare ptr @llvm.eh.recoverfp(ptr, ptr)
 
-declare i8* @llvm.localrecover(i8*, i8*, i32)
+declare ptr @llvm.localrecover(ptr, ptr, i32)
 
 declare void @llvm.localescape(...)
 


        


More information about the llvm-commits mailing list