[llvm] 270f63b - MC: Convert tests to opaque pointers

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


Author: Fangrui Song
Date: 2022-11-27T20:10:29-08:00
New Revision: 270f63b84a612dfa438df3d59903bb76fa0c7740

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

LOG: MC: Convert tests to opaque pointers

Added: 
    

Modified: 
    llvm/test/MC/AArch64/coff-debug.ll
    llvm/test/MC/AArch64/elf-globaladdress.ll
    llvm/test/MC/AArch64/ir-to-imgrel.ll
    llvm/test/MC/ARM/cxx-global-constructor.ll
    llvm/test/MC/ARM/data-in-code.ll
    llvm/test/MC/AsmParser/pr28805.ll
    llvm/test/MC/COFF/cgprofile.ll
    llvm/test/MC/COFF/const-gv-with-rel-init.ll
    llvm/test/MC/COFF/cross-section-relative.ll
    llvm/test/MC/COFF/global_ctors_dtors.ll
    llvm/test/MC/COFF/ir-to-imgrel.ll
    llvm/test/MC/COFF/tricky-names.ll
    llvm/test/MC/ELF/bss.ll
    llvm/test/MC/ELF/cfi-version.ll
    llvm/test/MC/ELF/cgprofile.ll
    llvm/test/MC/ELF/entsize.ll
    llvm/test/MC/ELF/section-relro.ll
    llvm/test/MC/Hexagon/extended_relocations.ll
    llvm/test/MC/MachO/AArch64/cstexpr-gotpcrel.ll
    llvm/test/MC/MachO/ARM/cstexpr-gotpcrel.ll
    llvm/test/MC/MachO/ARM/no-tls-assert.ll
    llvm/test/MC/MachO/cgprofile.ll
    llvm/test/MC/MachO/cstexpr-gotpcrel-32.ll
    llvm/test/MC/MachO/cstexpr-gotpcrel-64.ll
    llvm/test/MC/MachO/tlv-bss.ll
    llvm/test/MC/Mips/elf-bigendian.ll
    llvm/test/MC/Mips/sym-offset.ll
    llvm/test/MC/WebAssembly/blockaddress.ll
    llvm/test/MC/WebAssembly/bss.ll
    llvm/test/MC/WebAssembly/data-symbol-in-text-section.ll
    llvm/test/MC/WebAssembly/debug-byval-struct.ll
    llvm/test/MC/WebAssembly/debug-info.ll
    llvm/test/MC/WebAssembly/debug-info64.ll
    llvm/test/MC/WebAssembly/debug-localvar.ll
    llvm/test/MC/WebAssembly/debug-template-param.ll
    llvm/test/MC/WebAssembly/dwarfdump.ll
    llvm/test/MC/WebAssembly/dwarfdump64.ll
    llvm/test/MC/WebAssembly/extern-functype-intrinsic.ll
    llvm/test/MC/WebAssembly/external-data.ll
    llvm/test/MC/WebAssembly/external-func-address.ll
    llvm/test/MC/WebAssembly/func-address.ll
    llvm/test/MC/WebAssembly/function-alias.ll
    llvm/test/MC/WebAssembly/global-ctor-dtor.ll
    llvm/test/MC/WebAssembly/libcall.ll
    llvm/test/MC/WebAssembly/no-dead-strip.ll
    llvm/test/MC/WebAssembly/offset.ll
    llvm/test/MC/WebAssembly/reloc-data.ll
    llvm/test/MC/WebAssembly/reloc-relative.ll
    llvm/test/MC/WebAssembly/tag-section-decoding.ll
    llvm/test/MC/WebAssembly/tag-section.ll
    llvm/test/MC/WebAssembly/unnamed-data.ll
    llvm/test/MC/X86/intel-syntax-var-offset.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/MC/AArch64/coff-debug.ll b/llvm/test/MC/AArch64/coff-debug.ll
index af3459ace3531..cbea03592d578 100644
--- a/llvm/test/MC/AArch64/coff-debug.ll
+++ b/llvm/test/MC/AArch64/coff-debug.ll
@@ -12,7 +12,7 @@ target triple = "aarch64--windows-msvc18.0.0"
 define i32 @main() #0 !dbg !7 {
 entry:
   %retval = alloca i32, align 4
-  store i32 0, i32* %retval, align 4
+  store i32 0, ptr %retval, align 4
   ret i32 1, !dbg !11
 }
 

diff  --git a/llvm/test/MC/AArch64/elf-globaladdress.ll b/llvm/test/MC/AArch64/elf-globaladdress.ll
index 8b36d4ec745dc..2271e83e53312 100644
--- a/llvm/test/MC/AArch64/elf-globaladdress.ll
+++ b/llvm/test/MC/AArch64/elf-globaladdress.ll
@@ -12,25 +12,25 @@
 @var64 = dso_local global i64 0
 
 define dso_local void @loadstore() {
-    %val8 = load i8, i8* @var8
-    store volatile i8 %val8, i8* @var8
+    %val8 = load i8, ptr @var8
+    store volatile i8 %val8, ptr @var8
 
-    %val16 = load i16, i16* @var16
-    store volatile i16 %val16, i16* @var16
+    %val16 = load i16, ptr @var16
+    store volatile i16 %val16, ptr @var16
 
-    %val32 = load i32, i32* @var32
-    store volatile i32 %val32, i32* @var32
+    %val32 = load i32, ptr @var32
+    store volatile i32 %val32, ptr @var32
 
-    %val64 = load i64, i64* @var64
-    store volatile i64 %val64, i64* @var64
+    %val64 = load i64, ptr @var64
+    store volatile i64 %val64, ptr @var64
 
     ret void
 }
 
- at globaddr = dso_local global i64* null
+ at globaddr = dso_local global ptr null
 
 define dso_local void @address() {
-    store i64* @var64, i64** @globaddr
+    store ptr @var64, ptr @globaddr
     ret void
 }
 

diff  --git a/llvm/test/MC/AArch64/ir-to-imgrel.ll b/llvm/test/MC/AArch64/ir-to-imgrel.ll
index 1156927c7f7ba..1731ce4dd9dfb 100644
--- a/llvm/test/MC/AArch64/ir-to-imgrel.ll
+++ b/llvm/test/MC/AArch64/ir-to-imgrel.ll
@@ -3,9 +3,9 @@
 @__ImageBase = external global i8
 
 ; AARCH64: .xword   "?x@@3HA"@IMGREL
-@"\01?x@@3HA" = global i64 sub nsw (i64 ptrtoint (i64* @"\01?x@@3HA" to i64), i64 ptrtoint (i8* @__ImageBase to i64)), align 8
+@"\01?x@@3HA" = global i64 sub nsw (i64 ptrtoint (ptr @"\01?x@@3HA" to i64), i64 ptrtoint (ptr @__ImageBase to i64)), align 8
 
 declare void @f()
 
 ; AARCH64: .xword   f at IMGREL
- at fp = global i64 sub nsw (i64 ptrtoint (void ()* @f to i64), i64 ptrtoint (i8* @__ImageBase to i64)), align 8
+ at fp = global i64 sub nsw (i64 ptrtoint (ptr @f to i64), i64 ptrtoint (ptr @__ImageBase to i64)), align 8

diff  --git a/llvm/test/MC/ARM/cxx-global-constructor.ll b/llvm/test/MC/ARM/cxx-global-constructor.ll
index 6f0f651505bd5..624851890898f 100644
--- a/llvm/test/MC/ARM/cxx-global-constructor.ll
+++ b/llvm/test/MC/ARM/cxx-global-constructor.ll
@@ -2,7 +2,7 @@
 ; RUN: -filetype=obj -o - | llvm-readobj -r - | FileCheck %s
 
 
- at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* null }]
+ at llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @f, ptr null }]
 
 define void @f() {
   ret void

diff  --git a/llvm/test/MC/ARM/data-in-code.ll b/llvm/test/MC/ARM/data-in-code.ll
index e863640bda752..2e107f250e05d 100644
--- a/llvm/test/MC/ARM/data-in-code.ll
+++ b/llvm/test/MC/ARM/data-in-code.ll
@@ -9,8 +9,8 @@
 ;; Ensure that if a jump table is generated that it has Mapping Symbols
 ;; marking the data-in-code region.
 
-define void @foo(i32* %ptr, i32 %b) nounwind ssp {
-  %tmp = load i32, i32* %ptr, align 4
+define void @foo(ptr %ptr, i32 %b) nounwind ssp {
+  %tmp = load i32, ptr %ptr, align 4
   switch i32 %tmp, label %exit [
     i32 0, label %bb0
     i32 1, label %bb1
@@ -18,16 +18,16 @@ define void @foo(i32* %ptr, i32 %b) nounwind ssp {
     i32 3, label %bb3
   ]
 bb0:
-  store i32 %b, i32* %ptr, align 4
+  store i32 %b, ptr %ptr, align 4
   br label %exit
 bb1:
-  store i32 1, i32* %ptr, align 4
+  store i32 1, ptr %ptr, align 4
   br label %exit
 bb2:
-  store i32 2, i32* %ptr, align 4
+  store i32 2, ptr %ptr, align 4
   br label %exit
 bb3:
-  store i32 4, i32* %ptr, align 4
+  store i32 4, ptr %ptr, align 4
   br label %exit
 exit:
   ret void

diff  --git a/llvm/test/MC/AsmParser/pr28805.ll b/llvm/test/MC/AsmParser/pr28805.ll
index 4bfa82297c299..80e002f2a8ba3 100644
--- a/llvm/test/MC/AsmParser/pr28805.ll
+++ b/llvm/test/MC/AsmParser/pr28805.ll
@@ -6,11 +6,10 @@ target triple = "x86_64-pc-windows-msvc18.0.31101"
 define i32 @_xbegin() {
 entry:
   %res = alloca i32, align 4
-  %0 = bitcast i32* %res to i8*
-  store i32 -1, i32* %res, align 4
-  call void asm sideeffect inteldialect ".byte 0xC7\0A\09.byte 0xF8\0A\09.byte 2\0A\09.byte 0\0A\09.byte 0\0A\09.byte 0\0A\09jmp .L__MSASMLABEL_.0__L2\0A\09mov dword ptr $0, eax\0A\09.L__MSASMLABEL_.0__L2:", "=*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) nonnull %res)
-  %1 = load i32, i32* %res, align 4
-  ret i32 %1
+  store i32 -1, ptr %res, align 4
+  call void asm sideeffect inteldialect ".byte 0xC7\0A\09.byte 0xF8\0A\09.byte 2\0A\09.byte 0\0A\09.byte 0\0A\09.byte 0\0A\09jmp .L__MSASMLABEL_.0__L2\0A\09mov dword ptr $0, eax\0A\09.L__MSASMLABEL_.0__L2:", "=*m,~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i32) nonnull %res)
+  %0 = load i32, ptr %res, align 4
+  ret i32 %0
 }
 
 ; CHECK-NOT: Error parsing inline asm

diff  --git a/llvm/test/MC/COFF/cgprofile.ll b/llvm/test/MC/COFF/cgprofile.ll
index 0156aedb12219..7ba4274efcb9a 100644
--- a/llvm/test/MC/COFF/cgprofile.ll
+++ b/llvm/test/MC/COFF/cgprofile.ll
@@ -23,10 +23,10 @@ B:
 
 !0 = !{i32 5, !"CG Profile", !1}
 !1 = !{!2, !3, !4, !5}
-!2 = !{void ()* @a, void ()* @b, i64 32}
-!3 = !{void (i1)* @freq, void ()* @a, i64 11}
-!4 = !{void (i1)* @freq, void ()* @b, i64 20}
-!5 = !{void (i1)* @freq, null, i64 20}
+!2 = !{ptr @a, ptr @b, i64 32}
+!3 = !{ptr @freq, ptr @a, i64 11}
+!4 = !{ptr @freq, ptr @b, i64 20}
+!5 = !{ptr @freq, null, i64 20}
 
 ; CHECK: .cg_profile a, b, 32
 ; CHECK: .cg_profile freq, a, 11

diff  --git a/llvm/test/MC/COFF/const-gv-with-rel-init.ll b/llvm/test/MC/COFF/const-gv-with-rel-init.ll
index fde5a17ad515a..3dbc781655272 100644
--- a/llvm/test/MC/COFF/const-gv-with-rel-init.ll
+++ b/llvm/test/MC/COFF/const-gv-with-rel-init.ll
@@ -4,8 +4,8 @@ define void @f() {
   ret void
 }
 
- at ptr = constant void ()* @f, section ".CRT$XLB", align 8
+ at ptr = constant ptr @f, section ".CRT$XLB", align 8
 ; CHECK:  .section  .CRT$XLB,"dr"
 
- at weak_array = weak_odr unnamed_addr constant [1 x i8*] [i8* bitcast (void ()* @f to i8*)]
+ at weak_array = weak_odr unnamed_addr constant [1 x ptr] [ptr @f]
 ; CHECK:  .section  .rdata,"dr"

diff  --git a/llvm/test/MC/COFF/cross-section-relative.ll b/llvm/test/MC/COFF/cross-section-relative.ll
index 724b1a0a426ea..1b11a4659fee0 100644
--- a/llvm/test/MC/COFF/cross-section-relative.ll
+++ b/llvm/test/MC/COFF/cross-section-relative.ll
@@ -7,26 +7,26 @@
 @g2 = constant i32 2;
 @g3 = constant i32 3;
 @g4 = constant i32 4;
- at __ImageBase = external global i64*;
+ at __ImageBase = external global ptr;
 
 ;;;; cross-section relative relocations
 
 ; CHECK: .quad (g3-t1)+4
- at t1 = global i64 add(i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i64* @t1 to i64)), i64 4), section ".fix"
+ at t1 = global i64 add(i64 sub(i64 ptrtoint(ptr @g3 to i64), i64 ptrtoint(ptr @t1 to i64)), i64 4), section ".fix"
 ; CHECK: .quad g3-t2
- at t2 = global i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i64* @t2 to i64)), section ".fix"
+ at t2 = global i64 sub(i64 ptrtoint(ptr @g3 to i64), i64 ptrtoint(ptr @t2 to i64)), section ".fix"
 ; CHECK: .quad (g3-t3)-4
- at t3 = global i64 sub(i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i64* @t3 to i64)), i64 4), section ".fix"
+ at t3 = global i64 sub(i64 sub(i64 ptrtoint(ptr @g3 to i64), i64 ptrtoint(ptr @t3 to i64)), i64 4), section ".fix"
 ; CHECK: .long g3-t4
- at t4 = global i32 trunc(i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i32* @t4 to i64)) to i32), section ".fix"
+ at t4 = global i32 trunc(i64 sub(i64 ptrtoint(ptr @g3 to i64), i64 ptrtoint(ptr @t4 to i64)) to i32), section ".fix"
 
 ;;;; image base relocation
 
 ; CHECK: .long g3 at IMGREL{{$}}
- at t5 = global i32 trunc(i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i64** @__ImageBase to i64)) to i32), section ".fix"
+ at t5 = global i32 trunc(i64 sub(i64 ptrtoint(ptr @g3 to i64), i64 ptrtoint(ptr @__ImageBase to i64)) to i32), section ".fix"
 
 ; CHECK: .long g3 at IMGREL+4{{$}}
- at t6 = global i32 trunc(i64 sub(i64 ptrtoint(i32* getelementptr (i32, i32* @g3, i32 1) to i64), i64 ptrtoint(i64** @__ImageBase to i64)) to i32), section ".fix"
+ at t6 = global i32 trunc(i64 sub(i64 ptrtoint(ptr getelementptr (i32, ptr @g3, i32 1) to i64), i64 ptrtoint(ptr @__ImageBase to i64)) to i32), section ".fix"
 
 ;;;; cross-section relative with source offset
 
@@ -36,5 +36,5 @@
 @t7 = global %struct.EEType { 
         [2 x i8] c"\01\02", 
         i64 256,
-        i32 trunc(i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i32* getelementptr inbounds (%struct.EEType, %struct.EEType* @t7, i32 0, i32 2) to i64)) to i32 )
+        i32 trunc(i64 sub(i64 ptrtoint(ptr @g3 to i64), i64 ptrtoint(ptr getelementptr inbounds (%struct.EEType, ptr @t7, i32 0, i32 2) to i64)) to i32 )
 }, section ".fix"

diff  --git a/llvm/test/MC/COFF/global_ctors_dtors.ll b/llvm/test/MC/COFF/global_ctors_dtors.ll
index e8f49867e52df..7df4d3e500b54 100644
--- a/llvm/test/MC/COFF/global_ctors_dtors.ll
+++ b/llvm/test/MC/COFF/global_ctors_dtors.ll
@@ -9,19 +9,19 @@
 @.str2 = private unnamed_addr constant [12 x i8] c"destructing\00", align 1
 @.str3 = private unnamed_addr constant [5 x i8] c"main\00", align 1
 
-%ini = type { i32, void()*, i8* }
+%ini = type { i32, ptr, ptr }
 
 @llvm.global_ctors = appending global [3 x %ini ] [
-  %ini { i32 65535, void ()* @a_global_ctor, i8* null },
-  %ini { i32 65535, void ()* @b_global_ctor, i8* bitcast (i32* @b to i8*) },
-  %ini { i32 65535, void ()* @c_global_ctor, i8* bitcast (i32* @c to i8*) }
+  %ini { i32 65535, ptr @a_global_ctor, ptr null },
+  %ini { i32 65535, ptr @b_global_ctor, ptr @b },
+  %ini { i32 65535, ptr @c_global_ctor, ptr @c }
 ]
- at llvm.global_dtors = appending global [1 x %ini ] [%ini { i32 65535, void ()* @a_global_dtor, i8* null }]
+ at llvm.global_dtors = appending global [1 x %ini ] [%ini { i32 65535, ptr @a_global_dtor, ptr null }]
 
-declare i32 @puts(i8*)
+declare i32 @puts(ptr)
 
 define void @a_global_ctor() nounwind {
-  %1 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0))
+  %1 = call i32 @puts(ptr @.str)
   ret void
 }
 
@@ -30,22 +30,22 @@ define void @a_global_ctor() nounwind {
 @c = available_externally dllimport global i32 zeroinitializer
 
 define void @b_global_ctor() nounwind {
-  store i32 42, i32* @b
+  store i32 42, ptr @b
   ret void
 }
 
 define void @c_global_ctor() nounwind {
-  store i32 42, i32* @c
+  store i32 42, ptr @c
   ret void
 }
 
 define void @a_global_dtor() nounwind {
-  %1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str2, i32 0, i32 0))
+  %1 = call i32 @puts(ptr @.str2)
   ret void
 }
 
 define i32 @main() nounwind {
-  %1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str3, i32 0, i32 0))
+  %1 = call i32 @puts(ptr @.str3)
   ret i32 0
 }
 

diff  --git a/llvm/test/MC/COFF/ir-to-imgrel.ll b/llvm/test/MC/COFF/ir-to-imgrel.ll
index 21198cf51323f..c087f02213d22 100644
--- a/llvm/test/MC/COFF/ir-to-imgrel.ll
+++ b/llvm/test/MC/COFF/ir-to-imgrel.ll
@@ -3,9 +3,9 @@
 @__ImageBase = external global i8
 
 ; X64: .quad   "?x@@3HA"@IMGREL
-@"\01?x@@3HA" = global i64 sub nsw (i64 ptrtoint (i64* @"\01?x@@3HA" to i64), i64 ptrtoint (i8* @__ImageBase to i64)), align 8
+@"\01?x@@3HA" = global i64 sub nsw (i64 ptrtoint (ptr @"\01?x@@3HA" to i64), i64 ptrtoint (ptr @__ImageBase to i64)), align 8
 
 declare void @f()
 
 ; X64: .quad   f at IMGREL
- at fp = global i64 sub nsw (i64 ptrtoint (void ()* @f to i64), i64 ptrtoint (i8* @__ImageBase to i64)), align 8
+ at fp = global i64 sub nsw (i64 ptrtoint (ptr @f to i64), i64 ptrtoint (ptr @__ImageBase to i64)), align 8

diff  --git a/llvm/test/MC/COFF/tricky-names.ll b/llvm/test/MC/COFF/tricky-names.ll
index a320cf6dfce26..7189079e39781 100644
--- a/llvm/test/MC/COFF/tricky-names.ll
+++ b/llvm/test/MC/COFF/tricky-names.ll
@@ -13,9 +13,9 @@
 @"\01 at foo.bar" = global i32 0
 
 define weak i32 @"\01??_B?$num_put at _WV?$back_insert_iterator at V?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@@std@@@std@@51"() section ".text" {
-  %a = load i32, i32* @"\01??__E_Generic_object@?$_Error_objects at H@std@@YAXXZ"
-  %b = load i32, i32* @"\01__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS at 4"
-  %c = load i32, i32* @"\01 at foo.bar"
+  %a = load i32, ptr @"\01??__E_Generic_object@?$_Error_objects at H@std@@YAXXZ"
+  %b = load i32, ptr @"\01__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS at 4"
+  %c = load i32, ptr @"\01 at foo.bar"
   %x = add i32 %a, %b
   %y = add i32 %x, %c
   ret i32 %y

diff  --git a/llvm/test/MC/ELF/bss.ll b/llvm/test/MC/ELF/bss.ll
index 5112d2c9b0a5d..24a5673de2be4 100644
--- a/llvm/test/MC/ELF/bss.ll
+++ b/llvm/test/MC/ELF/bss.ll
@@ -4,5 +4,5 @@
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
 target triple = "i386-pc-linux-gnu"
 
- at g0 = global i8* null, align 4             ; <i8**> [#uses=0]
+ at g0 = global ptr null, align 4             ; <ptr> [#uses=0]
 

diff  --git a/llvm/test/MC/ELF/cfi-version.ll b/llvm/test/MC/ELF/cfi-version.ll
index 67f42ac446cf9..306c948a92d1b 100644
--- a/llvm/test/MC/ELF/cfi-version.ll
+++ b/llvm/test/MC/ELF/cfi-version.ll
@@ -10,7 +10,7 @@
 ; Function Attrs: nounwind
 define i32 @foo() #0 !dbg !4 {
 entry:
-  %call = call i32 bitcast (i32 (...)* @bar to i32 ()*)(), !dbg !12
+  %call = call i32 @bar(), !dbg !12
   %add = add nsw i32 %call, 1, !dbg !12
   ret i32 %add, !dbg !12
 }

diff  --git a/llvm/test/MC/ELF/cgprofile.ll b/llvm/test/MC/ELF/cgprofile.ll
index da29984e848cd..f1bbd18560e9e 100644
--- a/llvm/test/MC/ELF/cgprofile.ll
+++ b/llvm/test/MC/ELF/cgprofile.ll
@@ -23,10 +23,10 @@ B:
 
 !0 = !{i32 5, !"CG Profile", !1}
 !1 = !{!2, !3, !4, !5}
-!2 = !{void ()* @a, void ()* @b, i64 32}
-!3 = !{void (i1)* @freq, void ()* @a, i64 11}
-!4 = !{void (i1)* @freq, void ()* @b, i64 20}
-!5 = !{void (i1)* @freq, null, i64 20}
+!2 = !{ptr @a, ptr @b, i64 32}
+!3 = !{ptr @freq, ptr @a, i64 11}
+!4 = !{ptr @freq, ptr @b, i64 20}
+!5 = !{ptr @freq, null, i64 20}
 
 ; CHECK: .cg_profile a, b, 32
 ; CHECK: .cg_profile freq, a, 11

diff  --git a/llvm/test/MC/ELF/entsize.ll b/llvm/test/MC/ELF/entsize.ll
index b340fdbcebde7..6a82329ba77f4 100644
--- a/llvm/test/MC/ELF/entsize.ll
+++ b/llvm/test/MC/ELF/entsize.ll
@@ -8,15 +8,15 @@
 @.c8b = private unnamed_addr constant [1 x i64] [i64 42]
 
 define i32 @main() nounwind {
-  %1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str1, i32 0, i32 0))
-  %2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str2, i32 0, i32 0))
-  call void @foo(i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.c8a, i32 0, i32 0))
-  call void @foo(i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.c8b, i32 0, i32 0))
+  %1 = call i32 @puts(ptr @.str1)
+  %2 = call i32 @puts(ptr @.str2)
+  call void @foo(ptr @.c8a)
+  call void @foo(ptr @.c8b)
   ret i32 0
 }
 
-declare i32 @puts(i8* nocapture) nounwind
-declare void @foo(i64* nocapture) nounwind
+declare i32 @puts(ptr nocapture) nounwind
+declare void @foo(ptr nocapture) nounwind
 
 ;;;;;
 

diff  --git a/llvm/test/MC/ELF/section-relro.ll b/llvm/test/MC/ELF/section-relro.ll
index d4bacda4b4747..fc9eb13f4e27d 100644
--- a/llvm/test/MC/ELF/section-relro.ll
+++ b/llvm/test/MC/ELF/section-relro.ll
@@ -5,7 +5,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"
 
- at funcs_relro = hidden constant [2 x i32 ()*] [i32 ()* bitcast (i32 (...)* @func1 to i32 ()*), i32 ()* bitcast (i32 (...)* @func2 to i32 ()*)], align 16 #0
+ at funcs_relro = hidden constant [2 x ptr] [ptr @func1, ptr @func2], align 16 #0
 @var_data = hidden global i32 33, align 4 #0
 
 declare i32 @func1(...)
@@ -15,13 +15,13 @@ declare i32 @func2(...)
 define hidden i32 @foo(i32 %i) {
 entry:
   %i.addr = alloca i32, align 4
-  store i32 %i, i32* %i.addr, align 4
-  %0 = load i32, i32* %i.addr, align 4
+  store i32 %i, ptr %i.addr, align 4
+  %0 = load i32, ptr %i.addr, align 4
   %idxprom = sext i32 %0 to i64
-  %arrayidx = getelementptr inbounds [2 x i32 ()*], [2 x i32 ()*]* @funcs_relro, i64 0, i64 %idxprom
-  %1 = load i32 ()*, i32 ()** %arrayidx, align 8
+  %arrayidx = getelementptr inbounds [2 x ptr], ptr @funcs_relro, i64 0, i64 %idxprom
+  %1 = load ptr, ptr %arrayidx, align 8
   %call = call i32 %1()
-  %2 = load i32, i32* @var_data, align 4
+  %2 = load i32, ptr @var_data, align 4
   %add = add nsw i32 %call, %2
   ret i32 %add
 }

diff  --git a/llvm/test/MC/Hexagon/extended_relocations.ll b/llvm/test/MC/Hexagon/extended_relocations.ll
index 6c79a0ab73a93..854e24571e501 100644
--- a/llvm/test/MC/Hexagon/extended_relocations.ll
+++ b/llvm/test/MC/Hexagon/extended_relocations.ll
@@ -9,12 +9,12 @@ target triple = "hexagon-unknown--elf"
 
 @.str = private unnamed_addr constant [10 x i8] c"cxfir.log\00", align 1
 
-declare i32 @printf(i8*, ...) #1
+declare i32 @printf(ptr, ...) #1
 
 ; Function Attrs: nounwind
 define i32 @main() #0 {
 entry:
-  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0))
+  %call = call i32 (ptr, ...) @printf(ptr @.str)
   ret i32 0
 }
 

diff  --git a/llvm/test/MC/MachO/AArch64/cstexpr-gotpcrel.ll b/llvm/test/MC/MachO/AArch64/cstexpr-gotpcrel.ll
index 0cfb764a835a0..3681ed5351839 100644
--- a/llvm/test/MC/MachO/AArch64/cstexpr-gotpcrel.ll
+++ b/llvm/test/MC/MachO/AArch64/cstexpr-gotpcrel.ll
@@ -7,10 +7,10 @@
 %struct.anon = type { i32, i32 }
 
 @localfoo = global i32 42
- at localgotequiv = private unnamed_addr constant i32* @localfoo
+ at localgotequiv = private unnamed_addr constant ptr @localfoo
 
 @extfoo = external global i32
- at extgotequiv = private unnamed_addr constant i32* @extfoo
+ at extgotequiv = private unnamed_addr constant ptr @extfoo
 
 ; Don't replace GOT equivalent usage within instructions and emit the GOT
 ; equivalent since it can't be replaced by the GOT entry. @bargotequiv is
@@ -19,7 +19,7 @@
 ; CHECK: l_bargotequiv:
 ; CHECK-NEXT:  .quad   _extbar
 @extbar = external global i32
- at bargotequiv = private unnamed_addr constant i32* @extbar
+ at bargotequiv = private unnamed_addr constant ptr @extbar
 
 @table = global [4 x %struct.data] [
 ; CHECK-LABEL: _table
@@ -31,8 +31,8 @@
 ; CHECK-NEXT: Ltmp0:
 ; CHECK-NEXT: .long _localfoo at GOT-Ltmp0
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 trunc (i64 sub (i64 ptrtoint (i32** @localgotequiv to i64),
-                        i64 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i64 1, i32 1, i32 1) to i64))
+    i32 trunc (i64 sub (i64 ptrtoint (ptr @localgotequiv to i64),
+                        i64 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i64 1, i32 1, i32 1) to i64))
                         to i32)}
   },
 
@@ -41,8 +41,8 @@
 ; CHECK-NEXT: Ltmp1:
 ; CHECK-NEXT: _extfoo at GOT-Ltmp1
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 trunc (i64 sub (i64 ptrtoint (i32** @extgotequiv to i64),
-                        i64 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i64 2, i32 1, i32 1) to i64))
+    i32 trunc (i64 sub (i64 ptrtoint (ptr @extgotequiv to i64),
+                        i64 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i64 2, i32 1, i32 1) to i64))
                         to i32)}
   },
 ; Test support for arbitrary constants into the GOTPCREL offset, which is
@@ -51,8 +51,8 @@
 ; CHECK: .long   5
 ; CHECK-NEXT: .long ((l_extgotequiv-_table)-44)+24
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 add (i32 trunc (i64 sub (i64 ptrtoint (i32** @extgotequiv to i64),
-                                 i64 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i64 3, i32 1, i32 1) to i64))
+    i32 add (i32 trunc (i64 sub (i64 ptrtoint (ptr @extgotequiv to i64),
+                                 i64 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i64 3, i32 1, i32 1) to i64))
                                  to i32), i32 24)}
   }
 ], align 16
@@ -62,19 +62,19 @@
 ; CHECK-LABEL: _delta
 ; CHECK: Ltmp2:
 ; CHECK-NEXT:  .long _extfoo at GOT-Ltmp2
- at delta = global i32 trunc (i64 sub (i64 ptrtoint (i32** @extgotequiv to i64),
-                                    i64 ptrtoint (i32* @delta to i64))
+ at delta = global i32 trunc (i64 sub (i64 ptrtoint (ptr @extgotequiv to i64),
+                                    i64 ptrtoint (ptr @delta to i64))
                            to i32)
 
 ; CHECK-LABEL: _deltaplus:
 ; CHECK: .long  (l_localgotequiv-_deltaplus)+55
- at deltaplus = global i32 add (i32 trunc (i64 sub (i64 ptrtoint (i32** @localgotequiv to i64),
-                                        i64 ptrtoint (i32* @deltaplus to i64))
+ at deltaplus = global i32 add (i32 trunc (i64 sub (i64 ptrtoint (ptr @localgotequiv to i64),
+                                        i64 ptrtoint (ptr @deltaplus to i64))
                                         to i32), i32 55)
 
 define i32 @t0(i32 %a) {
-  %x = add i32 trunc (i64 sub (i64 ptrtoint (i32** @bargotequiv to i64),
-                               i64 ptrtoint (i32 (i32)* @t0 to i64))
+  %x = add i32 trunc (i64 sub (i64 ptrtoint (ptr @bargotequiv to i64),
+                               i64 ptrtoint (ptr @t0 to i64))
                            to i32), %a
   ret i32 %x
 }

diff  --git a/llvm/test/MC/MachO/ARM/cstexpr-gotpcrel.ll b/llvm/test/MC/MachO/ARM/cstexpr-gotpcrel.ll
index 95d830ccfaa81..07f59d80d1330 100644
--- a/llvm/test/MC/MachO/ARM/cstexpr-gotpcrel.ll
+++ b/llvm/test/MC/MachO/ARM/cstexpr-gotpcrel.ll
@@ -12,10 +12,10 @@
 ; GOT-EQUIV-NOT: _localgotequiv
 ; GOT-EQUIV-NOT: _extgotequiv
 @localfoo = global i32 42
- at localgotequiv = private unnamed_addr constant i32* @localfoo
+ at localgotequiv = private unnamed_addr constant ptr @localfoo
 
 @extfoo = external global i32
- at extgotequiv = private unnamed_addr constant i32* @extfoo
+ at extgotequiv = private unnamed_addr constant ptr @extfoo
 
 ; Don't replace GOT equivalent usage within instructions and emit the GOT
 ; equivalent since it can't be replaced by the GOT entry. @bargotequiv is
@@ -24,7 +24,7 @@
 ; CHECK: l_bargotequiv:
 ; CHECK-NEXT:  .long   _extbar
 @extbar = external global i32
- at bargotequiv = private unnamed_addr constant i32* @extbar
+ at bargotequiv = private unnamed_addr constant ptr @extbar
 
 @table = global [4 x %struct.data] [
 ; CHECK-LABEL: _table
@@ -34,23 +34,23 @@
 ; CHECK-NOT: l_localgotequiv-(_table+20)
 ; CHECK-NEXT: L_localfoo$non_lazy_ptr-(_table+20)
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 sub (i32 ptrtoint (i32** @localgotequiv to i32),
-             i32 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i32 1, i32 1, i32 1) to i32))}
+    i32 sub (i32 ptrtoint (ptr @localgotequiv to i32),
+             i32 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i32 1, i32 1, i32 1) to i32))}
   },
 ; CHECK: .long   5
 ; CHECK-NOT: l_extgotequiv-(_table+32)
 ; CHECK-NEXT: L_extfoo$non_lazy_ptr-(_table+32)
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 sub (i32 ptrtoint (i32** @extgotequiv to i32),
-             i32 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i32 2, i32 1, i32 1) to i32))}
+    i32 sub (i32 ptrtoint (ptr @extgotequiv to i32),
+             i32 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i32 2, i32 1, i32 1) to i32))}
   },
 ; Test support for arbitrary constants into the GOTPCREL offset
 ; CHECK: .long   5
 ; CHECK-NOT: (l_extgotequiv-(_table+44))+24
 ; CHECK-NEXT: L_extfoo$non_lazy_ptr-(_table+20)
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 add (i32 sub (i32 ptrtoint (i32** @extgotequiv to i32),
-                      i32 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i32 3, i32 1, i32 1) to i32)),
+    i32 add (i32 sub (i32 ptrtoint (ptr @extgotequiv to i32),
+                      i32 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i32 3, i32 1, i32 1) to i32)),
                       i32 24)}
   }
 ], align 16
@@ -58,17 +58,17 @@
 ; Test multiple uses of GOT equivalents.
 ; CHECK-LABEL: _delta
 ; CHECK: .long   L_extfoo$non_lazy_ptr-_delta
- at delta = global i32 sub (i32 ptrtoint (i32** @extgotequiv to i32),
-                         i32 ptrtoint (i32* @delta to i32))
+ at delta = global i32 sub (i32 ptrtoint (ptr @extgotequiv to i32),
+                         i32 ptrtoint (ptr @delta to i32))
 
 ; CHECK-LABEL: _deltaplus:
 ; CHECK: .long   L_localfoo$non_lazy_ptr-(_deltaplus-55)
- at deltaplus = global i32 add (i32 sub (i32 ptrtoint (i32** @localgotequiv to i32),
-                             i32 ptrtoint (i32* @deltaplus to i32)),
+ at deltaplus = global i32 add (i32 sub (i32 ptrtoint (ptr @localgotequiv to i32),
+                             i32 ptrtoint (ptr @deltaplus to i32)),
                              i32 55)
 
 define i32 @t0(i32 %a) {
-  %x = add i32 sub (i32 ptrtoint (i32** @bargotequiv to i32),
-                    i32 ptrtoint (i32 (i32)* @t0 to i32)), %a
+  %x = add i32 sub (i32 ptrtoint (ptr @bargotequiv to i32),
+                    i32 ptrtoint (ptr @t0 to i32)), %a
   ret i32 %x
 }

diff  --git a/llvm/test/MC/MachO/ARM/no-tls-assert.ll b/llvm/test/MC/MachO/ARM/no-tls-assert.ll
index 0152c8286c21f..88db51fe39c4e 100644
--- a/llvm/test/MC/MachO/ARM/no-tls-assert.ll
+++ b/llvm/test/MC/MachO/ARM/no-tls-assert.ll
@@ -5,8 +5,8 @@
 target triple = "thumbv7-apple-ios9.0.0"
 
 @b = external thread_local global i32
-define i32* @func(i32 %a) !dbg !9 {
-  ret i32* @b
+define ptr @func(i32 %a) !dbg !9 {
+  ret ptr @b
 }
 
 !llvm.dbg.cu = !{!0}

diff  --git a/llvm/test/MC/MachO/cgprofile.ll b/llvm/test/MC/MachO/cgprofile.ll
index aa8564bd54a78..e83ef87c5993a 100644
--- a/llvm/test/MC/MachO/cgprofile.ll
+++ b/llvm/test/MC/MachO/cgprofile.ll
@@ -23,10 +23,10 @@ B:
 
 !0 = !{i32 5, !"CG Profile", !1}
 !1 = !{!2, !3, !4, !5}
-!2 = !{void ()* @a, void ()* @b, i64 32}
-!3 = !{void (i1)* @freq, void ()* @a, i64 11}
-!4 = !{void (i1)* @freq, void ()* @b, i64 20}
-!5 = !{void (i1)* @freq, null, i64 20}
+!2 = !{ptr @a, ptr @b, i64 32}
+!3 = !{ptr @freq, ptr @a, i64 11}
+!4 = !{ptr @freq, ptr @b, i64 20}
+!5 = !{ptr @freq, null, i64 20}
 
 ; CHECK: .cg_profile _a, _b, 32
 ; CHECK: .cg_profile _freq, _a, 11

diff  --git a/llvm/test/MC/MachO/cstexpr-gotpcrel-32.ll b/llvm/test/MC/MachO/cstexpr-gotpcrel-32.ll
index 3d06301b99b1d..b98665ca2f5af 100644
--- a/llvm/test/MC/MachO/cstexpr-gotpcrel-32.ll
+++ b/llvm/test/MC/MachO/cstexpr-gotpcrel-32.ll
@@ -12,10 +12,10 @@
 ; GOT-EQUIV-NOT: _localgotequiv
 ; GOT-EQUIV-NOT: _extgotequiv
 @localfoo = global i32 42
- at localgotequiv = private unnamed_addr constant i32* @localfoo
+ at localgotequiv = private unnamed_addr constant ptr @localfoo
 
 @extfoo = external global i32
- at extgotequiv = private unnamed_addr constant i32* @extfoo
+ at extgotequiv = private unnamed_addr constant ptr @extfoo
 
 ; Don't replace GOT equivalent usage within instructions and emit the GOT
 ; equivalent since it can't be replaced by the GOT entry. @bargotequiv is
@@ -24,7 +24,7 @@
 ; CHECK: l_bargotequiv:
 ; CHECK-NEXT:  .long   _extbar
 @extbar = external global i32
- at bargotequiv = private unnamed_addr constant i32* @extbar
+ at bargotequiv = private unnamed_addr constant ptr @extbar
 
 @table = global [4 x %struct.data] [
 ; CHECK-LABEL: _table
@@ -34,23 +34,23 @@
 ; CHECK-NOT: l_localgotequiv-(_table+20)
 ; CHECK-NEXT: L_localfoo$non_lazy_ptr-(_table+20)
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 sub (i32 ptrtoint (i32** @localgotequiv to i32),
-             i32 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i32 1, i32 1, i32 1) to i32))}
+    i32 sub (i32 ptrtoint (ptr @localgotequiv to i32),
+             i32 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i32 1, i32 1, i32 1) to i32))}
   },
 ; CHECK: .long   5
 ; CHECK-NOT: l_extgotequiv-(_table+32)
 ; CHECK-NEXT: L_extfoo$non_lazy_ptr-(_table+32)
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 sub (i32 ptrtoint (i32** @extgotequiv to i32),
-             i32 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i32 2, i32 1, i32 1) to i32))}
+    i32 sub (i32 ptrtoint (ptr @extgotequiv to i32),
+             i32 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i32 2, i32 1, i32 1) to i32))}
   },
 ; Test support for arbitrary constants into the GOTPCREL offset
 ; CHECK: .long   5
 ; CHECK-NOT: (l_extgotequiv-(_table+44))+24
 ; CHECK-NEXT: L_extfoo$non_lazy_ptr-(_table+20)
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 add (i32 sub (i32 ptrtoint (i32** @extgotequiv to i32),
-                      i32 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i32 3, i32 1, i32 1) to i32)),
+    i32 add (i32 sub (i32 ptrtoint (ptr @extgotequiv to i32),
+                      i32 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i32 3, i32 1, i32 1) to i32)),
                       i32 24)}
   }
 ], align 16
@@ -58,18 +58,18 @@
 ; Test multiple uses of GOT equivalents.
 ; CHECK-LABEL: _delta
 ; CHECK: .long   L_extfoo$non_lazy_ptr-_delta
- at delta = global i32 sub (i32 ptrtoint (i32** @extgotequiv to i32),
-                         i32 ptrtoint (i32* @delta to i32))
+ at delta = global i32 sub (i32 ptrtoint (ptr @extgotequiv to i32),
+                         i32 ptrtoint (ptr @delta to i32))
 
 ; CHECK-LABEL: _deltaplus:
 ; CHECK: .long   L_localfoo$non_lazy_ptr-(_deltaplus-55)
- at deltaplus = global i32 add (i32 sub (i32 ptrtoint (i32** @localgotequiv to i32),
-                             i32 ptrtoint (i32* @deltaplus to i32)),
+ at deltaplus = global i32 add (i32 sub (i32 ptrtoint (ptr @localgotequiv to i32),
+                             i32 ptrtoint (ptr @deltaplus to i32)),
                              i32 55)
 
 define i32 @t0(i32 %a) {
-  %x = add i32 sub (i32 ptrtoint (i32** @bargotequiv to i32),
-                    i32 ptrtoint (i32 (i32)* @t0 to i32)), %a
+  %x = add i32 sub (i32 ptrtoint (ptr @bargotequiv to i32),
+                    i32 ptrtoint (ptr @t0 to i32)), %a
   ret i32 %x
 }
 
@@ -77,13 +77,13 @@ define i32 @t0(i32 %a) {
 ; CHECK-LABEL: _localindirect
 ; CHECK: .long 65603
 @localindirect = internal constant i32  65603
- at got.localindirect = private unnamed_addr constant i32* @localindirect
+ at got.localindirect = private unnamed_addr constant ptr @localindirect
 
 ; CHECK-LABEL: _localindirectuser:
 ; CHECK: .long   L_localindirect$non_lazy_ptr-_localindirectuser
 @localindirectuser = internal constant
-  i32 sub (i32 ptrtoint (i32** @got.localindirect to i32),
-           i32 ptrtoint (i32* @localindirectuser to i32))
+  i32 sub (i32 ptrtoint (ptr @got.localindirect to i32),
+           i32 ptrtoint (ptr @localindirectuser to i32))
 
 ; Test internal indirect local symbols where the user doesn't see the
 ; definition of the other symbols yet.
@@ -95,14 +95,14 @@ define i32 @t0(i32 %a) {
 ; CHECK-LABEL: _undeflocalindirectuser:
 ; CHECK: .long L_undeflocalindirect$non_lazy_ptr-_undeflocalindirectuser
 @undeflocalindirectuser = internal constant
-  i32 sub (i32 ptrtoint (i32** @got.undeflocalindirect to i32),
-           i32 ptrtoint (i32* @undeflocalindirectuser to i32)),
+  i32 sub (i32 ptrtoint (ptr @got.undeflocalindirect to i32),
+           i32 ptrtoint (ptr @undeflocalindirectuser to i32)),
   section "__TEXT,__const"
 
 ; CHECK-LABEL: _undeflocalindirect:
 ; CHECK: .long 65603
 @undeflocalindirect = internal constant i32  65603
- at got.undeflocalindirect = private unnamed_addr constant i32* @undeflocalindirect
+ at got.undeflocalindirect = private unnamed_addr constant ptr @undeflocalindirect
 
 ; CHECK-LABEL: .section __IMPORT,__pointers
 

diff  --git a/llvm/test/MC/MachO/cstexpr-gotpcrel-64.ll b/llvm/test/MC/MachO/cstexpr-gotpcrel-64.ll
index 41abeb0179cc4..5fd1a962af467 100644
--- a/llvm/test/MC/MachO/cstexpr-gotpcrel-64.ll
+++ b/llvm/test/MC/MachO/cstexpr-gotpcrel-64.ll
@@ -14,10 +14,10 @@
 ; X86-GOT-EQUIV-NOT: L_localgotequiv
 ; X86-GOT-EQUIV-NOT: l_extgotequiv
 @localfoo = global i32 42
- at localgotequiv = private unnamed_addr constant i32* @localfoo
+ at localgotequiv = private unnamed_addr constant ptr @localfoo
 
 @extfoo = external global i32
- at extgotequiv = private unnamed_addr constant i32* @extfoo
+ at extgotequiv = private unnamed_addr constant ptr @extfoo
 
 ; Don't replace GOT equivalent usage within instructions and emit the GOT
 ; equivalent since it can't be replaced by the GOT entry. @bargotequiv is
@@ -26,7 +26,7 @@
 ; X86: l_bargotequiv:
 ; X86-NEXT:  .quad   _extbar
 @extbar = external global i32
- at bargotequiv = private unnamed_addr constant i32* @extbar
+ at bargotequiv = private unnamed_addr constant ptr @extbar
 
 @table = global [4 x %struct.data] [
   %struct.data { i32 1, %struct.anon { i32 2, i32 3 } },
@@ -36,16 +36,16 @@
 ; X86-NOT: .long   _localgotequiv-(_table+20)
 ; X86-NEXT: .long   _localfoo at GOTPCREL+4
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 trunc (i64 sub (i64 ptrtoint (i32** @localgotequiv to i64),
-                        i64 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i64 1, i32 1, i32 1) to i64))
+    i32 trunc (i64 sub (i64 ptrtoint (ptr @localgotequiv to i64),
+                        i64 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i64 1, i32 1, i32 1) to i64))
                         to i32)}
   },
 ; X86: .long   5
 ; X86-NOT: _extgotequiv-(_table+32)
 ; X86-NEXT: .long   _extfoo at GOTPCREL+4
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 trunc (i64 sub (i64 ptrtoint (i32** @extgotequiv to i64),
-                        i64 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i64 2, i32 1, i32 1) to i64))
+    i32 trunc (i64 sub (i64 ptrtoint (ptr @extgotequiv to i64),
+                        i64 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i64 2, i32 1, i32 1) to i64))
                         to i32)}
   },
 ; Test support for arbitrary constants into the GOTPCREL offset.
@@ -54,8 +54,8 @@
 ; X86-NOT: _extgotequiv-(_table+44)
 ; X86-NEXT: .long   _extfoo at GOTPCREL+28
   %struct.data { i32 4, %struct.anon { i32 5,
-    i32 add (i32 trunc (i64 sub (i64 ptrtoint (i32** @extgotequiv to i64),
-                                 i64 ptrtoint (i32* getelementptr inbounds ([4 x %struct.data], [4 x %struct.data]* @table, i32 0, i64 3, i32 1, i32 1) to i64))
+    i32 add (i32 trunc (i64 sub (i64 ptrtoint (ptr @extgotequiv to i64),
+                                 i64 ptrtoint (ptr getelementptr inbounds ([4 x %struct.data], ptr @table, i32 0, i64 3, i32 1, i32 1) to i64))
                                  to i32), i32 24)}
   }
 ], align 16
@@ -64,38 +64,38 @@
 
 ; X86-LABEL: _delta
 ; X86: .long   _extfoo at GOTPCREL+4
- at delta = global i32 trunc (i64 sub (i64 ptrtoint (i32** @extgotequiv to i64),
-                                    i64 ptrtoint (i32* @delta to i64))
+ at delta = global i32 trunc (i64 sub (i64 ptrtoint (ptr @extgotequiv to i64),
+                                    i64 ptrtoint (ptr @delta to i64))
                            to i32)
 
 ; X86-LABEL: _deltaplus:
 ; X86: .long   _localfoo at GOTPCREL+59
- at deltaplus = global i32 add (i32 trunc (i64 sub (i64 ptrtoint (i32** @localgotequiv to i64),
-                                        i64 ptrtoint (i32* @deltaplus to i64))
+ at deltaplus = global i32 add (i32 trunc (i64 sub (i64 ptrtoint (ptr @localgotequiv to i64),
+                                        i64 ptrtoint (ptr @deltaplus to i64))
                                         to i32), i32 55)
 
 define i32 @t0(i32 %a) {
-  %x = add i32 trunc (i64 sub (i64 ptrtoint (i32** @bargotequiv to i64),
-                               i64 ptrtoint (i32 (i32)* @t0 to i64))
+  %x = add i32 trunc (i64 sub (i64 ptrtoint (ptr @bargotequiv to i64),
+                               i64 ptrtoint (ptr @t0 to i64))
                            to i32), %a
   ret i32 %x
 }
 
 ; Also test direct instruction uses.
-define i32** @t1() {
-  ret i32** @bargotequiv
+define ptr @t1() {
+  ret ptr @bargotequiv
 }
 
 ; Do not crash when a pattern cannot be matched as a GOT equivalent
 define void @foo() {
 ; X86-NOGOT-EQUIV-LABEL: _foo:
 ; X86-NOGOT-EQUIV: leaq  _b(%rip), %rax
-  store i8** @b, i8*** null
+  store ptr @b, ptr null
   ret void
 }
 @a = external global i8
- at b = internal unnamed_addr constant i8* @a
+ at b = internal unnamed_addr constant ptr @a
 
 ; X86-NOGOT-EQUIV-LABEL: _c:
 ; X86-NOGOT-EQUIV:   .quad _b
- at c = global i8** @b
+ at c = global ptr @b

diff  --git a/llvm/test/MC/MachO/tlv-bss.ll b/llvm/test/MC/MachO/tlv-bss.ll
index 58587766d464e..85a66607e71b2 100644
--- a/llvm/test/MC/MachO/tlv-bss.ll
+++ b/llvm/test/MC/MachO/tlv-bss.ll
@@ -15,24 +15,24 @@
 ; Generated from this C++ source
 ; template<class T>
 ; struct Tls {
-;   static __thread void* val;
+;   static __thread ptr val;
 ; };
 
-; template<class T> __thread void* Tls<T>::val;
+; template<class T> __thread ptr Tls<T>::val;
 
-; void* f(int x) {
+; ptr f(int x) {
 ;         return Tls<long>::val;
 ; }
 
- at _ZN3TlsIlE3valE = weak_odr thread_local global i8* null, align 8
+ at _ZN3TlsIlE3valE = weak_odr thread_local global ptr null, align 8
 
 ; Function Attrs: nounwind ssp uwtable
-define i8* @_Z1fi(i32 %x) #0 {
+define ptr @_Z1fi(i32 %x) #0 {
 entry:
   %x.addr = alloca i32, align 4
-  store i32 %x, i32* %x.addr, align 4
-  %0 = load i8*, i8** @_ZN3TlsIlE3valE, align 8
-  ret i8* %0
+  store i32 %x, ptr %x.addr, align 4
+  %0 = load ptr, ptr @_ZN3TlsIlE3valE, align 8
+  ret ptr %0
 }
 
 attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }

diff  --git a/llvm/test/MC/Mips/elf-bigendian.ll b/llvm/test/MC/Mips/elf-bigendian.ll
index cbabd537bd621..6bea317f9ff57 100644
--- a/llvm/test/MC/Mips/elf-bigendian.ll
+++ b/llvm/test/MC/Mips/elf-bigendian.ll
@@ -43,18 +43,18 @@ target triple = "mips-unknown-linux"
 
 define i32 @main() nounwind {
 entry:
-  %0 = load i32, i32* @x, align 4
+  %0 = load i32, ptr @x, align 4
   %tobool = icmp eq i32 %0, 0
   br i1 %tobool, label %if.end, label %foo
 
 if.end:                                           ; preds = %entry
-  %puts = tail call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str, i32 0, i32 0))
+  %puts = tail call i32 @puts(ptr @str)
   br label %foo
 
 foo:                                              ; preds = %entry, %if.end
-  %puts2 = tail call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str2, i32 0, i32 0))
+  %puts2 = tail call i32 @puts(ptr @str2)
   ret i32 0
 }
 
-declare i32 @puts(i8* nocapture) nounwind
+declare i32 @puts(ptr nocapture) nounwind
 

diff  --git a/llvm/test/MC/Mips/sym-offset.ll b/llvm/test/MC/Mips/sym-offset.ll
index c5a063b879517..a6756ea8413f4 100644
--- a/llvm/test/MC/Mips/sym-offset.ll
+++ b/llvm/test/MC/Mips/sym-offset.ll
@@ -17,10 +17,10 @@ entry:
 ; CHECK:            0000: 00001C3C 00009C27 21E09903 0000828F
 ; CHECK-NEXT:       0010: 0E004188 0B004198
 
-  %call = tail call i32 @memcmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string2, i32 0, i32 0), i32 4) nounwind readonly
+  %call = tail call i32 @memcmp(ptr @string1, ptr @string2, i32 4) nounwind readonly
   %cmp = icmp eq i32 %call, 0
   %conv = zext i1 %cmp to i32
   ret i32 %conv
 }
 
-declare i32 @memcmp(i8* nocapture, i8* nocapture, i32) nounwind readonly
+declare i32 @memcmp(ptr nocapture, ptr nocapture, i32) nounwind readonly

diff  --git a/llvm/test/MC/WebAssembly/blockaddress.ll b/llvm/test/MC/WebAssembly/blockaddress.ll
index 2b733e0d37c88..5e1fcfddc6533 100644
--- a/llvm/test/MC/WebAssembly/blockaddress.ll
+++ b/llvm/test/MC/WebAssembly/blockaddress.ll
@@ -4,7 +4,7 @@
 
 target triple = "wasm32-unknown-unknown"
 
- at foo = internal global i8* blockaddress(@bar, %addr), align 4
+ at foo = internal global ptr blockaddress(@bar, %addr), align 4
 
 define hidden i32 @bar() #0 {
 entry:

diff  --git a/llvm/test/MC/WebAssembly/bss.ll b/llvm/test/MC/WebAssembly/bss.ll
index d1d9f5622def7..4f0c7c8525562 100644
--- a/llvm/test/MC/WebAssembly/bss.ll
+++ b/llvm/test/MC/WebAssembly/bss.ll
@@ -2,7 +2,7 @@
 
 target triple = "wasm32-unknown-unknown"
 
- at g0 = global i8* null, align 4
+ at g0 = global ptr null, align 4
 @g1 = global i32 0, align 4
 
 %union.u1 = type {}

diff  --git a/llvm/test/MC/WebAssembly/data-symbol-in-text-section.ll b/llvm/test/MC/WebAssembly/data-symbol-in-text-section.ll
index 16c24ba2757ae..4508e13a7b4ac 100644
--- a/llvm/test/MC/WebAssembly/data-symbol-in-text-section.ll
+++ b/llvm/test/MC/WebAssembly/data-symbol-in-text-section.ll
@@ -7,6 +7,6 @@ target triple = "wasm32-unknown-unknown"
 
 define hidden i32 @main() local_unnamed_addr #0 {
 entry:
-  %0 = load i32, i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @data_symbol, i32 0, i32 10)
+  %0 = load i32, ptr getelementptr inbounds ([1024 x i32], ptr @data_symbol, i32 0, i32 10)
   ret i32 %0
 }

diff  --git a/llvm/test/MC/WebAssembly/debug-byval-struct.ll b/llvm/test/MC/WebAssembly/debug-byval-struct.ll
index 83edeffeaa183..8092709984356 100644
--- a/llvm/test/MC/WebAssembly/debug-byval-struct.ll
+++ b/llvm/test/MC/WebAssembly/debug-byval-struct.ll
@@ -20,26 +20,23 @@ target triple = "wasm32-unknown-unknown"
 %struct.s = type { i32, float }
 
 ; Function Attrs: noinline nounwind optnone
-define hidden i32 @some_func(i32 %x, %union.u* byval(%union.u) align 4 %some_union, %struct.s* byval(%struct.s) align 4 %some_struct, i32* %a) #0 !dbg !7 {
+define hidden i32 @some_func(i32 %x, ptr byval(%union.u) align 4 %some_union, ptr byval(%struct.s) align 4 %some_struct, ptr %a) #0 !dbg !7 {
 entry:
   %x.addr = alloca i32, align 4
-  %a.addr = alloca i32*, align 4
-  store i32 %x, i32* %x.addr, align 4
-  call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !23, metadata !DIExpression()), !dbg !24
-  call void @llvm.dbg.declare(metadata %union.u* %some_union, metadata !25, metadata !DIExpression()), !dbg !26
-  call void @llvm.dbg.declare(metadata %struct.s* %some_struct, metadata !27, metadata !DIExpression()), !dbg !28
-  store i32* %a, i32** %a.addr, align 4
-  call void @llvm.dbg.declare(metadata i32** %a.addr, metadata !29, metadata !DIExpression()), !dbg !30
-  %0 = load i32, i32* %x.addr, align 4, !dbg !31
-  %x1 = bitcast %union.u* %some_union to i32*, !dbg !32
-  %1 = load i32, i32* %x1, align 4, !dbg !32
+  %a.addr = alloca ptr, align 4
+  store i32 %x, ptr %x.addr, align 4
+  call void @llvm.dbg.declare(metadata ptr %x.addr, metadata !23, metadata !DIExpression()), !dbg !24
+  call void @llvm.dbg.declare(metadata ptr %some_union, metadata !25, metadata !DIExpression()), !dbg !26
+  call void @llvm.dbg.declare(metadata ptr %some_struct, metadata !27, metadata !DIExpression()), !dbg !28
+  store ptr %a, ptr %a.addr, align 4
+  call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !29, metadata !DIExpression()), !dbg !30
+  %0 = load i32, ptr %x.addr, align 4, !dbg !31
+  %1 = load i32, ptr %some_union, align 4, !dbg !32
   %add = add nsw i32 %0, %1, !dbg !33
-  %x2 = getelementptr inbounds %struct.s, %struct.s* %some_struct, i32 0, i32 0, !dbg !34
-  %2 = load i32, i32* %x2, align 4, !dbg !34
+  %2 = load i32, ptr %some_struct, align 4, !dbg !34
   %add3 = add nsw i32 %add, %2, !dbg !35
-  %3 = load i32*, i32** %a.addr, align 4, !dbg !36
-  %arrayidx = getelementptr inbounds i32, i32* %3, i32 0, !dbg !36
-  %4 = load i32, i32* %arrayidx, align 4, !dbg !36
+  %3 = load ptr, ptr %a.addr, align 4, !dbg !36
+  %4 = load i32, ptr %3, align 4, !dbg !36
   %add4 = add nsw i32 %add3, %4, !dbg !37
   ret i32 %add4, !dbg !38
 }

diff  --git a/llvm/test/MC/WebAssembly/debug-info.ll b/llvm/test/MC/WebAssembly/debug-info.ll
index a60557b65e3ba..0f8a7b0971622 100644
--- a/llvm/test/MC/WebAssembly/debug-info.ll
+++ b/llvm/test/MC/WebAssembly/debug-info.ll
@@ -270,8 +270,8 @@ target triple = "wasm32-unknown-unknown"
 source_filename = "test.c"
 
 @myextern = external global i32, align 4
- at foo = hidden global i32* @myextern, align 4, !dbg !0
- at ptr2 = hidden global void ()* @f2, align 4, !dbg !6
+ at foo = hidden global ptr @myextern, align 4, !dbg !0
+ at ptr2 = hidden global ptr @f2, align 4, !dbg !6
 
 ; Function Attrs: noinline nounwind optnone
 define hidden void @f2() #0 !dbg !17 {

diff  --git a/llvm/test/MC/WebAssembly/debug-info64.ll b/llvm/test/MC/WebAssembly/debug-info64.ll
index da204b9753a50..5ad27f61478d6 100644
--- a/llvm/test/MC/WebAssembly/debug-info64.ll
+++ b/llvm/test/MC/WebAssembly/debug-info64.ll
@@ -276,8 +276,8 @@ target triple = "wasm64-unknown-unknown"
 source_filename = "test.c"
 
 @myextern = external global i32, align 4
- at foo = hidden global i32* @myextern, align 4, !dbg !0
- at ptr2 = hidden global void ()* @f2, align 4, !dbg !6
+ at foo = hidden global ptr @myextern, align 4, !dbg !0
+ at ptr2 = hidden global ptr @f2, align 4, !dbg !6
 
 ; Function Attrs: noinline nounwind optnone
 define hidden void @f2() #0 !dbg !17 {

diff  --git a/llvm/test/MC/WebAssembly/debug-localvar.ll b/llvm/test/MC/WebAssembly/debug-localvar.ll
index 0174b7342fc3b..8cf3570cbd2f5 100644
--- a/llvm/test/MC/WebAssembly/debug-localvar.ll
+++ b/llvm/test/MC/WebAssembly/debug-localvar.ll
@@ -9,16 +9,16 @@ entry:
   %arg.addr = alloca i32, align 4
   %a = alloca i32, align 4
   %b = alloca i32, align 4
-  store i32 %arg, i32* %arg.addr, align 4
-  call void @llvm.dbg.declare(metadata i32* %arg.addr, metadata !11, metadata !DIExpression()), !dbg !12
-  call void @llvm.dbg.declare(metadata i32* %a, metadata !13, metadata !DIExpression()), !dbg !14
-  store i32 1, i32* %a, align 4, !dbg !14
-  call void @llvm.dbg.declare(metadata i32* %b, metadata !15, metadata !DIExpression()), !dbg !17
-  store i32 2, i32* %b, align 4, !dbg !17
-  %0 = load i32, i32* %b, align 4, !dbg !18
-  store i32 %0, i32* %arg.addr, align 4, !dbg !19
-  %1 = load i32, i32* %arg.addr, align 4, !dbg !20
-  %2 = load i32, i32* %a, align 4, !dbg !21
+  store i32 %arg, ptr %arg.addr, align 4
+  call void @llvm.dbg.declare(metadata ptr %arg.addr, metadata !11, metadata !DIExpression()), !dbg !12
+  call void @llvm.dbg.declare(metadata ptr %a, metadata !13, metadata !DIExpression()), !dbg !14
+  store i32 1, ptr %a, align 4, !dbg !14
+  call void @llvm.dbg.declare(metadata ptr %b, metadata !15, metadata !DIExpression()), !dbg !17
+  store i32 2, ptr %b, align 4, !dbg !17
+  %0 = load i32, ptr %b, align 4, !dbg !18
+  store i32 %0, ptr %arg.addr, align 4, !dbg !19
+  %1 = load i32, ptr %arg.addr, align 4, !dbg !20
+  %2 = load i32, ptr %a, align 4, !dbg !21
   %add = add nsw i32 %1, %2, !dbg !22
   ret i32 %add, !dbg !23
 }

diff  --git a/llvm/test/MC/WebAssembly/debug-template-param.ll b/llvm/test/MC/WebAssembly/debug-template-param.ll
index 6f17f1c06a772..51cfda61859c9 100644
--- a/llvm/test/MC/WebAssembly/debug-template-param.ll
+++ b/llvm/test/MC/WebAssembly/debug-template-param.ll
@@ -59,7 +59,7 @@ attributes #1 = { "frame-pointer"="none" "no-trapping-math"="true" "stack-protec
 !13 = !{!14, !16}
 !14 = !DITemplateTypeParameter(type: !15)
 !15 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
-!16 = !DITemplateValueParameter(name: "b", type: !17, value: i8 ()* @_Z1av)
+!16 = !DITemplateValueParameter(name: "b", type: !17, value: ptr @_Z1av)
 !17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !18, size: 32)
 !18 = !DISubroutineType(types: !19)
 !19 = !{!15}

diff  --git a/llvm/test/MC/WebAssembly/dwarfdump.ll b/llvm/test/MC/WebAssembly/dwarfdump.ll
index cb2e3e613af9b..b6a625b15fcd2 100644
--- a/llvm/test/MC/WebAssembly/dwarfdump.ll
+++ b/llvm/test/MC/WebAssembly/dwarfdump.ll
@@ -116,8 +116,8 @@ target triple = "wasm32-unknown-unknown"
 source_filename = "test.c"
 
 @myextern = external global i32, align 4
- at foo = hidden global i32* @myextern, align 4, !dbg !0
- at ptr2 = hidden global void ()* @f2, align 4, !dbg !6
+ at foo = hidden global ptr @myextern, align 4, !dbg !0
+ at ptr2 = hidden global ptr @f2, align 4, !dbg !6
 
 ; Function Attrs: noinline nounwind optnone
 define hidden void @f2() #0 !dbg !17 {

diff  --git a/llvm/test/MC/WebAssembly/dwarfdump64.ll b/llvm/test/MC/WebAssembly/dwarfdump64.ll
index 603f610c4dff7..c5c0256560144 100644
--- a/llvm/test/MC/WebAssembly/dwarfdump64.ll
+++ b/llvm/test/MC/WebAssembly/dwarfdump64.ll
@@ -61,8 +61,8 @@ target triple = "wasm64-unknown-unknown"
 source_filename = "test.c"
 
 @myextern = external global i32, align 4
- at foo = hidden global i32* @myextern, align 4, !dbg !0
- at ptr2 = hidden global void ()* @f2, align 4, !dbg !6
+ at foo = hidden global ptr @myextern, align 4, !dbg !0
+ at ptr2 = hidden global ptr @f2, align 4, !dbg !6
 
 ; Function Attrs: noinline nounwind optnone
 define hidden void @f2() #0 !dbg !17 {

diff  --git a/llvm/test/MC/WebAssembly/extern-functype-intrinsic.ll b/llvm/test/MC/WebAssembly/extern-functype-intrinsic.ll
index f2677262e3b96..320b65356ba9f 100644
--- a/llvm/test/MC/WebAssembly/extern-functype-intrinsic.ll
+++ b/llvm/test/MC/WebAssembly/extern-functype-intrinsic.ll
@@ -9,15 +9,15 @@ target triple = "wasm32-unknown-wasi"
 ; Function Attrs: nounwind
 define hidden i32 @d() local_unnamed_addr #0 {
 entry:
-  %0 = call i32 bitcast (i32 (...)* @g to i32 ()*)() #3
-  call void @llvm.memset.p0i8.i32(i8* nonnull align 4 inttoptr (i32 4 to i8*), i8 0, i32 %0, i1 false)                                        ; preds = %for.body.preheader, %entry
+  %0 = call i32 @g() #3
+  call void @llvm.memset.p0.i32(ptr nonnull align 4 inttoptr (i32 4 to ptr), i8 0, i32 %0, i1 false)                                        ; preds = %for.body.preheader, %entry
   ret i32 undef
 }
 
 declare i32 @g(...) local_unnamed_addr #1
 
 ; Function Attrs: argmemonly nofree nounwind willreturn writeonly
-declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #2
+declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #2
 
 attributes #0 = { nounwind "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" }
 attributes #1 = { "frame-pointer"="none" "no-prototype" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" }

diff  --git a/llvm/test/MC/WebAssembly/external-data.ll b/llvm/test/MC/WebAssembly/external-data.ll
index e643b196af70f..8c51873121265 100644
--- a/llvm/test/MC/WebAssembly/external-data.ll
+++ b/llvm/test/MC/WebAssembly/external-data.ll
@@ -8,7 +8,7 @@ target triple = "wasm32-unknown-unknown"
 @myimport = external global i32, align 4
 
 @foo = global i64 7, align 4
- at bar = hidden global i32* @myimport, align 4
+ at bar = hidden global ptr @myimport, align 4
 
 ; CHECK:        - Type:            DATA{{$}}
 ; CHECK-NEXT:     Relocations:

diff  --git a/llvm/test/MC/WebAssembly/external-func-address.ll b/llvm/test/MC/WebAssembly/external-func-address.ll
index 5481a4b1e7f8f..53ef1cfc1bb85 100644
--- a/llvm/test/MC/WebAssembly/external-func-address.ll
+++ b/llvm/test/MC/WebAssembly/external-func-address.ll
@@ -6,12 +6,12 @@ target triple = "wasm32-unknown-unknown"
 ; imports and relocations of type R_TABLE_INDEX_I32.
 
 declare void @f0(i32) #0
- at ptr_to_f0 = hidden global void (i32)* @f0, align 4
+ at ptr_to_f0 = hidden global ptr @f0, align 4
 
 attributes #0 = { "wasm-import-module"="somewhere" "wasm-import-name"="something" }
 
 declare void @f1(i32) #1
- at ptr_to_f1 = hidden global void (i32)* @f1, align 4
+ at ptr_to_f1 = hidden global ptr @f1, align 4
 
 ; Check that varargs functions have correctly typed imports
 declare i32 @varargs(i32, i32, ...)

diff  --git a/llvm/test/MC/WebAssembly/func-address.ll b/llvm/test/MC/WebAssembly/func-address.ll
index 7ec1e38debf0a..feeb1dff96866 100644
--- a/llvm/test/MC/WebAssembly/func-address.ll
+++ b/llvm/test/MC/WebAssembly/func-address.ll
@@ -19,8 +19,8 @@ entry:
 ; function.
 define hidden void @call_indirect() #0 {
 entry:
-  %adr = alloca i32 ()*, align 4
-  store i32 ()* @import3, i32 ()** %adr, align 4
+  %adr = alloca ptr, align 4
+  store ptr @import3, ptr %adr, align 4
   ret void
 }
 

diff  --git a/llvm/test/MC/WebAssembly/function-alias.ll b/llvm/test/MC/WebAssembly/function-alias.ll
index 770beb1d15cd1..6722d18fe7cc8 100644
--- a/llvm/test/MC/WebAssembly/function-alias.ll
+++ b/llvm/test/MC/WebAssembly/function-alias.ll
@@ -3,13 +3,13 @@
 
 target triple = "wasm32-unknown-unknown-wasm"
 
- at foo = alias i8, bitcast (i8* ()* @func to i8*)
- at bar = alias i8* (), i8* ()* @func
- at bar2 = alias i8* (), i8* ()* @bar
+ at foo = alias i8, ptr @func
+ at bar = alias ptr (), ptr @func
+ at bar2 = alias ptr (), ptr @bar
 
-define i8* @func() {
-  call i8* @bar2();
-  ret i8* @foo;
+define ptr @func() {
+  call ptr @bar2();
+  ret ptr @foo;
 }
 
 ; CHECK:      Symbols [

diff  --git a/llvm/test/MC/WebAssembly/global-ctor-dtor.ll b/llvm/test/MC/WebAssembly/global-ctor-dtor.ll
index 97b40e8a5d4bb..bc1be79313496 100644
--- a/llvm/test/MC/WebAssembly/global-ctor-dtor.ll
+++ b/llvm/test/MC/WebAssembly/global-ctor-dtor.ll
@@ -9,14 +9,14 @@ declare void @func1()
 declare void @func2()
 declare void @func3()
 
- at llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [
-  { i32, void ()*, i8* } { i32 65535, void ()* @func0, i8* null },
-  { i32, void ()*, i8* } { i32 42,    void ()* @func1, i8* null }
+ at llvm.global_ctors = appending global [2 x { i32, ptr, ptr }] [
+  { i32, ptr, ptr } { i32 65535, ptr @func0, ptr null },
+  { i32, ptr, ptr } { i32 42,    ptr @func1, ptr null }
 ]
 
- at llvm.global_dtors = appending global [2 x { i32, void ()*, i8* }] [
-  { i32, void ()*, i8* } { i32 65535, void ()* @func2, i8* null },
-  { i32, void ()*, i8* } { i32 42,    void ()* @func3, i8* null }
+ at llvm.global_dtors = appending global [2 x { i32, ptr, ptr }] [
+  { i32, ptr, ptr } { i32 65535, ptr @func2, ptr null },
+  { i32, ptr, ptr } { i32 42,    ptr @func3, ptr null }
 ]
 
 ; CHECK:        - Type:            IMPORT

diff  --git a/llvm/test/MC/WebAssembly/libcall.ll b/llvm/test/MC/WebAssembly/libcall.ll
index c19e1a24c9635..8b81f150da892 100644
--- a/llvm/test/MC/WebAssembly/libcall.ll
+++ b/llvm/test/MC/WebAssembly/libcall.ll
@@ -2,13 +2,13 @@
 
 target triple = "wasm32-unknown-unknown"
 
-define hidden void @call_memcpy(i8* align 4 %a, i8* align 4 %b) {
+define hidden void @call_memcpy(ptr align 4 %a, ptr align 4 %b) {
 entry:
-  tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %a, i8* align 4 %b, i32 512, i1 false)
+  tail call void @llvm.memcpy.p0.p0.i32(ptr align 4 %a, ptr align 4 %b, i32 512, i1 false)
   ret void
 }
 
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture writeonly, i8* nocapture readonly, i32, i1)
+declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1)
 
 ; CHECK:      --- !WASM
 ; CHECK-NEXT: FileHeader:

diff  --git a/llvm/test/MC/WebAssembly/no-dead-strip.ll b/llvm/test/MC/WebAssembly/no-dead-strip.ll
index e828c41b6e363..9b550ec6cefbc 100644
--- a/llvm/test/MC/WebAssembly/no-dead-strip.ll
+++ b/llvm/test/MC/WebAssembly/no-dead-strip.ll
@@ -2,7 +2,7 @@
 
 target triple = "wasm32-unknown-unknown"
 
- at llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @foo to i8*)], section "llvm.metadata"
+ at llvm.used = appending global [1 x ptr] [ptr @foo], section "llvm.metadata"
 
 define i32 @foo() {
 entry:

diff  --git a/llvm/test/MC/WebAssembly/offset.ll b/llvm/test/MC/WebAssembly/offset.ll
index 5679145d293de..b5fc977c8398d 100644
--- a/llvm/test/MC/WebAssembly/offset.ll
+++ b/llvm/test/MC/WebAssembly/offset.ll
@@ -8,7 +8,7 @@ target triple = "wasm32-unknown-unknown"
 ; CHECK-NEXT:         Locals:
 ; CHECK-NEXT:         Body:            41002802FFFFFFFF0F0B
 define i32 @load_i32_from_negative_address() {
-  %t = load i32, i32* inttoptr (i32 -1 to i32*)
+  %t = load i32, ptr inttoptr (i32 -1 to ptr)
   ret i32 %t
 }
 
@@ -16,6 +16,6 @@ define i32 @load_i32_from_negative_address() {
 ; CHECK-NEXT:         Locals:
 ; CHECK-NEXT:         Body:            41002802030B
 define i32 @load_i32_from_wrapped_address() {
-  %t = load i32, i32* inttoptr (i32 4294967299 to i32*)
+  %t = load i32, ptr inttoptr (i32 4294967299 to ptr)
   ret i32 %t
 }

diff  --git a/llvm/test/MC/WebAssembly/reloc-data.ll b/llvm/test/MC/WebAssembly/reloc-data.ll
index 78176326f2451..224d09eea3879 100644
--- a/llvm/test/MC/WebAssembly/reloc-data.ll
+++ b/llvm/test/MC/WebAssembly/reloc-data.ll
@@ -7,9 +7,9 @@ target triple = "wasm32-unknown-unknown"
 
 @foo = external global i32, align 4
 @bar = global i64 7, align 4
- at a = global i32* getelementptr (i32, i32* @foo, i32 2), align 8
- at b = global i64* getelementptr (i64, i64* @bar, i64 -2), align 8
- at c = global [3 x i32*] [i32* @foo, i32* @foo, i32* @foo], align 16
+ at a = global ptr getelementptr (i32, ptr @foo, i32 2), align 8
+ at b = global ptr getelementptr (i64, ptr @bar, i64 -2), align 8
+ at c = global [3 x ptr] [ptr @foo, ptr @foo, ptr @foo], align 16
 
 ; CHECK:      Format: WASM
 ; CHECK:      Relocations [

diff  --git a/llvm/test/MC/WebAssembly/reloc-relative.ll b/llvm/test/MC/WebAssembly/reloc-relative.ll
index a581f78c3eddf..47f719bfecec0 100644
--- a/llvm/test/MC/WebAssembly/reloc-relative.ll
+++ b/llvm/test/MC/WebAssembly/reloc-relative.ll
@@ -30,19 +30,19 @@ target triple = "wasm32-unknown-unknown"
 ; @foo - @bar
 @foo = external global i32, align 4
 @bar = constant i32 sub (
-    i32 ptrtoint (i32* @foo to i32),
-    i32 ptrtoint (i32* @bar to i32)
+    i32 ptrtoint (ptr @foo to i32),
+    i32 ptrtoint (ptr @bar to i32)
 ), section ".sec1"
 
 
 ; @foo - @addend + 4
 @fizz = constant i32 42, align 4, section ".sec2"
 @addend = constant i32 sub (
-    i32 ptrtoint (i32* @foo to i32),
-    i32 ptrtoint (i32* @fizz to i32)
+    i32 ptrtoint (ptr @foo to i32),
+    i32 ptrtoint (ptr @fizz to i32)
 ), section ".sec2"
 
 @x_sec = constant i32 sub (
-    i32 ptrtoint (i32* @fizz to i32),
-    i32 ptrtoint (i32* @x_sec to i32)
+    i32 ptrtoint (ptr @fizz to i32),
+    i32 ptrtoint (ptr @x_sec to i32)
 ), section ".sec1"

diff  --git a/llvm/test/MC/WebAssembly/tag-section-decoding.ll b/llvm/test/MC/WebAssembly/tag-section-decoding.ll
index d872047f27414..4e3b7688e4806 100644
--- a/llvm/test/MC/WebAssembly/tag-section-decoding.ll
+++ b/llvm/test/MC/WebAssembly/tag-section-decoding.ll
@@ -7,7 +7,7 @@
 
 target triple = "wasm32-unknown-unknown"
 
-declare void @llvm.wasm.throw(i32, i8*)
+declare void @llvm.wasm.throw(i32, ptr)
 
 define i32 @dummy0() {
 entry:
@@ -329,8 +329,8 @@ entry:
   ret i32 0
 }
 
-define i32 @test_throw(i8* %p) {
-  call void @llvm.wasm.throw(i32 0, i8* %p)
+define i32 @test_throw(ptr %p) {
+  call void @llvm.wasm.throw(i32 0, ptr %p)
   ret i32 0
 }
 

diff  --git a/llvm/test/MC/WebAssembly/tag-section.ll b/llvm/test/MC/WebAssembly/tag-section.ll
index d9eb62d8e9b50..c40e132e36f04 100644
--- a/llvm/test/MC/WebAssembly/tag-section.ll
+++ b/llvm/test/MC/WebAssembly/tag-section.ll
@@ -3,15 +3,15 @@
 
 target triple = "wasm32-unknown-unknown"
 
-declare void @llvm.wasm.throw(i32, i8*)
+declare void @llvm.wasm.throw(i32, ptr)
 
-define i32 @test_throw0(i8* %p) {
-  call void @llvm.wasm.throw(i32 0, i8* %p)
+define i32 @test_throw0(ptr %p) {
+  call void @llvm.wasm.throw(i32 0, ptr %p)
   ret i32 0
 }
 
-define i32 @test_throw1(i8* %p) {
-  call void @llvm.wasm.throw(i32 0, i8* %p)
+define i32 @test_throw1(ptr %p) {
+  call void @llvm.wasm.throw(i32 0, ptr %p)
   ret i32 1
 }
 

diff  --git a/llvm/test/MC/WebAssembly/unnamed-data.ll b/llvm/test/MC/WebAssembly/unnamed-data.ll
index 398d53c826374..0887622277bb3 100644
--- a/llvm/test/MC/WebAssembly/unnamed-data.ll
+++ b/llvm/test/MC/WebAssembly/unnamed-data.ll
@@ -5,8 +5,8 @@ target triple = "wasm32-unknown-unknown"
 @.str1 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
 @.str2 = private unnamed_addr constant [6 x i8] c"world\00", align 1
 
- at a = global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str1, i32 0, i32 0), align 8
- at b = global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str2, i32 0, i32 0), align 8
+ at a = global ptr @.str1, align 8
+ at b = global ptr @.str2, align 8
 
 
 ; CHECK:        - Type:            DATA{{$}}

diff  --git a/llvm/test/MC/X86/intel-syntax-var-offset.ll b/llvm/test/MC/X86/intel-syntax-var-offset.ll
index b38f09ab6f860..1fd131c636d3a 100644
--- a/llvm/test/MC/X86/intel-syntax-var-offset.ll
+++ b/llvm/test/MC/X86/intel-syntax-var-offset.ll
@@ -30,20 +30,20 @@
 ; CHECK:	mov	rdx, offset X
 ; CHECK:	mov	qword ptr [PX], rdx
 
- at PZ = common dso_local global i8* null, align 8
+ at PZ = common dso_local global ptr null, align 8
 @Z = common dso_local global [4 x i8] zeroinitializer, align 1
 @X = common dso_local global [4 x i8] zeroinitializer, align 1
- at PX = common dso_local global i8* null, align 8
+ at PX = common dso_local global ptr null, align 8
 @Y = common dso_local global [4 x i8] zeroinitializer, align 1
- at PY = common dso_local global i8* null, align 8
+ at PY = common dso_local global ptr null, align 8
 
-define dso_local i8* @test057(i64 %x) {
+define dso_local ptr @test057(i64 %x) {
 entry:
   %x.addr = alloca i64, align 8
-  store i64 %x, i64* %x.addr, align 8
-  %0 = call i8* asm "movq $1, %rax;movq %rax, $0;pushq $$Y;popq %rcx;movq %rcx, PY;movq $$X, %rdx;movq %rdx, PX;", "=r,im,~{rax},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @Z, i32 0, i32 0))
-  store i8* %0, i8** @PZ, align 8
-  %1 = load i8*, i8** @PZ, align 8
-  ret i8* %1
+  store i64 %x, ptr %x.addr, align 8
+  %0 = call ptr asm "movq $1, %rax;movq %rax, $0;pushq $$Y;popq %rcx;movq %rcx, PY;movq $$X, %rdx;movq %rdx, PX;", "=r,im,~{rax},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr @Z)
+  store ptr %0, ptr @PZ, align 8
+  %1 = load ptr, ptr @PZ, align 8
+  ret ptr %1
 }
 


        


More information about the llvm-commits mailing list