[lld] f01fdd1 - lld: Convert tests to opaque pointers

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 20:06:53 PST 2022


Author: Fangrui Song
Date: 2022-11-27T20:06:48-08:00
New Revision: f01fdd17b4d202727023da23bdd120eb0bd94f9f

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

LOG: lld: Convert tests to opaque pointers

Added: 
    

Modified: 
    lld/test/COFF/Inputs/failmismatch2.ll
    lld/test/COFF/Inputs/thinlto-mangled-qux.ll
    lld/test/COFF/Inputs/tlssup-32.ll
    lld/test/COFF/Inputs/tlssup-64.ll
    lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
    lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
    lld/test/COFF/Inputs/weak-external3.ll
    lld/test/COFF/autoimport-lto.ll
    lld/test/COFF/guardcf-lto.ll
    lld/test/COFF/libcall-archive.ll
    lld/test/COFF/lto-chkstk.ll
    lld/test/COFF/lto-icf.ll
    lld/test/COFF/lto-new-pass-manager.ll
    lld/test/COFF/lto-new-symbol.ll
    lld/test/COFF/lto-reloc-model.ll
    lld/test/COFF/pdb_char8_t.ll
    lld/test/COFF/thinlto-mangled.ll
    lld/test/COFF/tls-alignment-32.ll
    lld/test/COFF/tls-alignment-64.ll
    lld/test/COFF/used-lto.ll
    lld/test/ELF/Inputs/exclude-libs.ll
    lld/test/ELF/common-archive-lookup.s
    lld/test/ELF/lto/Inputs/devirt_vcall_vis_shared_def.ll
    lld/test/ELF/lto/Inputs/thin1.ll
    lld/test/ELF/lto/Inputs/thin2.ll
    lld/test/ELF/lto/Inputs/type-merge2.ll
    lld/test/ELF/lto/Inputs/weakodr-visibility.ll
    lld/test/ELF/lto/abs-resol.ll
    lld/test/ELF/lto/arm-wrap-personality.ll
    lld/test/ELF/lto/codemodel.ll
    lld/test/ELF/lto/comdat-nodeduplicate.ll
    lld/test/ELF/lto/common2.ll
    lld/test/ELF/lto/common3.ll
    lld/test/ELF/lto/ctors.ll
    lld/test/ELF/lto/devirt_split_unit_localize.ll
    lld/test/ELF/lto/devirt_vcall_vis_export_dynamic.ll
    lld/test/ELF/lto/devirt_vcall_vis_localize.ll
    lld/test/ELF/lto/devirt_vcall_vis_shared_def.ll
    lld/test/ELF/lto/discard-value-names.ll
    lld/test/ELF/lto/internalize-exportdyn.ll
    lld/test/ELF/lto/internalize-llvmused.ll
    lld/test/ELF/lto/libcall-archive.ll
    lld/test/ELF/lto/linkage.ll
    lld/test/ELF/lto/linker-script-symbols-assign.ll
    lld/test/ELF/lto/ltopasses-basic.ll
    lld/test/ELF/lto/ltopasses-extension.ll
    lld/test/ELF/lto/metadata.ll
    lld/test/ELF/lto/pseudo-probe-lto.ll
    lld/test/ELF/lto/relax-relocs.ll
    lld/test/ELF/lto/relocation-model-pic.ll
    lld/test/ELF/lto/relocation-model-static.ll
    lld/test/ELF/lto/section-name.ll
    lld/test/ELF/lto/setting-dso-local.ll
    lld/test/ELF/lto/slp-vectorize-pm.ll
    lld/test/ELF/lto/tls-preserve.ll
    lld/test/ELF/lto/type-merge.ll
    lld/test/ELF/lto/type-merge2.ll
    lld/test/ELF/lto/undefined-puts.ll
    lld/test/ELF/lto/unnamed-addr.ll
    lld/test/ELF/lto/weakodr-visibility.ll
    lld/test/ELF/lto/wrap-unreferenced-before-codegen.test
    lld/test/MachO/lc-linker-option.ll
    lld/test/MachO/lto-archive.ll
    lld/test/MachO/lto-codemodel.ll
    lld/test/MachO/lto-common-symbol-resolution.ll
    lld/test/MachO/lto-internalize-unnamed-addr.ll
    lld/test/MachO/lto-objc-arc-contract.ll
    lld/test/wasm/Inputs/comdat1.ll
    lld/test/wasm/Inputs/comdat2.ll
    lld/test/wasm/Inputs/debuginfo2.ll
    lld/test/wasm/Inputs/global-ctor-dtor.ll
    lld/test/wasm/Inputs/locals-duplicate1.ll
    lld/test/wasm/Inputs/locals-duplicate2.ll
    lld/test/wasm/Inputs/many-funcs.ll
    lld/test/wasm/Inputs/tag-section1.ll
    lld/test/wasm/Inputs/tag-section2.ll
    lld/test/wasm/Inputs/weak-alias.ll
    lld/test/wasm/gc-sections.ll
    lld/test/wasm/init-fini-no-gc.ll
    lld/test/wasm/init-fini.ll
    lld/test/wasm/local-symbols.ll
    lld/test/wasm/lto/Inputs/thin1.ll
    lld/test/wasm/lto/Inputs/thin2.ll
    lld/test/wasm/lto/atomics.ll
    lld/test/wasm/lto/diagnostics.ll
    lld/test/wasm/lto/libcall-archive.ll
    lld/test/wasm/lto/libcall-truncsfhf2.ll
    lld/test/wasm/lto/relocatable-undefined.ll
    lld/test/wasm/lto/tls.ll
    lld/test/wasm/lto/undef.ll
    lld/test/wasm/lto/used.ll
    lld/test/wasm/pic-static.ll
    lld/test/wasm/pie.ll
    lld/test/wasm/relocatable.ll
    lld/test/wasm/shared.s
    lld/test/wasm/shared64.s
    lld/test/wasm/signature-mismatch-unknown.ll
    lld/test/wasm/startstop.ll
    lld/test/wasm/tag-section.ll
    lld/test/wasm/undefined.ll

Removed: 
    


################################################################################
diff  --git a/lld/test/COFF/Inputs/failmismatch2.ll b/lld/test/COFF/Inputs/failmismatch2.ll
index 4facbfda28710..9e9ff2e222469 100644
--- a/lld/test/COFF/Inputs/failmismatch2.ll
+++ b/lld/test/COFF/Inputs/failmismatch2.ll
@@ -3,7 +3,7 @@
 ; Function Attrs: noinline norecurse nounwind optnone sspstrong uwtable
 define dso_local i32 @main() #0 {
   %1 = alloca i32, align 4
-  store i32 0, i32* %1, align 4
+  store i32 0, ptr %1, align 4
   %2 = call i32 @"?f@@YAHXZ"()
   ret i32 %2
 }

diff  --git a/lld/test/COFF/Inputs/thinlto-mangled-qux.ll b/lld/test/COFF/Inputs/thinlto-mangled-qux.ll
index a9e89249674b7..1e556e81e8414 100644
--- a/lld/test/COFF/Inputs/thinlto-mangled-qux.ll
+++ b/lld/test/COFF/Inputs/thinlto-mangled-qux.ll
@@ -2,7 +2,7 @@ target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 target triple = "x86_64-pc-windows-msvc19.0.24215"
 
 %class.baz = type { %class.bar }
-%class.bar = type { i32 (...)** }
+%class.bar = type { ptr }
 
 $"\01?x at bar@@UEBA_NXZ" = comdat any
 
@@ -10,17 +10,17 @@ $"\01??_7baz@@6B@" = comdat any
 
 $"\01??_Gbaz@@UEAAPEAXI at Z" = comdat any
 
-@"\01??_7baz@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (i8* (%class.baz*, i32)* @"\01??_Gbaz@@UEAAPEAXI at Z" to i8*), i8* bitcast (i1 (%class.bar*)* @"\01?x at bar@@UEBA_NXZ" to i8*)] }, comdat, !type !0, !type !1
+@"\01??_7baz@@6B@" = linkonce_odr unnamed_addr constant { [2 x ptr] } { [2 x ptr] [ptr @"\01??_Gbaz@@UEAAPEAXI at Z", ptr @"\01?x at bar@@UEBA_NXZ"] }, comdat, !type !0, !type !1
 
 define void @"\01?qux@@YAXXZ"() local_unnamed_addr {
   ret void
 }
 
-define linkonce_odr i8* @"\01??_Gbaz@@UEAAPEAXI at Z"(%class.baz* %this, i32 %should_call_delete) unnamed_addr comdat {
-  ret i8* null
+define linkonce_odr ptr @"\01??_Gbaz@@UEAAPEAXI at Z"(ptr %this, i32 %should_call_delete) unnamed_addr comdat {
+  ret ptr null
 }
 
-define linkonce_odr zeroext i1 @"\01?x at bar@@UEBA_NXZ"(%class.bar* %this) unnamed_addr comdat {
+define linkonce_odr zeroext i1 @"\01?x at bar@@UEBA_NXZ"(ptr %this) unnamed_addr comdat {
   ret i1 false
 }
 

diff  --git a/lld/test/COFF/Inputs/tlssup-32.ll b/lld/test/COFF/Inputs/tlssup-32.ll
index e49cde4969e51..e6c04db7841dd 100644
--- a/lld/test/COFF/Inputs/tlssup-32.ll
+++ b/lld/test/COFF/Inputs/tlssup-32.ll
@@ -17,9 +17,9 @@ target triple = "i686-pc-windows-msvc"
 @_tls_index = global i32 0
 
 @_tls_used = global %IMAGE_TLS_DIRECTORY32 {
-    i32 ptrtoint (i8* @_tls_start to i32),
-    i32 ptrtoint (i8* @_tls_end to i32),
-    i32 ptrtoint (i32* @_tls_index to i32),
+    i32 ptrtoint (ptr @_tls_start to i32),
+    i32 ptrtoint (ptr @_tls_end to i32),
+    i32 ptrtoint (ptr @_tls_index to i32),
     i32 0,
     i32 0,
     i32 0

diff  --git a/lld/test/COFF/Inputs/tlssup-64.ll b/lld/test/COFF/Inputs/tlssup-64.ll
index aadcf989a2def..34e7daa454d83 100644
--- a/lld/test/COFF/Inputs/tlssup-64.ll
+++ b/lld/test/COFF/Inputs/tlssup-64.ll
@@ -17,9 +17,9 @@ target triple = "x86_64-pc-windows-msvc"
 @_tls_index = global i64 0
 
 @_tls_used = global %IMAGE_TLS_DIRECTORY64 {
-    i64 ptrtoint (i8* @_tls_start to i64),
-    i64 ptrtoint (i8* @_tls_end to i64),
-    i64 ptrtoint (i64* @_tls_index to i64),
+    i64 ptrtoint (ptr @_tls_start to i64),
+    i64 ptrtoint (ptr @_tls_end to i64),
+    i64 ptrtoint (ptr @_tls_index to i64),
     i64 0,
     i32 0,
     i32 0

diff  --git a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
index 8ae4b4514b708..7e29044ebe00d 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-a.ll
@@ -4,9 +4,9 @@ target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 target triple = "x86_64-pc-windows-msvc19.21.27702"
 
 %struct.Init = type { %struct.S }
-%struct.S = type { i32 (...)** }
+%struct.S = type { ptr }
 %rtti.CompleteObjectLocator = type { i32, i32, i32, i32, i32, i32 }
-%rtti.TypeDescriptor7 = type { i8**, i8*, [8 x i8] }
+%rtti.TypeDescriptor7 = type { ptr, ptr, [8 x i8] }
 %rtti.ClassHierarchyDescriptor = type { i32, i32, i32, i32 }
 %rtti.BaseClassDescriptor = type { i32, i32, i32, i32, i32, i32, i32 }
 
@@ -23,26 +23,26 @@ $"??_R2S@@8" = comdat any
 $"??_R1A@?0A at EA@S@@8" = comdat any
 
 @"?d@@3UInit@@A" = dso_local local_unnamed_addr global %struct.Init zeroinitializer, align 8
- at anon.bcb2691509de99310dddb690fcdb4cdc.0 = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"??_R4S@@6B@" to i8*), i8* bitcast (void (%struct.S*)* @"?foo at S@@UEAAXXZ" to i8*)] }, comdat($"??_SS@@6B@"), !type !0
-@"??_R4S@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUS@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3S@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4S@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat
-@"??_7type_info@@6B@" = external constant i8*
-@"??_R0?AUS@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUS@@\00" }, comdat
+ at anon.bcb2691509de99310dddb690fcdb4cdc.0 = private unnamed_addr constant { [2 x ptr] } { [2 x ptr] [ptr @"??_R4S@@6B@", ptr @"?foo at S@@UEAAXXZ"] }, comdat($"??_SS@@6B@"), !type !0
+@"??_R4S@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R0?AUS@@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R3S@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R4S@@6B@" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32) }, comdat
+@"??_7type_info@@6B@" = external constant ptr
+@"??_R0?AUS@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { ptr @"??_7type_info@@6B@", ptr null, [8 x i8] c".?AUS@@\00" }, comdat
 @__ImageBase = external dso_local constant i8
-@"??_R3S@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"??_R2S@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat
-@"??_R2S@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A at EA@S@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat
-@"??_R1A@?0A at EA@S@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUS@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3S@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat
- at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_t.cpp, i8* null }]
+@"??_R3S@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R2S@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32) }, comdat
+@"??_R2S@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R1A@?0A at EA@S@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32), i32 0], comdat
+@"??_R1A@?0A at EA@S@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R0?AUS@@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R3S@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32) }, comdat
+ at llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I_t.cpp, ptr null }]
 
-@"??_SS@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @anon.bcb2691509de99310dddb690fcdb4cdc.0, i32 0, i32 0, i32 1)
+@"??_SS@@6B@" = unnamed_addr alias ptr, getelementptr inbounds ({ [2 x ptr] }, ptr @anon.bcb2691509de99310dddb690fcdb4cdc.0, i32 0, i32 0, i32 1)
 
 declare dso_local void @"?undefined_ref@@YAXXZ"() local_unnamed_addr #0
 
-declare dllimport void @"?foo at S@@UEAAXXZ"(%struct.S*) unnamed_addr #0
+declare dllimport void @"?foo at S@@UEAAXXZ"(ptr) unnamed_addr #0
 
 ; Function Attrs: nounwind sspstrong uwtable
 define internal void @_GLOBAL__sub_I_t.cpp() #1 {
 entry:
-  store i32 (...)** bitcast (i8** @"??_SS@@6B@" to i32 (...)**), i32 (...)*** getelementptr inbounds (%struct.Init, %struct.Init* @"?d@@3UInit@@A", i64 0, i32 0, i32 0), align 8
+  store ptr @"??_SS@@6B@", ptr @"?d@@3UInit@@A", align 8
   tail call void @"?undefined_ref@@YAXXZ"() #2
   ret void
 }

diff  --git a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
index 809c520a43a20..0f64e236a1f47 100644
--- a/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
+++ b/lld/test/COFF/Inputs/undefined-symbol-lto-b.ll
@@ -3,10 +3,10 @@ source_filename = "b.cpp"
 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc19.21.27702"
 
-%struct.S = type { i32 (...)** }
+%struct.S = type { ptr }
 
 ; Function Attrs: norecurse nounwind readnone sspstrong uwtable
-define dso_local void @"?foo at S@@UEAAXXZ"(%struct.S* nocapture %this) unnamed_addr #0 align 2 {
+define dso_local void @"?foo at S@@UEAAXXZ"(ptr nocapture %this) unnamed_addr #0 align 2 {
 entry:
   ret void
 }

diff  --git a/lld/test/COFF/Inputs/weak-external3.ll b/lld/test/COFF/Inputs/weak-external3.ll
index d229e49663563..d75489fe048ac 100644
--- a/lld/test/COFF/Inputs/weak-external3.ll
+++ b/lld/test/COFF/Inputs/weak-external3.ll
@@ -1,7 +1,7 @@
 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc"
 
- at f = weak alias void(), void()* @g
+ at f = weak alias void(), ptr @g
 
 define void @g() {
   ret void

diff  --git a/lld/test/COFF/autoimport-lto.ll b/lld/test/COFF/autoimport-lto.ll
index db3679ce23a9f..94210e43cda6c 100644
--- a/lld/test/COFF/autoimport-lto.ll
+++ b/lld/test/COFF/autoimport-lto.ll
@@ -23,6 +23,6 @@ target triple = "x86_64-w64-windows-gnu"
 
 define i32 @entry() {
 entry:
-  %0 = load i32, i32* @variable
+  %0 = load i32, ptr @variable
   ret i32 %0
 }

diff  --git a/lld/test/COFF/guardcf-lto.ll b/lld/test/COFF/guardcf-lto.ll
index 44d538ccfe159..becd4a94549c9 100644
--- a/lld/test/COFF/guardcf-lto.ll
+++ b/lld/test/COFF/guardcf-lto.ll
@@ -30,11 +30,11 @@
 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc19.12.25835"
 
-declare dllimport void @do_indirect_call(void ()*)
+declare dllimport void @do_indirect_call(ptr)
 
 define dso_local i32 @main() local_unnamed_addr {
 entry:
-  tail call void @do_indirect_call(void ()* nonnull @my_handler)
+  tail call void @do_indirect_call(ptr nonnull @my_handler)
   ret i32 0
 }
 

diff  --git a/lld/test/COFF/libcall-archive.ll b/lld/test/COFF/libcall-archive.ll
index c78c1d41fde8f..7adf1d90e9c6e 100644
--- a/lld/test/COFF/libcall-archive.ll
+++ b/lld/test/COFF/libcall-archive.ll
@@ -13,10 +13,10 @@
 target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
 target triple = "i686-unknown-windows"
 
-define void @start(i8* %a, i8* %b) {
+define void @start(ptr %a, ptr %b) {
 entry:
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 1024, i1 false)
+  call void @llvm.memcpy.p0.p0.i64(ptr %a, ptr %b, i64 1024, i1 false)
   ret void
 }
 
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1)

diff  --git a/lld/test/COFF/lto-chkstk.ll b/lld/test/COFF/lto-chkstk.ll
index c2a15180b764e..331acea92c3ab 100644
--- a/lld/test/COFF/lto-chkstk.ll
+++ b/lld/test/COFF/lto-chkstk.ll
@@ -12,8 +12,8 @@ target triple = "x86_64-pc-windows-msvc"
 define void @main() {
 entry:
   %array4096 = alloca [4096 x i8]
-  call void @foo([4096 x i8]* %array4096)
+  call void @foo(ptr %array4096)
   ret void
 }
 
-declare void @foo([4096 x i8]*)
+declare void @foo(ptr)

diff  --git a/lld/test/COFF/lto-icf.ll b/lld/test/COFF/lto-icf.ll
index 156f1d2f12f33..2862b0b31ddf0 100644
--- a/lld/test/COFF/lto-icf.ll
+++ b/lld/test/COFF/lto-icf.ll
@@ -15,9 +15,9 @@
 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc19.12.25835"
 
-define dllexport i8* @icf_ptr() {
+define dllexport ptr @icf_ptr() {
 entry:
-  ret i8* null
+  ret ptr null
 }
 
 define dllexport i64 @icf_int() {

diff  --git a/lld/test/COFF/lto-new-pass-manager.ll b/lld/test/COFF/lto-new-pass-manager.ll
index 7095b6a851b61..9e7b7f01b3e83 100644
--- a/lld/test/COFF/lto-new-pass-manager.ll
+++ b/lld/test/COFF/lto-new-pass-manager.ll
@@ -7,7 +7,7 @@
 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc19.11.0"
 
-define dso_local i32 @main(i32 %argc, i8** nocapture readnone %0) local_unnamed_addr {
+define dso_local i32 @main(i32 %argc, ptr nocapture readnone %0) local_unnamed_addr {
 entry:
   ret i32 %argc
 }

diff  --git a/lld/test/COFF/lto-new-symbol.ll b/lld/test/COFF/lto-new-symbol.ll
index 7f5a328466e23..37a9a0f16579e 100644
--- a/lld/test/COFF/lto-new-symbol.ll
+++ b/lld/test/COFF/lto-new-symbol.ll
@@ -9,12 +9,12 @@ target triple = "x86_64-pc-windows-msvc"
 ; using floats.
 @_fltused = dllexport global i32 0, align 4
 
-define void @foo(<4 x i32>* %p, <4 x float>* %q, i1 %t) nounwind {
+define void @foo(ptr %p, ptr %q, i1 %t) nounwind {
 entry:
   br label %loop
 loop:
-  store <4 x i32><i32 1073741824, i32 1073741824, i32 1073741824, i32 1073741824>, <4 x i32>* %p
-  store <4 x float><float 2.0, float 2.0, float 2.0, float 2.0>, <4 x float>* %q
+  store <4 x i32><i32 1073741824, i32 1073741824, i32 1073741824, i32 1073741824>, ptr %p
+  store <4 x float><float 2.0, float 2.0, float 2.0, float 2.0>, ptr %q
   br i1 %t, label %loop, label %ret
 ret:
   ret void

diff  --git a/lld/test/COFF/lto-reloc-model.ll b/lld/test/COFF/lto-reloc-model.ll
index e6bb3c4248ab2..dc7cc9d98aec5 100644
--- a/lld/test/COFF/lto-reloc-model.ll
+++ b/lld/test/COFF/lto-reloc-model.ll
@@ -11,10 +11,10 @@ target triple = "i686-pc-windows-msvc"
 module asm "__tls_index = 1"
 module asm "__tls_array = 2"
 
-define i8* @main() {
+define ptr @main() {
   ; CHECK: movl 1, %eax
   ; CHECK: movl %fs:2, %ecx
   ; CHECK: movl (%ecx,%eax,4), %eax
   ; CHECK: leal (%eax), %eax
-  ret i8* @foo
+  ret ptr @foo
 }

diff  --git a/lld/test/COFF/pdb_char8_t.ll b/lld/test/COFF/pdb_char8_t.ll
index f03cdd27aa50f..0cb71b641e8c8 100644
--- a/lld/test/COFF/pdb_char8_t.ll
+++ b/lld/test/COFF/pdb_char8_t.ll
@@ -8,10 +8,10 @@
 define dso_local i32 @main() #0 !dbg !9 {
   %1 = alloca i32, align 4
   %2 = alloca i8, align 1
-  store i32 0, i32* %1, align 4
-  call void @llvm.dbg.declare(metadata i8* %2, metadata !13, metadata !DIExpression()), !dbg !15
-  store i8 0, i8* %2, align 1, !dbg !15
-  %3 = load i8, i8* %2, align 1, !dbg !16
+  store i32 0, ptr %1, align 4
+  call void @llvm.dbg.declare(metadata ptr %2, metadata !13, metadata !DIExpression()), !dbg !15
+  store i8 0, ptr %2, align 1, !dbg !15
+  %3 = load i8, ptr %2, align 1, !dbg !16
   %4 = zext i8 %3 to i32, !dbg !16
   ret i32 %4, !dbg !16
 }

diff  --git a/lld/test/COFF/thinlto-mangled.ll b/lld/test/COFF/thinlto-mangled.ll
index e4a513dc7f642..2554328d05dbf 100644
--- a/lld/test/COFF/thinlto-mangled.ll
+++ b/lld/test/COFF/thinlto-mangled.ll
@@ -6,12 +6,12 @@
 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc19.0.24215"
 
-%"class.bar" = type { i32 (...)**, i8*, i8*, i8*, i32 }
+%"class.bar" = type { ptr, ptr, ptr, ptr, i32 }
 
 define i32 @main() {
   ret i32 0
 }
 
-define available_externally zeroext i1 @"\01?x at bar@@UEBA_NXZ"(%"class.bar"* %this) unnamed_addr align 2 {
+define available_externally zeroext i1 @"\01?x at bar@@UEBA_NXZ"(ptr %this) unnamed_addr align 2 {
   ret i1 false
 }

diff  --git a/lld/test/COFF/tls-alignment-32.ll b/lld/test/COFF/tls-alignment-32.ll
index 8df11e7fd1c23..2f02b59f7bf5f 100644
--- a/lld/test/COFF/tls-alignment-32.ll
+++ b/lld/test/COFF/tls-alignment-32.ll
@@ -21,6 +21,6 @@ target triple = "i686-pc-windows-msvc"
 @aligned_thread_local = thread_local global i32 42, align 32
 
 define i32 @main() {
-  %t = load i32, i32* @aligned_thread_local
+  %t = load i32, ptr @aligned_thread_local
   ret i32 %t
 }

diff  --git a/lld/test/COFF/tls-alignment-64.ll b/lld/test/COFF/tls-alignment-64.ll
index 04813ca0021e7..b3baf8b2898fb 100644
--- a/lld/test/COFF/tls-alignment-64.ll
+++ b/lld/test/COFF/tls-alignment-64.ll
@@ -21,6 +21,6 @@ target triple = "x86_64-pc-windows-msvc"
 @aligned_thread_local = thread_local global i32 42, align 64
 
 define i32 @main() {
-  %t = load i32, i32* @aligned_thread_local
+  %t = load i32, ptr @aligned_thread_local
   ret i32 %t
 }

diff  --git a/lld/test/COFF/used-lto.ll b/lld/test/COFF/used-lto.ll
index d1c87c16a5daa..f573eb7870a99 100644
--- a/lld/test/COFF/used-lto.ll
+++ b/lld/test/COFF/used-lto.ll
@@ -8,7 +8,7 @@
 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc"
 
- at llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to i8*)], section "llvm.metadata"
+ at llvm.used = appending global [1 x ptr] [ptr @foo], section "llvm.metadata"
 
 define void @foo() {
   ret void

diff  --git a/lld/test/ELF/Inputs/exclude-libs.ll b/lld/test/ELF/Inputs/exclude-libs.ll
index 9e6cc6ff72ae4..99b72ae378e97 100644
--- a/lld/test/ELF/Inputs/exclude-libs.ll
+++ b/lld/test/ELF/Inputs/exclude-libs.ll
@@ -1,3 +1,3 @@
 target triple = "x86_64-unknown-linux"
 
- at fn2 = global void()* null;
+ at fn2 = global ptr null;

diff  --git a/lld/test/ELF/common-archive-lookup.s b/lld/test/ELF/common-archive-lookup.s
index 30c8678350eed..2a813324a2775 100644
--- a/lld/test/ELF/common-archive-lookup.s
+++ b/lld/test/ELF/common-archive-lookup.s
@@ -193,7 +193,7 @@ target triple = "powerpc64le-unknown-linux-gnu"
 define dso_local i32 @bar(i32 signext %i) local_unnamed_addr {
 entry:
   %idxprom = sext i32 %i to i64
-  %arrayidx = getelementptr inbounds [5 x i32], [5 x i32]* @block, i64 0, i64 %idxprom
-  %0 = load i32, i32* %arrayidx, align 8
+  %arrayidx = getelementptr inbounds [5 x i32], ptr @block, i64 0, i64 %idxprom
+  %0 = load i32, ptr %arrayidx, align 8
   ret i32 %0
 }

diff  --git a/lld/test/ELF/lto/Inputs/devirt_vcall_vis_shared_def.ll b/lld/test/ELF/lto/Inputs/devirt_vcall_vis_shared_def.ll
index ceb3f7f2afbb1..c70c743b4ade2 100644
--- a/lld/test/ELF/lto/Inputs/devirt_vcall_vis_shared_def.ll
+++ b/lld/test/ELF/lto/Inputs/devirt_vcall_vis_shared_def.ll
@@ -1,15 +1,15 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-grtev4-linux-gnu"
 
-%struct.A = type { i32 (...)** }
+%struct.A = type { ptr }
 
- at _ZTV1A = unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !vcall_visibility !1
+ at _ZTV1A = unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1A1fEi, ptr @_ZN1A1nEi] }, !type !0, !vcall_visibility !1
 
-define i32 @_ZN1A1fEi(%struct.A* %this, i32 %a) #0 {
+define i32 @_ZN1A1fEi(ptr %this, i32 %a) #0 {
    ret i32 0;
 }
 
-define i32 @_ZN1A1nEi(%struct.A* %this, i32 %a) #0 {
+define i32 @_ZN1A1nEi(ptr %this, i32 %a) #0 {
    ret i32 0;
 }
 

diff  --git a/lld/test/ELF/lto/Inputs/thin1.ll b/lld/test/ELF/lto/Inputs/thin1.ll
index 011eee616e33e..3c2fc4cbef4c7 100644
--- a/lld/test/ELF/lto/Inputs/thin1.ll
+++ b/lld/test/ELF/lto/Inputs/thin1.ll
@@ -4,9 +4,9 @@ target triple = "x86_64-scei-ps4"
 define i32 @foo(i32 %goo) {
 entry:
   %goo.addr = alloca i32, align 4
-  store i32 %goo, i32* %goo.addr, align 4
-  %0 = load i32, i32* %goo.addr, align 4
-  %1 = load i32, i32* %goo.addr, align 4
+  store i32 %goo, ptr %goo.addr, align 4
+  %0 = load i32, ptr %goo.addr, align 4
+  %1 = load i32, ptr %goo.addr, align 4
   %mul = mul nsw i32 %0, %1
   ret i32 %mul
 }

diff  --git a/lld/test/ELF/lto/Inputs/thin2.ll b/lld/test/ELF/lto/Inputs/thin2.ll
index 7c3e61ee4ac2a..6e99e4e674a65 100644
--- a/lld/test/ELF/lto/Inputs/thin2.ll
+++ b/lld/test/ELF/lto/Inputs/thin2.ll
@@ -4,8 +4,8 @@ target triple = "x86_64-scei-ps4"
 define i32 @blah(i32 %meh) #0 {
 entry:
   %meh.addr = alloca i32, align 4
-  store i32 %meh, i32* %meh.addr, align 4
-  %0 = load i32, i32* %meh.addr, align 4
+  store i32 %meh, ptr %meh.addr, align 4
+  %0 = load i32, ptr %meh.addr, align 4
   %sub = sub nsw i32 %0, 48
   ret i32 %sub
 }

diff  --git a/lld/test/ELF/lto/Inputs/type-merge2.ll b/lld/test/ELF/lto/Inputs/type-merge2.ll
index de92d2cfea1d3..14ed68d7cb5ca 100644
--- a/lld/test/ELF/lto/Inputs/type-merge2.ll
+++ b/lld/test/ELF/lto/Inputs/type-merge2.ll
@@ -2,7 +2,7 @@ target triple = "x86_64-unknown-linux-gnu"
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 
 %zed = type { i16 }
-define void @bar(%zed* %this)  {
-  store %zed* %this, %zed** null
+define void @bar(ptr %this)  {
+  store ptr %this, ptr null
   ret void
 }

diff  --git a/lld/test/ELF/lto/Inputs/weakodr-visibility.ll b/lld/test/ELF/lto/Inputs/weakodr-visibility.ll
index 00c68fe5813b6..3aa037f78b531 100644
--- a/lld/test/ELF/lto/Inputs/weakodr-visibility.ll
+++ b/lld/test/ELF/lto/Inputs/weakodr-visibility.ll
@@ -1,6 +1,6 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define weak_odr protected i32 @foo(i8* %this) {
+define weak_odr protected i32 @foo(ptr %this) {
   ret i32 42
 }

diff  --git a/lld/test/ELF/lto/abs-resol.ll b/lld/test/ELF/lto/abs-resol.ll
index 01de6adce13a7..aa4393f33a668 100644
--- a/lld/test/ELF/lto/abs-resol.ll
+++ b/lld/test/ELF/lto/abs-resol.ll
@@ -12,6 +12,6 @@ target triple = "x86_64-unknown-linux-gnu"
 
 @blah = external global i8, align 1
 
-define i8* @_start() {
- ret i8* @blah
+define ptr @_start() {
+ ret ptr @blah
 }

diff  --git a/lld/test/ELF/lto/arm-wrap-personality.ll b/lld/test/ELF/lto/arm-wrap-personality.ll
index ac774730b3c26..c1299538088a0 100644
--- a/lld/test/ELF/lto/arm-wrap-personality.ll
+++ b/lld/test/ELF/lto/arm-wrap-personality.ll
@@ -22,13 +22,13 @@ define i32 @__gxx_personality_v0(...) {
   ret i32 0
 }
 
-define void @dummy() optnone noinline personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @dummy() optnone noinline personality ptr @__gxx_personality_v0 {
   invoke void @dummy() to label %cont unwind label %lpad
 
 cont:
   ret void
 
 lpad:
-  %lp = landingpad { i8*, i32 } cleanup
-  resume { i8*, i32 } %lp
+  %lp = landingpad { ptr, i32 } cleanup
+  resume { ptr, i32 } %lp
 }

diff  --git a/lld/test/ELF/lto/codemodel.ll b/lld/test/ELF/lto/codemodel.ll
index 22551030df474..a35f87729411d 100644
--- a/lld/test/ELF/lto/codemodel.ll
+++ b/lld/test/ELF/lto/codemodel.ll
@@ -10,11 +10,11 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 
 @data = internal constant [0 x i32] []
 
-define i32* @_start() nounwind readonly {
+define ptr @_start() nounwind readonly {
 entry:
 ; CHECK-SMALL-LABEL:  <_start>:
 ; CHECK-SMALL: movl    $2097440, %eax
 ; CHECK-LARGE-LABEL: <_start>:
 ; CHECK-LARGE: movabsq $2097440, %rax
-    ret i32* getelementptr ([0 x i32], [0 x i32]* @data, i64 0, i64 0)
+    ret ptr @data
 }

diff  --git a/lld/test/ELF/lto/comdat-nodeduplicate.ll b/lld/test/ELF/lto/comdat-nodeduplicate.ll
index 22856b50cd2b1..eef17d41c5a4d 100644
--- a/lld/test/ELF/lto/comdat-nodeduplicate.ll
+++ b/lld/test/ELF/lto/comdat-nodeduplicate.ll
@@ -72,14 +72,14 @@ target triple = "x86_64-unknown-linux-gnu"
 
 $__profc_foo = comdat nodeduplicate
 @__profc_foo = private global i64 1, comdat, align 8
- at __profd_foo = private global i64* @__profc_foo, comdat($__profc_foo), align 8
+ at __profd_foo = private global ptr @__profc_foo, comdat($__profc_foo), align 8
 
 declare void @b()
 
 define i64 @foo() {
-  %v = load i64, i64* @__profc_foo
+  %v = load i64, ptr @__profc_foo
   %inc = add i64 1, %v
-  store i64 %inc, i64* @__profc_foo
+  store i64 %inc, ptr @__profc_foo
   ret i64 %inc
 }
 
@@ -94,12 +94,12 @@ target triple = "x86_64-unknown-linux-gnu"
 
 $__profc_foo = comdat nodeduplicate
 @__profc_foo = weak hidden global i64 2, comdat, align 8
- at __profd_foo = private global i64* @__profc_foo, comdat($__profc_foo)
+ at __profd_foo = private global ptr @__profc_foo, comdat($__profc_foo)
 
 define weak i64 @foo() {
-  %v = load i64, i64* @__profc_foo
+  %v = load i64, ptr @__profc_foo
   %inc = add i64 1, %v
-  store i64 %inc, i64* @__profc_foo
+  store i64 %inc, ptr @__profc_foo
   ret i64 %inc
 }
 
@@ -113,12 +113,12 @@ target triple = "x86_64-unknown-linux-gnu"
 
 $__profc_foo = comdat nodeduplicate
 @__profc_foo = weak hidden global i64 3, comdat, align 8
- at __profd_foo = private global i64* @__profc_foo, comdat($__profc_foo)
+ at __profd_foo = private global ptr @__profc_foo, comdat($__profc_foo)
 
 define weak i64 @foo() {
-  %v = load i64, i64* @__profc_foo
+  %v = load i64, ptr @__profc_foo
   %inc = add i64 1, %v
-  store i64 %inc, i64* @__profc_foo
+  store i64 %inc, ptr @__profc_foo
   ret i64 %inc
 }
 

diff  --git a/lld/test/ELF/lto/common2.ll b/lld/test/ELF/lto/common2.ll
index 1e886b81b8387..375f7683d8fbd 100644
--- a/lld/test/ELF/lto/common2.ll
+++ b/lld/test/ELF/lto/common2.ll
@@ -12,7 +12,7 @@ target triple = "x86_64-unknown-linux-gnu"
 
 @b = common hidden global i32 0, align 4
 define i32 @f() {
-  %t = load i32, i32* @b, align 4
+  %t = load i32, ptr @b, align 4
   ret i32 %t
 }
 ; CHECK-DAG: @b = internal global i32 0, align 4

diff  --git a/lld/test/ELF/lto/common3.ll b/lld/test/ELF/lto/common3.ll
index 66cf918977947..10bd915234517 100644
--- a/lld/test/ELF/lto/common3.ll
+++ b/lld/test/ELF/lto/common3.ll
@@ -8,7 +8,7 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 target triple = "x86_64-unknown-linux-gnu"
 @a = common hidden global i32 0, align 8
 define i32 @f() {
-  %t = load i32, i32* @a, align 4
+  %t = load i32, ptr @a, align 4
   ret i32 %t
 }
 

diff  --git a/lld/test/ELF/lto/ctors.ll b/lld/test/ELF/lto/ctors.ll
index 0d14725f6f69b..cacf2b076e1fb 100644
--- a/lld/test/ELF/lto/ctors.ll
+++ b/lld/test/ELF/lto/ctors.ll
@@ -6,7 +6,7 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
- at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
+ at llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @ctor, ptr null }]
 define void @ctor() {
   call void asm "nop", ""()
   ret void

diff  --git a/lld/test/ELF/lto/devirt_split_unit_localize.ll b/lld/test/ELF/lto/devirt_split_unit_localize.ll
index d11d659a4caa3..04f30dcd76b46 100644
--- a/lld/test/ELF/lto/devirt_split_unit_localize.ll
+++ b/lld/test/ELF/lto/devirt_split_unit_localize.ll
@@ -23,50 +23,47 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 target triple = "x86_64-unknown-linux-gnu"
 
 %struct.Cat = type { %struct.Animal }
-%struct.Animal = type { i32 (...)** }
+%struct.Animal = type { ptr }
 
 $_ZTS6Animal = comdat any
 
 $_ZTI6Animal = comdat any
 
 @.str = private unnamed_addr constant [5 x i8] c"Meow\00", align 1
- at _ZTV3Cat = dso_local unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI3Cat to i8*), i8* bitcast (void (%struct.Cat*)* @_ZNK3Cat9makeNoiseEv to i8*)] }, align 8, !type !0, !type !1, !type !2, !type !3
- at _ZTVN10__cxxabiv120__si_class_type_infoE = external dso_local global i8*
+ at _ZTV3Cat = dso_local unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI3Cat, ptr @_ZNK3Cat9makeNoiseEv] }, align 8, !type !0, !type !1, !type !2, !type !3
+ at _ZTVN10__cxxabiv120__si_class_type_infoE = external dso_local global ptr
 @_ZTS3Cat = dso_local constant [5 x i8] c"3Cat\00", align 1
- at _ZTVN10__cxxabiv117__class_type_infoE = external dso_local global i8*
+ at _ZTVN10__cxxabiv117__class_type_infoE = external dso_local global ptr
 @_ZTS6Animal = linkonce_odr dso_local constant [8 x i8] c"6Animal\00", comdat, align 1
- at _ZTI6Animal = linkonce_odr dso_local constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @_ZTS6Animal, i32 0, i32 0) }, comdat, align 8
- at _ZTI3Cat = dso_local constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @_ZTS3Cat, i32 0, i32 0), i8* bitcast ({ i8*, i8* }* @_ZTI6Animal to i8*) }, align 8
+ at _ZTI6Animal = linkonce_odr dso_local constant { ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i64 2), ptr @_ZTS6Animal }, comdat, align 8
+ at _ZTI3Cat = dso_local constant { ptr, ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2), ptr @_ZTS3Cat, ptr @_ZTI6Animal }, align 8
 
-define dso_local void @_ZNK3Cat9makeNoiseEv(%struct.Cat* nocapture nonnull readnone dereferenceable(8) %this) unnamed_addr align 2 {
+define dso_local void @_ZNK3Cat9makeNoiseEv(ptr nocapture nonnull readnone dereferenceable(8) %this) unnamed_addr align 2 {
 entry:
-  %call = tail call i32 @puts(i8* nonnull dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
+  %call = tail call i32 @puts(ptr nonnull dereferenceable(1) @.str)
   ret void
 }
 
-declare dso_local noundef i32 @puts(i8* nocapture noundef readonly) local_unnamed_addr
+declare dso_local noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr
 
-define dso_local void @_Z14doThingWithCatP6Animal(%struct.Animal* %a) local_unnamed_addr {
+define dso_local void @_Z14doThingWithCatP6Animal(ptr %a) local_unnamed_addr {
 entry:
-  %tobool.not = icmp eq %struct.Animal* %a, null
+  %tobool.not = icmp eq ptr %a, null
   br i1 %tobool.not, label %if.end, label %if.then
 
 if.then:                                          ; preds = %entry
-  %0 = bitcast %struct.Animal* %a to %struct.Cat*
-  %1 = bitcast %struct.Animal* %a to void (%struct.Cat*)***
-  %vtable = load void (%struct.Cat*)**, void (%struct.Cat*)*** %1, align 8, !tbaa !4
-  %2 = bitcast void (%struct.Cat*)** %vtable to i8*
-  %3 = tail call i1 @llvm.type.test(i8* %2, metadata !"_ZTS3Cat")
-  tail call void @llvm.assume(i1 %3)
-  %4 = load void (%struct.Cat*)*, void (%struct.Cat*)** %vtable, align 8
-  tail call void %4(%struct.Cat* nonnull dereferenceable(8) %0)
+  %vtable = load ptr, ptr %a, align 8, !tbaa !4
+  %0 = tail call i1 @llvm.type.test(ptr %vtable, metadata !"_ZTS3Cat")
+  tail call void @llvm.assume(i1 %0)
+  %1 = load ptr, ptr %vtable, align 8
+  tail call void %1(ptr nonnull dereferenceable(8) %a)
   br label %if.end
 
 if.end:                                           ; preds = %if.then, %entry
   ret void
 }
 
-declare i1 @llvm.type.test(i8*, metadata)
+declare i1 @llvm.type.test(ptr, metadata)
 
 declare void @llvm.assume(i1 noundef)
 
@@ -82,28 +79,26 @@ declare void @llvm.assume(i1 noundef)
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-%struct.Animal = type { i32 (...)** }
+%struct.Animal = type { ptr }
 %struct.Cat = type { %struct.Animal }
 
- at _ZTV3Cat = available_externally dso_local unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast (i8** @_ZTI3Cat to i8*), i8* bitcast (void (%struct.Cat*)* @_ZNK3Cat9makeNoiseEv to i8*)] }, align 8, !type !0, !type !1, !type !2, !type !3
- at _ZTI3Cat = external dso_local constant i8*
- at llvm.compiler.used = appending global [1 x i8*] [i8* bitcast ({ [3 x i8*] }* @_ZTV3Cat to i8*)], section "llvm.metadata"
+ at _ZTV3Cat = available_externally dso_local unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI3Cat, ptr @_ZNK3Cat9makeNoiseEv] }, align 8, !type !0, !type !1, !type !2, !type !3
+ at _ZTI3Cat = external dso_local constant ptr
+ at llvm.compiler.used = appending global [1 x ptr] [ptr @_ZTV3Cat], section "llvm.metadata"
 
-declare dso_local void @_ZNK3Cat9makeNoiseEv(%struct.Cat* nonnull dereferenceable(8)) unnamed_addr
+declare dso_local void @_ZNK3Cat9makeNoiseEv(ptr nonnull dereferenceable(8)) unnamed_addr
 
 define dso_local void @_Z17useDoThingWithCatv() local_unnamed_addr {
 entry:
-  %call = tail call noalias nonnull dereferenceable(8) i8* @_Znwm(i64 8)
-  %0 = bitcast i8* %call to i32 (...)***
-  store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTV3Cat, i64 0, inrange i32 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8, !tbaa !4
-  %1 = bitcast i8* %call to %struct.Animal*
-  tail call void @_Z14doThingWithCatP6Animal(%struct.Animal* nonnull %1)
+  %call = tail call noalias nonnull dereferenceable(8) ptr @_Znwm(i64 8)
+  store ptr getelementptr inbounds ({ [3 x ptr] }, ptr @_ZTV3Cat, i64 0, inrange i32 0, i64 2), ptr %call, align 8, !tbaa !4
+  tail call void @_Z14doThingWithCatP6Animal(ptr nonnull %call)
   ret void
 }
 
-declare dso_local nonnull i8* @_Znwm(i64) local_unnamed_addr
+declare dso_local nonnull ptr @_Znwm(i64) local_unnamed_addr
 
-declare dso_local void @_Z14doThingWithCatP6Animal(%struct.Animal*) local_unnamed_addr
+declare dso_local void @_Z14doThingWithCatP6Animal(ptr) local_unnamed_addr
 
 !0 = !{i64 16, !"_ZTS3Cat"}
 !1 = !{i64 16, !"_ZTSM3CatKFvvE.virtual"}

diff  --git a/lld/test/ELF/lto/devirt_vcall_vis_export_dynamic.ll b/lld/test/ELF/lto/devirt_vcall_vis_export_dynamic.ll
index d3d36ab10e975..7686fa978d4d2 100644
--- a/lld/test/ELF/lto/devirt_vcall_vis_export_dynamic.ll
+++ b/lld/test/ELF/lto/devirt_vcall_vis_export_dynamic.ll
@@ -118,80 +118,73 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-grtev4-linux-gnu"
 
-%struct.A = type { i32 (...)** }
+%struct.A = type { ptr }
 %struct.B = type { %struct.A }
 %struct.C = type { %struct.A }
-%struct.D = type { i32 (...)** }
+%struct.D = type { ptr }
 
- at _ZTV1B = linkonce_odr unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.B*, i32)* @_ZN1B1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !type !1, !vcall_visibility !5
- at _ZTV1C = linkonce_odr unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.C*, i32)* @_ZN1C1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !type !2, !vcall_visibility !5
- at _ZTV1D = linkonce_odr unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.D*, i32)* @_ZN1D1mEi to i8*)] }, !type !3, !vcall_visibility !5
+ at _ZTV1B = linkonce_odr unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1B1fEi, ptr @_ZN1A1nEi] }, !type !0, !type !1, !vcall_visibility !5
+ at _ZTV1C = linkonce_odr unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1C1fEi, ptr @_ZN1A1nEi] }, !type !0, !type !2, !vcall_visibility !5
+ at _ZTV1D = linkonce_odr unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr undef, ptr @_ZN1D1mEi] }, !type !3, !vcall_visibility !5
 
 ;; Prevent the vtables from being dead code eliminated.
- at llvm.used = appending global [3 x i8*] [ i8* bitcast ( { [4 x i8*] }* @_ZTV1B to i8*), i8* bitcast ( { [4 x i8*] }* @_ZTV1C to i8*), i8* bitcast ( { [3 x i8*] }* @_ZTV1D to i8*)]
+ at llvm.used = appending global [3 x ptr] [ ptr @_ZTV1B, ptr @_ZTV1C, ptr @_ZTV1D]
 
 ; CHECK-IR-LABEL: define dso_local i32 @_start
-define i32 @_start(%struct.A* %obj, %struct.D* %obj2, i32 %a) {
+define i32 @_start(ptr %obj, ptr %obj2, i32 %a) {
 entry:
-  %0 = bitcast %struct.A* %obj to i8***
-  %vtable = load i8**, i8*** %0
-  %1 = bitcast i8** %vtable to i8*
-  %p = call i1 @llvm.type.test(i8* %1, metadata !"_ZTS1A")
+  %vtable = load ptr, ptr %obj
+  %p = call i1 @llvm.type.test(ptr %vtable, metadata !"_ZTS1A")
   call void @llvm.assume(i1 %p)
-  %fptrptr = getelementptr i8*, i8** %vtable, i32 1
-  %2 = bitcast i8** %fptrptr to i32 (%struct.A*, i32)**
-  %fptr1 = load i32 (%struct.A*, i32)*, i32 (%struct.A*, i32)** %2, align 8
+  %fptrptr = getelementptr ptr, ptr %vtable, i32 1
+  %fptr1 = load ptr, ptr %fptrptr, align 8
 
   ;; Check that the call was devirtualized.
   ; CHECK-IR: %call = tail call i32 @_ZN1A1nEi
   ; CHECK-AONLY-IR: %call = tail call i32 @_ZN1A1nEi
   ; CHECK-NODEVIRT-IR: %call = tail call i32 %fptr1
-  %call = tail call i32 %fptr1(%struct.A* nonnull %obj, i32 %a)
+  %call = tail call i32 %fptr1(ptr nonnull %obj, i32 %a)
 
-  %3 = bitcast i8** %vtable to i32 (%struct.A*, i32)**
-  %fptr22 = load i32 (%struct.A*, i32)*, i32 (%struct.A*, i32)** %3, align 8
+  %fptr22 = load ptr, ptr %vtable, align 8
 
   ;; We still have to call it as virtual.
   ; CHECK-IR: %call3 = tail call i32 %fptr22
   ; CHECK-AONLY-IR: %call3 = tail call i32 %fptr22
   ; CHECK-NODEVIRT-IR: %call3 = tail call i32 %fptr22
-  %call3 = tail call i32 %fptr22(%struct.A* nonnull %obj, i32 %call)
+  %call3 = tail call i32 %fptr22(ptr nonnull %obj, i32 %call)
 
-  %4 = bitcast %struct.D* %obj2 to i8***
-  %vtable2 = load i8**, i8*** %4
-  %5 = bitcast i8** %vtable2 to i8*
-  %p2 = call i1 @llvm.type.test(i8* %5, metadata !4)
+  %vtable2 = load ptr, ptr %obj2
+  %p2 = call i1 @llvm.type.test(ptr %vtable2, metadata !4)
   call void @llvm.assume(i1 %p2)
 
-  %6 = bitcast i8** %vtable2 to i32 (%struct.D*, i32)**
-  %fptr33 = load i32 (%struct.D*, i32)*, i32 (%struct.D*, i32)** %6, align 8
+  %fptr33 = load ptr, ptr %vtable2, align 8
 
   ;; Check that the call was devirtualized.
   ; CHECK-IR: %call4 = tail call i32 @_ZN1D1mEi
   ; CHECK-AONLY-IR: %call4 = tail call i32 %fptr33
   ; CHECK-NODEVIRT-IR: %call4 = tail call i32 %fptr33
-  %call4 = tail call i32 %fptr33(%struct.D* nonnull %obj2, i32 %call3)
+  %call4 = tail call i32 %fptr33(ptr nonnull %obj2, i32 %call3)
   ret i32 %call4
 }
 ; CHECK-IR-LABEL: ret i32
 ; CHECK-IR-LABEL: }
 
-declare i1 @llvm.type.test(i8*, metadata)
+declare i1 @llvm.type.test(ptr, metadata)
 declare void @llvm.assume(i1)
 
-define i32 @_ZN1B1fEi(%struct.B* %this, i32 %a) #0 {
+define i32 @_ZN1B1fEi(ptr %this, i32 %a) #0 {
    ret i32 0;
 }
 
-define i32 @_ZN1A1nEi(%struct.A* %this, i32 %a) #0 {
+define i32 @_ZN1A1nEi(ptr %this, i32 %a) #0 {
    ret i32 0;
 }
 
-define i32 @_ZN1C1fEi(%struct.C* %this, i32 %a) #0 {
+define i32 @_ZN1C1fEi(ptr %this, i32 %a) #0 {
    ret i32 0;
 }
 
-define i32 @_ZN1D1mEi(%struct.D* %this, i32 %a) #0 {
+define i32 @_ZN1D1mEi(ptr %this, i32 %a) #0 {
    ret i32 0;
 }
 

diff  --git a/lld/test/ELF/lto/devirt_vcall_vis_localize.ll b/lld/test/ELF/lto/devirt_vcall_vis_localize.ll
index e1fd6daf21e80..5d548da9e3b15 100644
--- a/lld/test/ELF/lto/devirt_vcall_vis_localize.ll
+++ b/lld/test/ELF/lto/devirt_vcall_vis_localize.ll
@@ -18,48 +18,45 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-grtev4-linux-gnu"
 
-%struct.A = type { i32 (...)** }
+%struct.A = type { ptr }
 %struct.B = type { %struct.A }
 
- at _ZTV1A = available_externally unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !vcall_visibility !2
- at _ZTV1B = linkonce_odr unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.B*, i32)* @_ZN1B1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !type !1, !vcall_visibility !2
+ at _ZTV1A = available_externally unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1A1fEi, ptr @_ZN1A1nEi] }, !type !0, !vcall_visibility !2
+ at _ZTV1B = linkonce_odr unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1B1fEi, ptr @_ZN1A1nEi] }, !type !0, !type !1, !vcall_visibility !2
 
 ;; Prevent the vtables from being dead code eliminated.
- at llvm.used = appending global [2 x i8*] [ i8* bitcast ( { [4 x i8*] }* @_ZTV1A to i8*), i8* bitcast ( { [4 x i8*] }* @_ZTV1B to i8*)]
+ at llvm.used = appending global [2 x ptr] [ ptr @_ZTV1A, ptr @_ZTV1B]
 
 ; CHECK-IR-LABEL: @_start(
-define i32 @_start(%struct.A* %obj, i32 %a) {
+define i32 @_start(ptr %obj, i32 %a) {
 entry:
-  %0 = bitcast %struct.A* %obj to i8***
-  %vtable = load i8**, i8*** %0
-  %1 = bitcast i8** %vtable to i8*
-  %p = call i1 @llvm.type.test(i8* %1, metadata !"_ZTS1A")
+  %vtable = load ptr, ptr %obj
+  %p = call i1 @llvm.type.test(ptr %vtable, metadata !"_ZTS1A")
   call void @llvm.assume(i1 %p)
-  %fptrptr = getelementptr i8*, i8** %vtable, i32 1
-  %2 = bitcast i8** %fptrptr to i32 (%struct.A*, i32)**
-  %fptr1 = load i32 (%struct.A*, i32)*, i32 (%struct.A*, i32)** %2, align 8
+  %fptrptr = getelementptr ptr, ptr %vtable, i32 1
+  %fptr1 = load ptr, ptr %fptrptr, align 8
 
   ;; Check that the call was devirtualized.
   ; CHECK-IR: %call = tail call i32 @_ZN1A1nEi
-  %call = tail call i32 %fptr1(%struct.A* nonnull %obj, i32 %a)
+  %call = tail call i32 %fptr1(ptr nonnull %obj, i32 %a)
 
   ret i32 %call
 }
 ; CHECK-IR-LABEL: ret i32
 ; CHECK-IR-LABEL: }
 
-declare i1 @llvm.type.test(i8*, metadata)
+declare i1 @llvm.type.test(ptr, metadata)
 declare void @llvm.assume(i1)
 
-define available_externally i32 @_ZN1A1fEi(%struct.A* %this, i32 %a) #0 {
+define available_externally i32 @_ZN1A1fEi(ptr %this, i32 %a) #0 {
    ret i32 0
 }
 
-define available_externally i32 @_ZN1A1nEi(%struct.A* %this, i32 %a) #0 {
+define available_externally i32 @_ZN1A1nEi(ptr %this, i32 %a) #0 {
    ret i32 0
 }
 
-define linkonce_odr i32 @_ZN1B1fEi(%struct.B* %this, i32 %a) #0 {
+define linkonce_odr i32 @_ZN1B1fEi(ptr %this, i32 %a) #0 {
    ret i32 0
 }
 

diff  --git a/lld/test/ELF/lto/devirt_vcall_vis_shared_def.ll b/lld/test/ELF/lto/devirt_vcall_vis_shared_def.ll
index 390606e6c677a..a61e290bb0eb1 100644
--- a/lld/test/ELF/lto/devirt_vcall_vis_shared_def.ll
+++ b/lld/test/ELF/lto/devirt_vcall_vis_shared_def.ll
@@ -48,49 +48,46 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-grtev4-linux-gnu"
 
-%struct.A = type { i32 (...)** }
+%struct.A = type { ptr }
 %struct.B = type { %struct.A }
 
- at _ZTV1A = available_externally unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !vcall_visibility !2
- at _ZTV1B = linkonce_odr unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.B*, i32)* @_ZN1B1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !type !1, !vcall_visibility !2
+ at _ZTV1A = available_externally unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1A1fEi, ptr @_ZN1A1nEi] }, !type !0, !vcall_visibility !2
+ at _ZTV1B = linkonce_odr unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1B1fEi, ptr @_ZN1A1nEi] }, !type !0, !type !1, !vcall_visibility !2
 
 ;; Prevent the vtables from being dead code eliminated.
- at llvm.used = appending global [2 x i8*] [ i8* bitcast ( { [4 x i8*] }* @_ZTV1A to i8*), i8* bitcast ( { [4 x i8*] }* @_ZTV1B to i8*)]
+ at llvm.used = appending global [2 x ptr] [ ptr @_ZTV1A, ptr @_ZTV1B]
 
 ; CHECK-IR-LABEL: define dso_local i32 @_start
-define i32 @_start(%struct.A* %obj, i32 %a) {
+define i32 @_start(ptr %obj, i32 %a) {
 entry:
-  %0 = bitcast %struct.A* %obj to i8***
-  %vtable = load i8**, i8*** %0
-  %1 = bitcast i8** %vtable to i8*
-  %p = call i1 @llvm.type.test(i8* %1, metadata !"_ZTS1A")
+  %vtable = load ptr, ptr %obj
+  %p = call i1 @llvm.type.test(ptr %vtable, metadata !"_ZTS1A")
   call void @llvm.assume(i1 %p)
-  %fptrptr = getelementptr i8*, i8** %vtable, i32 1
-  %2 = bitcast i8** %fptrptr to i32 (%struct.A*, i32)**
-  %fptr1 = load i32 (%struct.A*, i32)*, i32 (%struct.A*, i32)** %2, align 8
+  %fptrptr = getelementptr ptr, ptr %vtable, i32 1
+  %fptr1 = load ptr, ptr %fptrptr, align 8
 
   ;; Check that the call was devirtualized.
   ; CHECK-IR: %call = tail call i32 @_ZN1A1nEi
   ; CHECK-NODEVIRT-IR: %call = tail call i32 %fptr1
-  %call = tail call i32 %fptr1(%struct.A* nonnull %obj, i32 %a)
+  %call = tail call i32 %fptr1(ptr nonnull %obj, i32 %a)
 
   ret i32 %call
 }
 ; CHECK-IR-LABEL: ret i32
 ; CHECK-IR-LABEL: }
 
-declare i1 @llvm.type.test(i8*, metadata)
+declare i1 @llvm.type.test(ptr, metadata)
 declare void @llvm.assume(i1)
 
-define available_externally i32 @_ZN1A1fEi(%struct.A* %this, i32 %a) #0 {
+define available_externally i32 @_ZN1A1fEi(ptr %this, i32 %a) #0 {
    ret i32 0
 }
 
-define available_externally i32 @_ZN1A1nEi(%struct.A* %this, i32 %a) #0 {
+define available_externally i32 @_ZN1A1nEi(ptr %this, i32 %a) #0 {
    ret i32 0
 }
 
-define linkonce_odr i32 @_ZN1B1fEi(%struct.B* %this, i32 %a) #0 {
+define linkonce_odr i32 @_ZN1B1fEi(ptr %this, i32 %a) #0 {
    ret i32 0
 }
 

diff  --git a/lld/test/ELF/lto/discard-value-names.ll b/lld/test/ELF/lto/discard-value-names.ll
index 545c7bda1a9a9..91c6961e7aa22 100644
--- a/lld/test/ELF/lto/discard-value-names.ll
+++ b/lld/test/ELF/lto/discard-value-names.ll
@@ -18,7 +18,7 @@ target triple = "x86_64-unknown-linux-gnu"
 
 define i32 @foo(i32 %in) {
 somelabel:
-  %GV = load i32, i32* @GlobalValueName
+  %GV = load i32, ptr @GlobalValueName
   %add = add i32 %in, %GV
   ret i32 %add
 }

diff  --git a/lld/test/ELF/lto/internalize-exportdyn.ll b/lld/test/ELF/lto/internalize-exportdyn.ll
index 5e0ec78addcbd..a614c1548295c 100644
--- a/lld/test/ELF/lto/internalize-exportdyn.ll
+++ b/lld/test/ELF/lto/internalize-exportdyn.ll
@@ -35,7 +35,7 @@ define linkonce_odr void @baz() {
   ret void
 }
 
- at use_baz = global void ()* @baz
+ at use_baz = global ptr @baz
 
 ; Check what gets internalized.
 ; CHECK: define dso_local void @_start()

diff  --git a/lld/test/ELF/lto/internalize-llvmused.ll b/lld/test/ELF/lto/internalize-llvmused.ll
index 064a8c817b508..5d729deae0b32 100644
--- a/lld/test/ELF/lto/internalize-llvmused.ll
+++ b/lld/test/ELF/lto/internalize-llvmused.ll
@@ -14,7 +14,7 @@ define hidden void @f() {
   ret void
 }
 
- at llvm.used = appending global [1 x i8*] [ i8* bitcast (void ()* @f to i8*)]
+ at llvm.used = appending global [1 x ptr] [ ptr @f]
 
 ; Check that f is not internalized.
 ; CHECK: define hidden void @f()

diff  --git a/lld/test/ELF/lto/libcall-archive.ll b/lld/test/ELF/lto/libcall-archive.ll
index 28c65fe656fa6..bd91d0391dc27 100644
--- a/lld/test/ELF/lto/libcall-archive.ll
+++ b/lld/test/ELF/lto/libcall-archive.ll
@@ -16,10 +16,10 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define void @_start(i8* %a, i8* %b) {
+define void @_start(ptr %a, ptr %b) {
 entry:
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 1024, i1 false)
+  call void @llvm.memcpy.p0.p0.i64(ptr %a, ptr %b, i64 1024, i1 false)
   ret void
 }
 
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1)

diff  --git a/lld/test/ELF/lto/linkage.ll b/lld/test/ELF/lto/linkage.ll
index 89a833900c8b1..11017f0354da3 100644
--- a/lld/test/ELF/lto/linkage.ll
+++ b/lld/test/ELF/lto/linkage.ll
@@ -10,7 +10,7 @@ target triple = "x86_64-unknown-linux-gnu"
 @.str = private unnamed_addr constant [4 x i8] c"Hey\00", align 1
 
 ; Should not encounter a duplicate symbol error for @llvm.global_ctors
- at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
+ at llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @ctor, ptr null }]
 define internal void @ctor() {
   ret void
 }

diff  --git a/lld/test/ELF/lto/linker-script-symbols-assign.ll b/lld/test/ELF/lto/linker-script-symbols-assign.ll
index c66bd1dda0158..f92d819a20d2a 100644
--- a/lld/test/ELF/lto/linker-script-symbols-assign.ll
+++ b/lld/test/ELF/lto/linker-script-symbols-assign.ll
@@ -1,7 +1,7 @@
 ; REQUIRES: x86
 ; RUN: llvm-as %s -o %t.o
 
-; RUN: rm -f %t2.*
+; RUN: rm -f ptr
 ; RUN: echo "foo = 1;" > %t.script
 ; RUN: ld.lld %t.o -o %t2 --script %t.script -save-temps
 ;; Combined module is not empty, but it will be empty after optimization.

diff  --git a/lld/test/ELF/lto/ltopasses-basic.ll b/lld/test/ELF/lto/ltopasses-basic.ll
index bc8328c644b60..a0a39c931d8e0 100644
--- a/lld/test/ELF/lto/ltopasses-basic.ll
+++ b/lld/test/ELF/lto/ltopasses-basic.ll
@@ -6,7 +6,7 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
- at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
+ at llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @ctor, ptr null }]
 define void @ctor() {
   ret void
 }

diff  --git a/lld/test/ELF/lto/ltopasses-extension.ll b/lld/test/ELF/lto/ltopasses-extension.ll
index 179244888a4e4..f597637facfc2 100644
--- a/lld/test/ELF/lto/ltopasses-extension.ll
+++ b/lld/test/ELF/lto/ltopasses-extension.ll
@@ -8,6 +8,6 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 @junk = global i32 0
 
-define i32* @somefunk() {
-  ret i32* @junk
+define ptr @somefunk() {
+  ret ptr @junk
 }

diff  --git a/lld/test/ELF/lto/metadata.ll b/lld/test/ELF/lto/metadata.ll
index c35eecab70fa2..27308dfca2758 100644
--- a/lld/test/ELF/lto/metadata.ll
+++ b/lld/test/ELF/lto/metadata.ll
@@ -5,8 +5,8 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define weak void @foo(i32* %p) {
-  store i32 5, i32* %p, align 4, !tbaa !0
+define weak void @foo(ptr %p) {
+  store i32 5, ptr %p, align 4, !tbaa !0
   ret void
 }
 

diff  --git a/lld/test/ELF/lto/pseudo-probe-lto.ll b/lld/test/ELF/lto/pseudo-probe-lto.ll
index 925566b33e1d9..3840c7c2281c0 100644
--- a/lld/test/ELF/lto/pseudo-probe-lto.ll
+++ b/lld/test/ELF/lto/pseudo-probe-lto.ll
@@ -7,14 +7,14 @@ target triple = "x86_64-scei-ps4"
 
 @g = dso_local global i32 3, align 4
 
-define void @foo(void (i32)* %f) !dbg !4 {
+define void @foo(ptr %f) !dbg !4 {
 entry:
 ; CHECK: .pseudoprobe	[[#GUID:]] 1 0 0
 ; CHECK: .pseudoprobe	[[#GUID]] 2 1 0
   call void %f(i32 1), !dbg !13
-  %0 = load i32, i32* @g, align 4
+  %0 = load i32, ptr @g, align 4
   %inc = add nsw i32 %0, 1
-  store i32 %inc, i32* @g, align 4
+  store i32 %inc, ptr @g, align 4
   ret void
 }
 

diff  --git a/lld/test/ELF/lto/relax-relocs.ll b/lld/test/ELF/lto/relax-relocs.ll
index a375d25331009..6fe2c7fbc3b6f 100644
--- a/lld/test/ELF/lto/relax-relocs.ll
+++ b/lld/test/ELF/lto/relax-relocs.ll
@@ -11,6 +11,6 @@ target triple = "x86_64-unknown-linux-gnu"
 
 @foo = external global i32
 define i32 @bar() {
-  %t = load i32, i32* @foo
+  %t = load i32, ptr @foo
   ret i32 %t
 }

diff  --git a/lld/test/ELF/lto/relocation-model-pic.ll b/lld/test/ELF/lto/relocation-model-pic.ll
index d3242fdb8d668..813ffa76b8d5b 100644
--- a/lld/test/ELF/lto/relocation-model-pic.ll
+++ b/lld/test/ELF/lto/relocation-model-pic.ll
@@ -17,7 +17,7 @@ target triple = "x86_64-unknown-linux-gnu"
 
 @foo = external global i32
 define i32 @main() {
-  %t = load i32, i32* @foo
+  %t = load i32, ptr @foo
   ret i32 %t
 }
 

diff  --git a/lld/test/ELF/lto/relocation-model-static.ll b/lld/test/ELF/lto/relocation-model-static.ll
index 2212b0940ce1b..443c419624cb8 100644
--- a/lld/test/ELF/lto/relocation-model-static.ll
+++ b/lld/test/ELF/lto/relocation-model-static.ll
@@ -14,6 +14,6 @@ target triple = "x86_64-unknown-linux-gnu"
 
 @foo = external dso_local global i32
 define i32 @main() {
-  %t = load i32, i32* @foo
+  %t = load i32, ptr @foo
   ret i32 %t
 }

diff  --git a/lld/test/ELF/lto/section-name.ll b/lld/test/ELF/lto/section-name.ll
index 626c76609e188..a91537d5004b7 100644
--- a/lld/test/ELF/lto/section-name.ll
+++ b/lld/test/ELF/lto/section-name.ll
@@ -15,12 +15,12 @@ target triple = "x86_64-unknown-linux-gnu"
 @__start_foo_section = external global i32
 @__stop_bar_section = external global i32
 
-define hidden i32* @use1() {
-  ret i32* @__start_foo_section
+define hidden ptr @use1() {
+  ret ptr @__start_foo_section
 }
 
-define i32* @use2() {
-  ret i32* @__stop_bar_section
+define ptr @use2() {
+  ret ptr @__stop_bar_section
 }
 
 ; CHECK-NOT: zed_section

diff  --git a/lld/test/ELF/lto/setting-dso-local.ll b/lld/test/ELF/lto/setting-dso-local.ll
index c7e57177710f1..bd6f61404ce3d 100644
--- a/lld/test/ELF/lto/setting-dso-local.ll
+++ b/lld/test/ELF/lto/setting-dso-local.ll
@@ -10,6 +10,6 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 target triple = "x86_64-unknown-linux-gnu"
 
 @foobar = external hidden global i32
-define i32* @_start() {
-  ret i32* @foobar
+define ptr @_start() {
+  ret ptr @foobar
 }

diff  --git a/lld/test/ELF/lto/slp-vectorize-pm.ll b/lld/test/ELF/lto/slp-vectorize-pm.ll
index ca8e4365680a8..488f7b0f3d768 100644
--- a/lld/test/ELF/lto/slp-vectorize-pm.ll
+++ b/lld/test/ELF/lto/slp-vectorize-pm.ll
@@ -26,15 +26,15 @@
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define i32 @foo(i32* %a) {
+define i32 @foo(ptr %a) {
 entry:
   br label %for.body
 
 for.body:
   %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
   %red.05 = phi i32 [ 0, %entry ], [ %add, %for.body ]
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
-  %0 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
+  %0 = load i32, ptr %arrayidx, align 4
   %add = add nsw i32 %0, %red.05
   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
   %exitcond = icmp eq i64 %indvars.iv.next, 255

diff  --git a/lld/test/ELF/lto/tls-preserve.ll b/lld/test/ELF/lto/tls-preserve.ll
index f99a1ae93b055..e154980f511b8 100644
--- a/lld/test/ELF/lto/tls-preserve.ll
+++ b/lld/test/ELF/lto/tls-preserve.ll
@@ -10,7 +10,7 @@ target triple = "x86_64-unknown-linux-gnu"
 @tsp_int = thread_local global i32 1
 
 define void @_start() {
-  %val = load i32, i32* @tsp_int
+  %val = load i32, ptr @tsp_int
   ret void
 }
 

diff  --git a/lld/test/ELF/lto/type-merge.ll b/lld/test/ELF/lto/type-merge.ll
index 97eb6b771e884..d2fea726af138 100644
--- a/lld/test/ELF/lto/type-merge.ll
+++ b/lld/test/ELF/lto/type-merge.ll
@@ -8,10 +8,10 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 target triple = "x86_64-unknown-linux-gnu"
 
 define void @foo()  {
-  call void @bar(i8* null)
+  call void @bar(ptr null)
   ret void
 }
-declare void @bar(i8*)
+declare void @bar(ptr)
 
 ; CHECK:      define void @foo() {
 ; CHECK-NEXT:   call void @bar(ptr null)

diff  --git a/lld/test/ELF/lto/type-merge2.ll b/lld/test/ELF/lto/type-merge2.ll
index 61dc7ff882eee..a255a96cb9205 100644
--- a/lld/test/ELF/lto/type-merge2.ll
+++ b/lld/test/ELF/lto/type-merge2.ll
@@ -9,10 +9,10 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 
 %zed = type { i8 }
 define void @foo()  {
-  call void @bar(%zed* null)
+  call void @bar(ptr null)
   ret void
 }
-declare void @bar(%zed*)
+declare void @bar(ptr)
 
 ; CHECK:      define void @foo() {
 ; CHECK-NEXT:   call void @bar(ptr null)

diff  --git a/lld/test/ELF/lto/undefined-puts.ll b/lld/test/ELF/lto/undefined-puts.ll
index b11d765160235..38e1251e07274 100644
--- a/lld/test/ELF/lto/undefined-puts.ll
+++ b/lld/test/ELF/lto/undefined-puts.ll
@@ -11,11 +11,11 @@ target triple = "x86_64-unknown-linux-gnu"
 @.str = private unnamed_addr constant [6 x i8] c"blah\0A\00", align 1
 
 define i32 @_start() {
-  %str = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0))
+  %str = call i32 (ptr, ...) @printf(ptr @.str)
   ret i32 0
 }
 
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
 
 ; Check that puts symbol is present in the dynamic symbol table and
 ; there's a relocation for it.

diff  --git a/lld/test/ELF/lto/unnamed-addr.ll b/lld/test/ELF/lto/unnamed-addr.ll
index 5dcc7b0cb94d0..ef019e6a2ab32 100644
--- a/lld/test/ELF/lto/unnamed-addr.ll
+++ b/lld/test/ELF/lto/unnamed-addr.ll
@@ -8,8 +8,8 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 
 @a = internal unnamed_addr constant i8 42
 
-define i8* @f() {
-  ret i8* @a
+define ptr @f() {
+  ret ptr @a
 }
 
 ; CHECK: @a = internal unnamed_addr constant i8 42

diff  --git a/lld/test/ELF/lto/weakodr-visibility.ll b/lld/test/ELF/lto/weakodr-visibility.ll
index 9ce98c44e08bf..9cc2923cafce7 100644
--- a/lld/test/ELF/lto/weakodr-visibility.ll
+++ b/lld/test/ELF/lto/weakodr-visibility.ll
@@ -35,6 +35,6 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define weak_odr i32 @foo(i8* %this) {
+define weak_odr i32 @foo(ptr %this) {
   ret i32 41
 }

diff  --git a/lld/test/ELF/lto/wrap-unreferenced-before-codegen.test b/lld/test/ELF/lto/wrap-unreferenced-before-codegen.test
index a24407dcbb588..994f3fbd5de55 100644
--- a/lld/test/ELF/lto/wrap-unreferenced-before-codegen.test
+++ b/lld/test/ELF/lto/wrap-unreferenced-before-codegen.test
@@ -59,13 +59,13 @@ __wrap__Unwind_Resume:
 #--- resume.ll
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
-define dso_local void @_Z1fv() optnone noinline personality i8* bitcast (void ()* @throw to i8*) {
+define dso_local void @_Z1fv() optnone noinline personality ptr @throw {
   invoke void @throw()
           to label %unreachable unwind label %lpad
 lpad:
-  %1 = landingpad { i8*, i32 }
+  %1 = landingpad { ptr, i32 }
           cleanup
-  resume { i8*, i32 } %1
+  resume { ptr, i32 } %1
 unreachable:
   unreachable
 }

diff  --git a/lld/test/MachO/lc-linker-option.ll b/lld/test/MachO/lc-linker-option.ll
index f7060e0131106..51234aec9bb28 100644
--- a/lld/test/MachO/lc-linker-option.ll
+++ b/lld/test/MachO/lc-linker-option.ll
@@ -144,7 +144,7 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 declare void @_CFBigNumGetInt128(...)
 
 define void @main() {
-  call void bitcast (void (...)* @_CFBigNumGetInt128 to void ()*)()
+  call void @_CFBigNumGetInt128()
   ret void
 }
 
@@ -157,11 +157,11 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 !llvm.linker.options = !{!0, !0, !1}
 
 declare void @_CFBigNumGetInt128(...)
-declare i8* @__cxa_allocate_exception(i64)
+declare ptr @__cxa_allocate_exception(i64)
 
 define void @main() {
-  call void bitcast (void (...)* @_CFBigNumGetInt128 to void ()*)()
-  call i8* @__cxa_allocate_exception(i64 4)
+  call void @_CFBigNumGetInt128()
+  call ptr @__cxa_allocate_exception(i64 4)
   ret void
 }
 

diff  --git a/lld/test/MachO/lto-archive.ll b/lld/test/MachO/lto-archive.ll
index 866b2d6a4cfef..252ea4c5fcf3c 100644
--- a/lld/test/MachO/lto-archive.ll
+++ b/lld/test/MachO/lto-archive.ll
@@ -51,12 +51,12 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 @"_OBJC_$_CATEGORY_Foo_$_Bar" = internal global %struct._category_t { i8 123 },
   section "__DATA, __objc_const", align 8
 
-@"OBJC_LABEL_CATEGORY_$" = private global [1 x i8*] [
-  i8* bitcast (%struct._category_t* @"_OBJC_$_CATEGORY_Foo_$_Bar" to i8*)
+@"OBJC_LABEL_CATEGORY_$" = private global [1 x ptr] [
+  ptr @"_OBJC_$_CATEGORY_Foo_$_Bar"
   ], section "__DATA,__objc_catlist,regular,no_dead_strip", align 8
 
- at llvm.compiler.used = appending global [1 x i8*] [
-  i8* bitcast ([1 x i8*]* @"OBJC_LABEL_CATEGORY_$" to i8*)
+ at llvm.compiler.used = appending global [1 x ptr] [
+  ptr @"OBJC_LABEL_CATEGORY_$"
   ], section "llvm.metadata"
 
 ;--- main.s

diff  --git a/lld/test/MachO/lto-codemodel.ll b/lld/test/MachO/lto-codemodel.ll
index e86e3b5440e7d..bd08ff68dea29 100644
--- a/lld/test/MachO/lto-codemodel.ll
+++ b/lld/test/MachO/lto-codemodel.ll
@@ -10,11 +10,11 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 
 @data = internal constant [0 x i32] []
 
-define i32* @main() nounwind readonly {
+define ptr @main() nounwind readonly {
 entry:
 ; CHECK-SMALL-LABEL: <_main>:
 ; CHECK-SMALL:       leaq    [[#]](%rip), %rax
 ; CHECK-LARGE-LABEL: <_main>:
 ; CHECK-LARGE:       movabsq $[[#]], %rax
-  ret i32* getelementptr ([0 x i32], [0 x i32]* @data, i64 0, i64 0)
+  ret ptr @data
 }

diff  --git a/lld/test/MachO/lto-common-symbol-resolution.ll b/lld/test/MachO/lto-common-symbol-resolution.ll
index a74eea6529600..af13c426c1501 100644
--- a/lld/test/MachO/lto-common-symbol-resolution.ll
+++ b/lld/test/MachO/lto-common-symbol-resolution.ll
@@ -106,6 +106,6 @@ target triple = "x86_64-apple-macosx10.15.0"
 @foo = external global i8
 
 define void @f() {
-  %1 = load i8, i8* @foo
+  %1 = load i8, ptr @foo
   ret void
 }

diff  --git a/lld/test/MachO/lto-internalize-unnamed-addr.ll b/lld/test/MachO/lto-internalize-unnamed-addr.ll
index 95b2ceb226a4b..078a152439caf 100644
--- a/lld/test/MachO/lto-internalize-unnamed-addr.ll
+++ b/lld/test/MachO/lto-internalize-unnamed-addr.ll
@@ -95,11 +95,11 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 @local_unnamed_always_const = linkonce_odr local_unnamed_addr constant i8 42
 @local_unnamed_sometimes_const = linkonce_odr local_unnamed_addr constant i8 42
 @local_unnamed = linkonce_odr local_unnamed_addr global i8 42
- at used = hidden constant [6 x i8*] [i8* @global_unnamed,
-  i8* @global_unnamed_sometimes_linkonce, i8* @local_unnamed,
-  i8* @local_unnamed_const, i8* @local_unnamed_always_const,
-  i8* @local_unnamed_sometimes_const]
- at llvm.used = appending global [1 x [6 x i8*]*] [[6 x i8*]* @used]
+ at used = hidden constant [6 x ptr] [ptr @global_unnamed,
+  ptr @global_unnamed_sometimes_linkonce, ptr @local_unnamed,
+  ptr @local_unnamed_const, ptr @local_unnamed_always_const,
+  ptr @local_unnamed_sometimes_const]
+ at llvm.used = appending global [1 x ptr] [ptr @used]
 
 define void @main() {
   ret void

diff  --git a/lld/test/MachO/lto-objc-arc-contract.ll b/lld/test/MachO/lto-objc-arc-contract.ll
index ffa1c00497bdd..5392c897469cd 100644
--- a/lld/test/MachO/lto-objc-arc-contract.ll
+++ b/lld/test/MachO/lto-objc-arc-contract.ll
@@ -18,8 +18,8 @@
 target triple = "x86_64-apple-darwin"
 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 
-define void @foo(i8* %a, i8* %b) {
-  call void (...) @llvm.objc.clang.arc.use(i8* %a, i8* %b) nounwind
+define void @foo(ptr %a, ptr %b) {
+  call void (...) @llvm.objc.clang.arc.use(ptr %a, ptr %b) nounwind
   ret void
 }
 

diff  --git a/lld/test/wasm/Inputs/comdat1.ll b/lld/test/wasm/Inputs/comdat1.ll
index 34f7f161d10cd..72a354d3decb6 100644
--- a/lld/test/wasm/Inputs/comdat1.ll
+++ b/lld/test/wasm/Inputs/comdat1.ll
@@ -5,18 +5,18 @@ $foo = comdat any
 @constantData = constant [3 x i8] c"abc", comdat($foo)
 
 define i32 @comdatFn() comdat($foo) {
-  ret i32 ptrtoint ([3 x i8]* @constantData to i32)
+  ret i32 ptrtoint (ptr @constantData to i32)
 }
 
 define internal void @do_init() comdat($foo) {
   ret void
 }
 
-%0 = type { i32, void ()*, i8* }
- at llvm.global_ctors = appending global [1 x %0 ] [%0 { i32 65535, void ()* @do_init, i8* null }]
+%0 = type { i32, ptr, ptr }
+ at llvm.global_ctors = appending global [1 x %0 ] [%0 { i32 65535, ptr @do_init, ptr null }]
 
 ; Everything above this is part of the `foo` comdat group
 
 define i32 @callComdatFn1() {
-    ret i32 ptrtoint (i32 ()* @comdatFn to i32)
+    ret i32 ptrtoint (ptr @comdatFn to i32)
 }

diff  --git a/lld/test/wasm/Inputs/comdat2.ll b/lld/test/wasm/Inputs/comdat2.ll
index b1478ad7c3210..8c42938258115 100644
--- a/lld/test/wasm/Inputs/comdat2.ll
+++ b/lld/test/wasm/Inputs/comdat2.ll
@@ -5,18 +5,18 @@ $foo = comdat any
 @constantData = constant [3 x i8] c"abc", comdat($foo)
 
 define i32 @comdatFn() comdat($foo) {
-  ret i32 ptrtoint ([3 x i8]* @constantData to i32)
+  ret i32 ptrtoint (ptr @constantData to i32)
 }
 
 define internal void @do_init() comdat($foo) {
   ret void
 }
 
-%0 = type { i32, void ()*, i8* }
- at llvm.global_ctors = appending global [1 x %0] [ %0 { i32 65535, void ()* @do_init, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @constantData, i32 0, i32 0) }]
+%0 = type { i32, ptr, ptr }
+ at llvm.global_ctors = appending global [1 x %0] [ %0 { i32 65535, ptr @do_init, ptr @constantData }]
 
 ; Everything above this is part of the `foo` comdat group
 
 define i32 @callComdatFn2() {
-  ret i32 ptrtoint (i32 ()* @comdatFn to i32)
+  ret i32 ptrtoint (ptr @comdatFn to i32)
 }

diff  --git a/lld/test/wasm/Inputs/debuginfo2.ll b/lld/test/wasm/Inputs/debuginfo2.ll
index a8c62a2bdc5e9..1b63dd57474e5 100644
--- a/lld/test/wasm/Inputs/debuginfo2.ll
+++ b/lld/test/wasm/Inputs/debuginfo2.ll
@@ -21,10 +21,10 @@ define hidden void @foo(i32 %p) local_unnamed_addr #0 !dbg !16 {
 entry:
   call void @llvm.dbg.value(metadata i32 %p, metadata !20, metadata !DIExpression()), !dbg !21
   %and = and i32 %p, 1, !dbg !22
-  %arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* @y, i32 0, i32 %and, !dbg !23
-  %0 = load i32, i32* %arrayidx, align 4, !dbg !24, !tbaa !25
+  %arrayidx = getelementptr inbounds [2 x i32], ptr @y, i32 0, i32 %and, !dbg !23
+  %0 = load i32, ptr %arrayidx, align 4, !dbg !24, !tbaa !25
   %inc = add nsw i32 %0, 1, !dbg !24
-  store i32 %inc, i32* %arrayidx, align 4, !dbg !24, !tbaa !25
+  store i32 %inc, ptr %arrayidx, align 4, !dbg !24, !tbaa !25
   ret void, !dbg !29
 }
 

diff  --git a/lld/test/wasm/Inputs/global-ctor-dtor.ll b/lld/test/wasm/Inputs/global-ctor-dtor.ll
index 5e73f06b0c02b..ef52675f34ed8 100644
--- a/lld/test/wasm/Inputs/global-ctor-dtor.ll
+++ b/lld/test/wasm/Inputs/global-ctor-dtor.ll
@@ -11,14 +11,14 @@ entry:
   ret void
 }
 
- at llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
-  { i32, void ()*, i8* } { i32 2002, void ()* @myctor, i8* null },
-  { i32, void ()*, i8* } { i32 101, void ()* @myctor, i8* null },
-  { i32, void ()*, i8* } { i32 202, void ()* @myctor, i8* null }
+ at llvm.global_ctors = appending global [3 x { i32, ptr, ptr }] [
+  { i32, ptr, ptr } { i32 2002, ptr @myctor, ptr null },
+  { i32, ptr, ptr } { i32 101, ptr @myctor, ptr null },
+  { i32, ptr, ptr } { i32 202, ptr @myctor, ptr null }
 ]
 
- at llvm.global_dtors = appending global [3 x { i32, void ()*, i8* }] [
-  { i32, void ()*, i8* } { i32 2002, void ()* @mydtor, i8* null },
-  { i32, void ()*, i8* } { i32 101, void ()* @mydtor, i8* null },
-  { i32, void ()*, i8* } { i32 202, void ()* @mydtor, i8* null }
+ at llvm.global_dtors = appending global [3 x { i32, ptr, ptr }] [
+  { i32, ptr, ptr } { i32 2002, ptr @mydtor, ptr null },
+  { i32, ptr, ptr } { i32 101, ptr @mydtor, ptr null },
+  { i32, ptr, ptr } { i32 202, ptr @mydtor, ptr null }
 ]

diff  --git a/lld/test/wasm/Inputs/locals-duplicate1.ll b/lld/test/wasm/Inputs/locals-duplicate1.ll
index 3e62d8c5090f3..ca33aff2f8f21 100644
--- a/lld/test/wasm/Inputs/locals-duplicate1.ll
+++ b/lld/test/wasm/Inputs/locals-duplicate1.ll
@@ -24,28 +24,28 @@ entry:
 }
 
 
-define i32* @get_global1A() {
+define ptr @get_global1A() {
 entry:
-  ret i32* @colliding_global1
+  ret ptr @colliding_global1
 }
-define i32* @get_global2A() {
+define ptr @get_global2A() {
 entry:
-  ret i32* @colliding_global2
+  ret ptr @colliding_global2
 }
-define i32* @get_global3A() {
+define ptr @get_global3A() {
 entry:
-  ret i32* @colliding_global3
+  ret ptr @colliding_global3
 }
 
-define i32 ()* @get_func1A() {
+define ptr @get_func1A() {
 entry:
-  ret i32 ()* @colliding_func1
+  ret ptr @colliding_func1
 }
-define i32 ()* @get_func2A() {
+define ptr @get_func2A() {
 entry:
-  ret i32 ()* @colliding_func2
+  ret ptr @colliding_func2
 }
-define i32 ()* @get_func3A() {
+define ptr @get_func3A() {
 entry:
-  ret i32 ()* @colliding_func3
+  ret ptr @colliding_func3
 }

diff  --git a/lld/test/wasm/Inputs/locals-duplicate2.ll b/lld/test/wasm/Inputs/locals-duplicate2.ll
index c6b38f3107a7c..935d8079e1616 100644
--- a/lld/test/wasm/Inputs/locals-duplicate2.ll
+++ b/lld/test/wasm/Inputs/locals-duplicate2.ll
@@ -24,28 +24,28 @@ entry:
 }
 
 
-define i32* @get_global1B() {
+define ptr @get_global1B() {
 entry:
-  ret i32* @colliding_global1
+  ret ptr @colliding_global1
 }
-define i32* @get_global2B() {
+define ptr @get_global2B() {
 entry:
-  ret i32* @colliding_global2
+  ret ptr @colliding_global2
 }
-define i32* @get_global3B() {
+define ptr @get_global3B() {
 entry:
-  ret i32* @colliding_global3
+  ret ptr @colliding_global3
 }
 
-define i32 ()* @get_func1B() {
+define ptr @get_func1B() {
 entry:
-  ret i32 ()* @colliding_func1
+  ret ptr @colliding_func1
 }
-define i32 ()* @get_func2B() {
+define ptr @get_func2B() {
 entry:
-  ret i32 ()* @colliding_func2
+  ret ptr @colliding_func2
 }
-define i32 ()* @get_func3B() {
+define ptr @get_func3B() {
 entry:
-  ret i32 ()* @colliding_func3
+  ret ptr @colliding_func3
 }

diff  --git a/lld/test/wasm/Inputs/many-funcs.ll b/lld/test/wasm/Inputs/many-funcs.ll
index 1829d7d6b4887..55a4d6fd541f8 100644
--- a/lld/test/wasm/Inputs/many-funcs.ll
+++ b/lld/test/wasm/Inputs/many-funcs.ll
@@ -5,774 +5,774 @@ target triple = "wasm32-unknown-unknown"
 
 define i32 @f1() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f2() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f3() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f4() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f5() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f6() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f7() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f8() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f9() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f10() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f11() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f12() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f13() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f14() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f15() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f16() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f17() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f18() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f19() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f20() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f21() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f22() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f23() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f24() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f25() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f26() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f27() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f28() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f29() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f30() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f31() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f32() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f33() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f34() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f35() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f36() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f37() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f38() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f39() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f40() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f41() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f42() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f43() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f44() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f45() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f46() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f47() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f48() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f49() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f50() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f51() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f52() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f53() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f54() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f55() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f56() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f57() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f58() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f59() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f60() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f61() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f62() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f63() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f64() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f65() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f66() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f67() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f68() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f69() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f70() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f71() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f72() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f73() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f74() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f75() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f76() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f77() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f78() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f79() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f80() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f81() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f82() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f83() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f84() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f85() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f86() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f87() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f88() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f89() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f90() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f91() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f92() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f93() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f94() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f95() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f96() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f97() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f98() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f99() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f100() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f101() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f102() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f103() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f104() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f105() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f106() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f107() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f108() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f109() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f110() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f111() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f112() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f113() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f114() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f115() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f116() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f117() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f118() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f119() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f120() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f121() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f122() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f123() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f124() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f125() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f126() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f127() {
 entry:
-  %0 = load i32, i32* @foo, align 4
+  %0 = load i32, ptr @foo, align 4
   ret i32 %0
 }
 
 define i32 @f128() {
 entry:
-  %0 = load i32, i32* @g0, align 4
+  %0 = load i32, ptr @g0, align 4
   ret i32 %0
 }
 
 define i32 @f129() {
 entry:
-  %0 = load i32, i32* @g0, align 4
+  %0 = load i32, ptr @g0, align 4
   ret i32 %0
 }

diff  --git a/lld/test/wasm/Inputs/tag-section1.ll b/lld/test/wasm/Inputs/tag-section1.ll
index 253fc4a4480bf..2a417b8b9de85 100644
--- a/lld/test/wasm/Inputs/tag-section1.ll
+++ b/lld/test/wasm/Inputs/tag-section1.ll
@@ -1,9 +1,9 @@
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-emscripten"
 
-declare void @llvm.wasm.throw(i32, i8*)
+declare void @llvm.wasm.throw(i32, ptr)
 
-define void @foo(i8* %p) {
-  call void @llvm.wasm.throw(i32 0, i8* %p)
+define void @foo(ptr %p) {
+  call void @llvm.wasm.throw(i32 0, ptr %p)
   ret void
 }

diff  --git a/lld/test/wasm/Inputs/tag-section2.ll b/lld/test/wasm/Inputs/tag-section2.ll
index 6b82c858bcc85..4206a74af053a 100644
--- a/lld/test/wasm/Inputs/tag-section2.ll
+++ b/lld/test/wasm/Inputs/tag-section2.ll
@@ -1,9 +1,9 @@
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-emscripten"
 
-declare void @llvm.wasm.throw(i32, i8*)
+declare void @llvm.wasm.throw(i32, ptr)
 
-define void @bar(i8* %p) {
-  call void @llvm.wasm.throw(i32 0, i8* %p)
+define void @bar(ptr %p) {
+  call void @llvm.wasm.throw(i32 0, ptr %p)
   ret void
 }

diff  --git a/lld/test/wasm/Inputs/weak-alias.ll b/lld/test/wasm/Inputs/weak-alias.ll
index 1840ffd1fc540..451f09802c439 100644
--- a/lld/test/wasm/Inputs/weak-alias.ll
+++ b/lld/test/wasm/Inputs/weak-alias.ll
@@ -6,7 +6,7 @@ entry:
   ret i32 0
 }
 
- at alias_fn = weak alias i32 (), i32 ()* @direct_fn
+ at alias_fn = weak alias i32 (), ptr @direct_fn
 
 define i32 @call_direct() #0 {
 entry:
@@ -22,18 +22,18 @@ entry:
 
 define i32 @call_alias_ptr() #0 {
 entry:
-   %fnptr = alloca i32 ()*, align 8
-   store i32 ()* @alias_fn, i32 ()** %fnptr, align 8
-   %0 = load i32 ()*, i32 ()** %fnptr, align 8
+   %fnptr = alloca ptr, align 8
+   store ptr @alias_fn, ptr %fnptr, align 8
+   %0 = load ptr, ptr %fnptr, align 8
    %call = call i32 %0()
    ret i32 %call
 }
 
 define i32 @call_direct_ptr() #0 {
 entry:
-  %fnptr = alloca i32 ()*, align 8
-  store i32 ()* @direct_fn, i32 ()** %fnptr, align 8
-  %0 = load i32 ()*, i32 ()** %fnptr, align 8
+  %fnptr = alloca ptr, align 8
+  store ptr @direct_fn, ptr %fnptr, align 8
+  %0 = load ptr, ptr %fnptr, align 8
   %call = call i32 %0()
   ret i32 %call
 }

diff  --git a/lld/test/wasm/gc-sections.ll b/lld/test/wasm/gc-sections.ll
index 762933d0ef44b..e709ab7ba2c3d 100644
--- a/lld/test/wasm/gc-sections.ll
+++ b/lld/test/wasm/gc-sections.ll
@@ -15,12 +15,12 @@ target triple = "wasm32-unknown-unknown"
 @used_data = hidden global i32 2, align 4
 
 define hidden i64 @unused_function(i64 %arg) {
-  %1 = load i64, i64* @unused_data, align 4
+  %1 = load i64, ptr @unused_data, align 4
   ret i64 %1
 }
 
 define hidden i32 @used_function() {
-  %1 = load i32, i32* @used_data, align 4
+  %1 = load i32, ptr @used_data, align 4
   ret i32 %1
 }
 

diff  --git a/lld/test/wasm/init-fini-no-gc.ll b/lld/test/wasm/init-fini-no-gc.ll
index 62415686847e6..0a22ebfb1454c 100644
--- a/lld/test/wasm/init-fini-no-gc.ll
+++ b/lld/test/wasm/init-fini-no-gc.ll
@@ -28,12 +28,12 @@ define hidden i32 @__cxa_atexit(i32 %func, i32 %arg, i32 %dso_handle) {
   ret i32 0
 }
 
- at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [
-  { i32, void ()*, i8* } { i32 1, void ()* @func1, i8* null }
+ at llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [
+  { i32, ptr, ptr } { i32 1, ptr @func1, ptr null }
 ]
 
- at llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [
-  { i32, void ()*, i8* } { i32 1, void ()* @func2, i8* null }
+ at llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [
+  { i32, ptr, ptr } { i32 1, ptr @func2, ptr null }
 ]
 
 ; Check that we have exactly the needed exports: `memory` because that's

diff  --git a/lld/test/wasm/init-fini.ll b/lld/test/wasm/init-fini.ll
index 15154f36d3d3b..14385f042efb7 100644
--- a/lld/test/wasm/init-fini.ll
+++ b/lld/test/wasm/init-fini.ll
@@ -37,18 +37,18 @@ entry:
   ret void
 }
 
- at llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
-  { i32, void ()*, i8* } { i32 1001, void ()* @func1, i8* null },
-  { i32, void ()*, i8* } { i32 101, void ()* @func1, i8* null },
-  { i32, void ()*, i8* } { i32 101, void ()* @func2, i8* null },
-  { i32, void ()*, i8* } { i32 4000, void ()* @externCtor, i8* null }
+ at llvm.global_ctors = appending global [4 x { i32, ptr, ptr }] [
+  { i32, ptr, ptr } { i32 1001, ptr @func1, ptr null },
+  { i32, ptr, ptr } { i32 101, ptr @func1, ptr null },
+  { i32, ptr, ptr } { i32 101, ptr @func2, ptr null },
+  { i32, ptr, ptr } { i32 4000, ptr @externCtor, ptr null }
 ]
 
- at llvm.global_dtors = appending global [4 x { i32, void ()*, i8* }] [
-  { i32, void ()*, i8* } { i32 1001, void ()* @func3, i8* null },
-  { i32, void ()*, i8* } { i32 101, void ()* @func3, i8* null },
-  { i32, void ()*, i8* } { i32 101, void ()* @func4, i8* null },
-  { i32, void ()*, i8* } { i32 4000, void ()* @externDtor, i8* null }
+ at llvm.global_dtors = appending global [4 x { i32, ptr, ptr }] [
+  { i32, ptr, ptr } { i32 1001, ptr @func3, ptr null },
+  { i32, ptr, ptr } { i32 101, ptr @func3, ptr null },
+  { i32, ptr, ptr } { i32 101, ptr @func4, ptr null },
+  { i32, ptr, ptr } { i32 4000, ptr @externDtor, ptr null }
 ]
 
 ; RUN: wasm-ld --allow-undefined %t.o %t.global-ctor-dtor.o -o %t.wasm

diff  --git a/lld/test/wasm/local-symbols.ll b/lld/test/wasm/local-symbols.ll
index 93ed3c9d4eee7..8faee647c44c8 100644
--- a/lld/test/wasm/local-symbols.ll
+++ b/lld/test/wasm/local-symbols.ll
@@ -10,7 +10,7 @@ target triple = "wasm32-unknown-unknown"
 
 define internal i32 @baz() local_unnamed_addr {
 entry:
-  %0 = load i32, i32* @bar, align 4
+  %0 = load i32, ptr @bar, align 4
   ret i32 %0
 }
 

diff  --git a/lld/test/wasm/lto/Inputs/thin1.ll b/lld/test/wasm/lto/Inputs/thin1.ll
index d68a3f6bce84f..04fa091ad2887 100644
--- a/lld/test/wasm/lto/Inputs/thin1.ll
+++ b/lld/test/wasm/lto/Inputs/thin1.ll
@@ -6,9 +6,9 @@ target triple = "wasm32-unknown-unknown"
 define i32 @foo(i32 %goo) {
 entry:
   %goo.addr = alloca i32, align 4
-  store i32 %goo, i32* %goo.addr, align 4
-  %0 = load i32, i32* %goo.addr, align 4
-  %1 = load i32, i32* %goo.addr, align 4
+  store i32 %goo, ptr %goo.addr, align 4
+  %0 = load i32, ptr %goo.addr, align 4
+  %1 = load i32, ptr %goo.addr, align 4
   %mul = mul nsw i32 %0, %1
   ret i32 %mul
 }

diff  --git a/lld/test/wasm/lto/Inputs/thin2.ll b/lld/test/wasm/lto/Inputs/thin2.ll
index a8db5d6cd41ce..236781aed3de2 100644
--- a/lld/test/wasm/lto/Inputs/thin2.ll
+++ b/lld/test/wasm/lto/Inputs/thin2.ll
@@ -6,8 +6,8 @@ target triple = "wasm32-unknown-unknown"
 define i32 @blah(i32 %meh) #0 {
 entry:
   %meh.addr = alloca i32, align 4
-  store i32 %meh, i32* %meh.addr, align 4
-  %0 = load i32, i32* %meh.addr, align 4
+  store i32 %meh, ptr %meh.addr, align 4
+  %0 = load i32, ptr %meh.addr, align 4
   %sub = sub nsw i32 %0, 48
   ret i32 %sub
 }

diff  --git a/lld/test/wasm/lto/atomics.ll b/lld/test/wasm/lto/atomics.ll
index 7e367157675cd..9378519e09992 100644
--- a/lld/test/wasm/lto/atomics.ll
+++ b/lld/test/wasm/lto/atomics.ll
@@ -10,6 +10,6 @@ target triple = "wasm32-unknown-unknown-wasm"
 @foo = hidden global i32 1
 
 define void @_start() {
-  %1 = load atomic i32, i32* @foo unordered, align 4
+  %1 = load atomic i32, ptr @foo unordered, align 4
   ret void
 }

diff  --git a/lld/test/wasm/lto/diagnostics.ll b/lld/test/wasm/lto/diagnostics.ll
index 2d170ee3ba866..2f1daa99d848c 100644
--- a/lld/test/wasm/lto/diagnostics.ll
+++ b/lld/test/wasm/lto/diagnostics.ll
@@ -8,15 +8,15 @@ target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-unknown"
 
 define void @_start() {
-  call i8* @foo()
+  call ptr @foo()
   ret void
 }
 
-define i8* @foo() {
-  %1 = call i8* @llvm.returnaddress(i32 0)
-  ret i8* %1
+define ptr @foo() {
+  %1 = call ptr @llvm.returnaddress(i32 0)
+  ret ptr %1
 }
 
-declare i8* @llvm.returnaddress(i32)
+declare ptr @llvm.returnaddress(i32)
 
 ; CHECK: error: {{.*}} WebAssembly hasn't implemented __builtin_return_address

diff  --git a/lld/test/wasm/lto/libcall-archive.ll b/lld/test/wasm/lto/libcall-archive.ll
index 8623e878f97d6..365ce180f1441 100644
--- a/lld/test/wasm/lto/libcall-archive.ll
+++ b/lld/test/wasm/lto/libcall-archive.ll
@@ -8,13 +8,13 @@
 target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-unknown"
 
-define void @_start(i8* %a, i8* %b) {
+define void @_start(ptr %a, ptr %b) {
 entry:
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 1024, i1 false)
+  call void @llvm.memcpy.p0.p0.i64(ptr %a, ptr %b, i64 1024, i1 false)
   ret void
 }
 
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1)
 
 ; CHECK:       - Type:            CUSTOM
 ; CHECK-NEXT:    Name:            name

diff  --git a/lld/test/wasm/lto/libcall-truncsfhf2.ll b/lld/test/wasm/lto/libcall-truncsfhf2.ll
index a3a461c83de7b..1eea2b28b6db1 100644
--- a/lld/test/wasm/lto/libcall-truncsfhf2.ll
+++ b/lld/test/wasm/lto/libcall-truncsfhf2.ll
@@ -11,9 +11,9 @@ target triple = "wasm32-unknown-unknown"
 @g_half = global half 0.0
 
 define void @_start() {
-  %val1 = load float, float* @g_float
+  %val1 = load float, ptr @g_float
   %v0 = fptrunc float %val1 to half
-  store half %v0, half* @g_half
+  store half %v0, ptr @g_half
   ret void
 }
 

diff  --git a/lld/test/wasm/lto/relocatable-undefined.ll b/lld/test/wasm/lto/relocatable-undefined.ll
index 8aa175b61cfd8..e8145cf39810b 100644
--- a/lld/test/wasm/lto/relocatable-undefined.ll
+++ b/lld/test/wasm/lto/relocatable-undefined.ll
@@ -11,7 +11,7 @@ declare i32 @missing_func() local_unnamed_addr
 define i32 @foo() {
 entry:
   %0 = call i32 @missing_func()
-  %1 = load i32, i32* @missing_data, align 4
+  %1 = load i32, ptr @missing_data, align 4
   ret i32 %1
 }
 

diff  --git a/lld/test/wasm/lto/tls.ll b/lld/test/wasm/lto/tls.ll
index 06c11067217b7..b61edfba6146f 100644
--- a/lld/test/wasm/lto/tls.ll
+++ b/lld/test/wasm/lto/tls.ll
@@ -13,7 +13,7 @@ target triple = "wasm32-unknown-emscripten"
 @tls_int = dso_local thread_local global i32 99
 
 define i32 @get_tls() #0 {
-  %val = load i32, i32* @tls_int
+  %val = load i32, ptr @tls_int
   ret i32 %val
 }
 

diff  --git a/lld/test/wasm/lto/undef.ll b/lld/test/wasm/lto/undef.ll
index 6b6c046e9587f..cb9e7fc39e935 100644
--- a/lld/test/wasm/lto/undef.ll
+++ b/lld/test/wasm/lto/undef.ll
@@ -11,14 +11,14 @@ declare i32 @bar()
 ; 
diff erently with respect to signature checking.
 declare i32 @foo()
 
- at ptr = global i8* bitcast (i32 ()* @foo to i8*), align 8
+ at ptr = global ptr @foo, align 8
 ; Ensure access to ptr is not inlined below, even under LTO
- at llvm.used = appending global [1 x i8**] [i8** @ptr], section "llvm.metadata"
+ at llvm.used = appending global [1 x ptr] [ptr @ptr], section "llvm.metadata"
 
 define void @_start() {
   call i32 @bar()
 
-  %addr = load i32 ()*, i32 ()** bitcast (i8** @ptr to i32 ()**), align 8
+  %addr = load ptr, ptr @ptr, align 8
   call i32 %addr()
 
   ret void

diff  --git a/lld/test/wasm/lto/used.ll b/lld/test/wasm/lto/used.ll
index 324edbf01f522..414e72d6b9a49 100644
--- a/lld/test/wasm/lto/used.ll
+++ b/lld/test/wasm/lto/used.ll
@@ -13,7 +13,7 @@ declare void @bar()
 @foo = external global i32
 
 define void @_start() {
-  %val = load i32, i32* @foo, align 4
+  %val = load i32, ptr @foo, align 4
   %tobool = icmp ne i32 %val, 0
   br i1 %tobool, label %callbar, label %return
 

diff  --git a/lld/test/wasm/pic-static.ll b/lld/test/wasm/pic-static.ll
index d9fe0eacc98b9..794b7218880b8 100644
--- a/lld/test/wasm/pic-static.ll
+++ b/lld/test/wasm/pic-static.ll
@@ -14,22 +14,22 @@ declare i32 @missing_function(float)
 @hidden_float = hidden global float 2.0
 @missing_float = extern_weak global float
 
- at ret32_ptr = global i32 (float)* @ret32, align 4
+ at ret32_ptr = global ptr @ret32, align 4
 
-define i32 (float)* @getaddr_external() {
-  ret i32 (float)* @ret32;
+define ptr @getaddr_external() {
+  ret ptr @ret32;
 }
 
-define i32 (float)* @getaddr_missing_function() {
-  ret i32 (float)* @missing_function;
+define ptr @getaddr_missing_function() {
+  ret ptr @missing_function;
 }
 
-define i32 ()* @getaddr_hidden() {
-  ret i32 ()* @hidden_func;
+define ptr @getaddr_hidden() {
+  ret ptr @hidden_func;
 }
 
-define float* @getaddr_missing_float() {
-  ret float* @missing_float
+define ptr @getaddr_missing_float() {
+  ret ptr @missing_float
 }
 
 define hidden i32 @hidden_func() {
@@ -38,16 +38,16 @@ define hidden i32 @hidden_func() {
 
 define void @_start() {
 entry:
-  %f = load float, float* @hidden_float, align 4
-  %addr = load i32 (float)*, i32 (float)** @ret32_ptr, align 4
-  %arg = load float, float* @global_float, align 4
+  %f = load float, ptr @hidden_float, align 4
+  %addr = load ptr, ptr @ret32_ptr, align 4
+  %arg = load float, ptr @global_float, align 4
   call i32 %addr(float %arg)
 
-  %addr2 = call i32 (float)* @getaddr_external()
-  %arg2 = load float, float* @hidden_float, align 4
+  %addr2 = call ptr @getaddr_external()
+  %arg2 = load float, ptr @hidden_float, align 4
   call i32 %addr2(float %arg2)
 
-  %addr3 = call i32 ()* @getaddr_hidden()
+  %addr3 = call ptr @getaddr_hidden()
   call i32 %addr3()
 
   ret void

diff  --git a/lld/test/wasm/pie.ll b/lld/test/wasm/pie.ll
index 467cb5d5fc2e2..141378cd6dea3 100644
--- a/lld/test/wasm/pie.ll
+++ b/lld/test/wasm/pie.ll
@@ -7,24 +7,24 @@ target triple = "wasm32-unknown-emscripten"
 
 @data = global i32 2, align 4
 @data_external = external global i32
- at indirect_func = local_unnamed_addr global i32 ()* @foo, align 4
+ at indirect_func = local_unnamed_addr global ptr @foo, align 4
 
- at data_addr = local_unnamed_addr global i32* @data, align 4
- at data_addr_external = local_unnamed_addr global i32* @data_external, align 4
+ at data_addr = local_unnamed_addr global ptr @data, align 4
+ at data_addr_external = local_unnamed_addr global ptr @data_external, align 4
 
 define hidden i32 @foo() {
 entry:
   ; To ensure we use __stack_pointer
   %ptr = alloca i32
-  %0 = load i32, i32* @data, align 4
-  %1 = load i32 ()*, i32 ()** @indirect_func, align 4
+  %0 = load i32, ptr @data, align 4
+  %1 = load ptr, ptr @indirect_func, align 4
   call i32 %1()
   ret i32 %0
 }
 
-define default i32** @get_data_address() {
+define default ptr @get_data_address() {
 entry:
-  ret i32** @data_addr_external
+  ret ptr @data_addr_external
 }
 
 define void @_start() {

diff  --git a/lld/test/wasm/relocatable.ll b/lld/test/wasm/relocatable.ll
index c71a9c2f9c612..e0702012fff61 100644
--- a/lld/test/wasm/relocatable.ll
+++ b/lld/test/wasm/relocatable.ll
@@ -20,20 +20,20 @@ declare i32 @foo_import() local_unnamed_addr
 declare extern_weak i32 @bar_import() local_unnamed_addr
 @data_import = external global i64
 
- at func_addr1 = hidden global i32()* @my_func, align 4
- at func_addr2 = hidden global i32()* @foo_import, align 4
- at func_addr3 = hidden global i32()* @bar_import, align 4
- at data_addr1 = hidden global i64* @data_import, align 8
+ at func_addr1 = hidden global ptr @my_func, align 4
+ at func_addr2 = hidden global ptr @foo_import, align 4
+ at func_addr3 = hidden global ptr @bar_import, align 4
+ at data_addr1 = hidden global ptr @data_import, align 8
 
 $func_comdat = comdat any
 @data_comdat = weak_odr constant [3 x i8] c"abc", comdat($func_comdat)
 define linkonce_odr i32 @func_comdat() comdat {
 entry:
-  ret i32 ptrtoint ([3 x i8]* @data_comdat to i32)
+  ret i32 ptrtoint (ptr @data_comdat to i32)
 }
 
 ; Test that __attribute__(used) (i.e NO_STRIP) is preserved in the relocated symbol table
- at llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @my_func to i8*)], section "llvm.metadata"
+ at llvm.used = appending global [1 x ptr] [ptr @my_func], section "llvm.metadata"
 
 define void @_start() {
   ret void

diff  --git a/lld/test/wasm/shared.s b/lld/test/wasm/shared.s
index e53af32ee546f..a26f00163fea7 100644
--- a/lld/test/wasm/shared.s
+++ b/lld/test/wasm/shared.s
@@ -52,8 +52,8 @@ extern_struct_internal_ptr:
 .section .text,"",@
 foo:
   # %ptr = alloca i32
-  # %0 = load i32, i32* @data, align 4
-  # %1 = load i32 ()*, i32 ()** @indirect_func, align 4
+  # %0 = load i32, ptr @data, align 4
+  # %1 = load ptr, ptr @indirect_func, align 4
   # call i32 %1()
   # ret i32 %0
   .functype foo () -> (i32)

diff  --git a/lld/test/wasm/shared64.s b/lld/test/wasm/shared64.s
index 9847aa72fe7eb..3401faed8610c 100644
--- a/lld/test/wasm/shared64.s
+++ b/lld/test/wasm/shared64.s
@@ -52,8 +52,8 @@ extern_struct_internal_ptr:
 .section .text,"",@
 foo:
   # %ptr = alloca i32
-  # %0 = load i32, i32* @data, align 4
-  # %1 = load i32 ()*, i32 ()** @indirect_func, align 4
+  # %0 = load i32, ptr @data, align 4
+  # %1 = load ptr, ptr @indirect_func, align 4
   # call i32 %1()
   # ret i32 %0
   .functype foo () -> (i32)

diff  --git a/lld/test/wasm/signature-mismatch-unknown.ll b/lld/test/wasm/signature-mismatch-unknown.ll
index c78bff556eeec..d882e7f979344 100644
--- a/lld/test/wasm/signature-mismatch-unknown.ll
+++ b/lld/test/wasm/signature-mismatch-unknown.ll
@@ -18,10 +18,10 @@ declare dso_local void @ret32()
 
 ; Simply taking the address of the function should *not* generate the
 ; the signature mismatch warning.
- at ptr = dso_local global i8* bitcast (void ()* @ret32 to i8*), align 8
+ at ptr = dso_local global ptr @ret32, align 8
 
 define hidden void @_start() local_unnamed_addr {
-  %addr = load i32 ()*, i32 ()** bitcast (i8** @ptr to i32 ()**), align 8
+  %addr = load ptr, ptr @ptr, align 8
   call i32 %addr()
   ret void
 }

diff  --git a/lld/test/wasm/startstop.ll b/lld/test/wasm/startstop.ll
index 364d06ed08eb9..4341d371f8e65 100644
--- a/lld/test/wasm/startstop.ll
+++ b/lld/test/wasm/startstop.ll
@@ -9,15 +9,15 @@ target triple = "wasm32-unknown-unknown"
 @foo = global i32 3, section "mysection", align 4
 @bar = global i32 4, section "mysection", align 4
 
- at __start_mysection = external global i8*
- at __stop_mysection = external global i8*
+ at __start_mysection = external global ptr
+ at __stop_mysection = external global ptr
 
-define i8** @get_start() {
-  ret i8** @__start_mysection
+define ptr @get_start() {
+  ret ptr @__start_mysection
 }
 
-define i8** @get_end() {
-  ret i8** @__stop_mysection
+define ptr @get_end() {
+  ret ptr @__stop_mysection
 }
 
 define void @_start()  {

diff  --git a/lld/test/wasm/tag-section.ll b/lld/test/wasm/tag-section.ll
index 4f55f881aedc2..4decdb58f952a 100644
--- a/lld/test/wasm/tag-section.ll
+++ b/lld/test/wasm/tag-section.ll
@@ -17,12 +17,12 @@
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-emscripten"
 
-declare void @foo(i8*)
-declare void @bar(i8*)
+declare void @foo(ptr)
+declare void @bar(ptr)
 
 define void @_start() {
-  call void @foo(i8* null)
-  call void @bar(i8* null)
+  call void @foo(ptr null)
+  call void @bar(ptr null)
   ret void
 }
 

diff  --git a/lld/test/wasm/undefined.ll b/lld/test/wasm/undefined.ll
index 90f92f2bc1356..0ad93b78531ca 100644
--- a/lld/test/wasm/undefined.ll
+++ b/lld/test/wasm/undefined.ll
@@ -16,8 +16,8 @@
 target triple = "wasm32-unknown-unknown"
 
 ; Takes the address of the external foo() resulting in undefined external
- at bar = global i8* bitcast (i32 ()* @foo to i8*), align 4
- at llvm.used = appending global [1 x i8**] [i8** @bar], section "llvm.metadata"
+ at bar = global ptr @foo, align 4
+ at llvm.used = appending global [1 x ptr] [ptr @bar], section "llvm.metadata"
 
 declare i32 @foo() #0
 


        


More information about the llvm-commits mailing list