[llvm] b05c718 - [Verifier] Convert tests to opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 07:55:04 PST 2023


Author: Nikita Popov
Date: 2023-01-10T16:54:55+01:00
New Revision: b05c71814c3b9f91a2e00af891d67a83790a109c

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

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

Some tests are removed because they check conditions that
are not relevant with opaque pointers.

Added: 
    

Modified: 
    llvm/test/Verifier/bitcast-address-space-nested-global-cycle.ll
    llvm/test/Verifier/bitcast-address-space-nested-global.ll
    llvm/test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll
    llvm/test/Verifier/bitcast-address-space-through-constant-inttoptr.ll
    llvm/test/Verifier/bitcast-address-space-through-gep.ll
    llvm/test/Verifier/bitcast-address-spaces.ll
    llvm/test/Verifier/bitcast-alias-address-space.ll
    llvm/test/Verifier/bitcast-pointer-vector-neg.ll
    llvm/test/Verifier/bitcast-vector-pointer-pos.ll
    llvm/test/Verifier/byref.ll
    llvm/test/Verifier/elementtype.ll
    llvm/test/Verifier/gcroot.ll
    llvm/test/Verifier/global-ctors-2.ll
    llvm/test/Verifier/ifunc.ll
    llvm/test/Verifier/inalloca1.ll
    llvm/test/Verifier/inline-asm-indirect-operand.ll
    llvm/test/Verifier/intrinsic-immarg.ll
    llvm/test/Verifier/invalid-statepoint.ll
    llvm/test/Verifier/matrix-intrinsics.ll
    llvm/test/Verifier/preallocated-invalid.ll
    llvm/test/Verifier/scatter_gather.ll
    llvm/test/Verifier/swifterror.ll

Removed: 
    llvm/test/Verifier/2006-10-15-AddrLabel.ll
    llvm/test/Verifier/2010-08-07-PointerIntrinsic.ll
    llvm/test/Verifier/x86_amx8.ll


################################################################################
diff  --git a/llvm/test/Verifier/2006-10-15-AddrLabel.ll b/llvm/test/Verifier/2006-10-15-AddrLabel.ll
deleted file mode 100644
index bd2c40da14f50..0000000000000
--- a/llvm/test/Verifier/2006-10-15-AddrLabel.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: not llvm-as < %s > /dev/null 2> %t
-; RUN: FileCheck %s --input-file=%t
-; CHECK: basic block pointers are invalid
-
-define i32 @main() {
-         %foo  = call i8* %llvm.stacksave()
-         %foop = bitcast i8* %foo to label*
-         %nret = load label, label* %foop
-         br label %nret
-}

diff  --git a/llvm/test/Verifier/2010-08-07-PointerIntrinsic.ll b/llvm/test/Verifier/2010-08-07-PointerIntrinsic.ll
deleted file mode 100644
index a63e8e7c54bf2..0000000000000
--- a/llvm/test/Verifier/2010-08-07-PointerIntrinsic.ll
+++ /dev/null
@@ -1,29 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-; CHECK: assembly parsed, but does not verify as correct
-; PR7316
-
-; XFAIL: *
-; The test case is buggy, it supposed to check that we reject memcpy with vector
-; pointer arguments. Now we don't reject such memcpy and the test case would
-; fail if it was correct. Because it used the wrong signature for memcpy (the
-; last isVolatile argument was missing) it was rejected by the verifier and
-; didn't fail. Fix the memcpy signature and mark it as an expected failure
-; for now.
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32"
-target triple = "x86-unknown-unknown"
- at aa = global [32 x i8] zeroinitializer, align 1
- at bb = global [16 x i8] zeroinitializer, align 1
-define void @x() nounwind {
-L.0:
-	%0 = getelementptr [32 x i8], [32 x i8]* @aa, i32 0, i32 4
-	%1 = bitcast i8* %0 to [16 x i8]*
-	%2 = bitcast [16 x i8]* %1 to [0 x i8]*
-	%3 = getelementptr [16 x i8], [16 x i8]* @bb
-	%4 = bitcast [16 x i8]* %3 to [0 x i8]*
-	call void @llvm.memcpy.p0a0i8.p0a0i8.i32([0 x i8]* %2, [0 x i8]* %4, i32 16, i32 1, i1 false)
-	br label %return
-return:
-	ret void
-}
-declare void @llvm.memcpy.p0a0i8.p0a0i8.i32([0 x i8]* nocapture, [0 x i8]* nocapture readonly, i32, i1) nounwind

diff  --git a/llvm/test/Verifier/bitcast-address-space-nested-global-cycle.ll b/llvm/test/Verifier/bitcast-address-space-nested-global-cycle.ll
index 3c67aa9e7f2d0..aa2f99836ec35 100644
--- a/llvm/test/Verifier/bitcast-address-space-nested-global-cycle.ll
+++ b/llvm/test/Verifier/bitcast-address-space-nested-global-cycle.ll
@@ -1,10 +1,10 @@
 ; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
 
-; CHECK: error: invalid cast opcode for cast from '%struct.Self1*' to '%struct.Self1 addrspace(1)*'
+; CHECK: error: invalid cast opcode for cast from 'ptr' to 'ptr addrspace(1)'
 
 target datalayout = "e-p:32:32:32-p1:16:16:16-p2:8:8:8-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
 
-%struct.Self1 = type { %struct.Self1 addrspace(1)* }
+%struct.Self1 = type { ptr addrspace(1) }
 
- at cycle1 = addrspace(1) constant %struct.Self1 { %struct.Self1 addrspace(1)* bitcast (%struct.Self1 addrspace(0)* @cycle0 to %struct.Self1 addrspace(1)*) }
- at cycle0 = addrspace(0) constant %struct.Self1 { %struct.Self1 addrspace(1)* @cycle1 }
+ at cycle1 = addrspace(1) constant %struct.Self1 { ptr addrspace(1) bitcast (ptr @cycle0 to ptr addrspace(1)) }
+ at cycle0 = addrspace(0) constant %struct.Self1 { ptr addrspace(1) @cycle1 }

diff  --git a/llvm/test/Verifier/bitcast-address-space-nested-global.ll b/llvm/test/Verifier/bitcast-address-space-nested-global.ll
index a79669058e589..605a802832674 100644
--- a/llvm/test/Verifier/bitcast-address-space-nested-global.ll
+++ b/llvm/test/Verifier/bitcast-address-space-nested-global.ll
@@ -1,13 +1,13 @@
 ; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
 
-; CHECK: error: invalid cast opcode for cast from '%struct.Self1*' to '%struct.Self1 addrspace(1)*'
+; CHECK: error: invalid cast opcode for cast from 'ptr' to 'ptr addrspace(1)'
 
 target datalayout = "e-p:32:32:32-p1:16:16:16-p2:8:8:8-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
 
 
-%struct.Self1 = type { %struct.Self1 addrspace(1)* }
+%struct.Self1 = type { ptr addrspace(1) }
 
- at nestedD = constant %struct.Self1 { %struct.Self1 addrspace(1)* bitcast (%struct.Self1 addrspace(0)* @nestedC to %struct.Self1 addrspace(1)*) }
- at nestedC = constant %struct.Self1 { %struct.Self1 addrspace(1)* bitcast (%struct.Self1 addrspace(0)* @nestedB to %struct.Self1 addrspace(1)*) }
- at nestedB = constant %struct.Self1 { %struct.Self1 addrspace(1)* bitcast (%struct.Self1 addrspace(0)* @nestedA to %struct.Self1 addrspace(1)*) }
- at nestedA = constant %struct.Self1 { %struct.Self1 addrspace(1)* null }
+ at nestedD = constant %struct.Self1 { ptr addrspace(1) bitcast (ptr @nestedC to ptr addrspace(1)) }
+ at nestedC = constant %struct.Self1 { ptr addrspace(1) bitcast (ptr @nestedB to ptr addrspace(1)) }
+ at nestedB = constant %struct.Self1 { ptr addrspace(1) bitcast (ptr @nestedA to ptr addrspace(1)) }
+ at nestedA = constant %struct.Self1 { ptr addrspace(1) null }

diff  --git a/llvm/test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll b/llvm/test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll
index 6e91164e04382..8ea9b6deb68b2 100644
--- a/llvm/test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll
+++ b/llvm/test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll
@@ -2,12 +2,12 @@
 
 target datalayout = "e-p:32:32:32-p1:16:16:16-p2:8:8:8-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
 
-; CHECK:  error: invalid cast opcode for cast from 'i32 addrspace(1)*' to 'i32 addrspace(2)*'
+; CHECK:  error: invalid cast opcode for cast from 'ptr addrspace(1)' to 'ptr addrspace(2)'
 
 ; Check that we can find inttoptr -> illegal bitcasts when hidden
 ; inside constantexpr pointer operands
-define i32 addrspace(2)* @illegal_bitcast_inttoptr_as_1_to_2_inside_gep() {
-  %cast = getelementptr i32, i32 addrspace(2)* bitcast (i32 addrspace(1)* inttoptr (i32 1234 to i32 addrspace(1)*) to i32 addrspace(2)*), i32 3
-  ret i32 addrspace(2)* %cast
+define ptr addrspace(2) @illegal_bitcast_inttoptr_as_1_to_2_inside_gep() {
+  %cast = getelementptr i32, ptr addrspace(2) bitcast (ptr addrspace(1) inttoptr (i32 1234 to ptr addrspace(1)) to ptr addrspace(2)), i32 3
+  ret ptr addrspace(2) %cast
 }
 

diff  --git a/llvm/test/Verifier/bitcast-address-space-through-constant-inttoptr.ll b/llvm/test/Verifier/bitcast-address-space-through-constant-inttoptr.ll
index 1affda418aa30..133a798576e92 100644
--- a/llvm/test/Verifier/bitcast-address-space-through-constant-inttoptr.ll
+++ b/llvm/test/Verifier/bitcast-address-space-through-constant-inttoptr.ll
@@ -3,11 +3,11 @@
 target datalayout = "e-p:32:32:32-p1:16:16:16-p2:8:8:8-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
 
 
-%struct.Foo = type { i32 addrspace(1)* }
+%struct.Foo = type { ptr addrspace(1) }
 
-; CHECK: error: invalid cast opcode for cast from 'i32 addrspace(2)*' to 'i32 addrspace(1)*'
+; CHECK: error: invalid cast opcode for cast from 'ptr addrspace(2)' to 'ptr addrspace(1)'
 
 ; Make sure we still reject the bitcast when the source is a inttoptr (constant int) in a global initializer
- at bitcast_after_constant_inttoptr_initializer = global %struct.Foo { i32 addrspace(1)* bitcast (i32 addrspace(2)* inttoptr (i8 7 to i32 addrspace(2)*) to i32 addrspace(1)*) }
+ at bitcast_after_constant_inttoptr_initializer = global %struct.Foo { ptr addrspace(1) bitcast (ptr addrspace(2) inttoptr (i8 7 to ptr addrspace(2)) to ptr addrspace(1)) }
 
 

diff  --git a/llvm/test/Verifier/bitcast-address-space-through-gep.ll b/llvm/test/Verifier/bitcast-address-space-through-gep.ll
index 3d3fb9f20001d..659aeb313536a 100644
--- a/llvm/test/Verifier/bitcast-address-space-through-gep.ll
+++ b/llvm/test/Verifier/bitcast-address-space-through-gep.ll
@@ -2,14 +2,14 @@
 
 target datalayout = "e-p:32:32:32-p1:16:16:16-p2:8:8:8-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
 
-%struct.Foo = type { i32 addrspace(1)* }
+%struct.Foo = type { ptr addrspace(1) }
 
 
 @as2_array = addrspace(2) global [32 x i32] zeroinitializer
 
-; CHECK: error: invalid cast opcode for cast from 'i32 addrspace(2)*' to 'i32 addrspace(1)*'
+; CHECK: error: invalid cast opcode for cast from 'ptr addrspace(2)' to 'ptr addrspace(1)'
 
 ; Make sure we still reject the bitcast after the value is accessed through a GEP
- at bitcast_after_gep = global %struct.Foo { i32 addrspace(1)* bitcast (i32 addrspace(2)* getelementptr ([32 x i32], [32 x i32] addrspace(2)* @as2_array, i32 0, i32 8) to i32 addrspace(1)*) }
+ at bitcast_after_gep = global %struct.Foo { ptr bitcast (ptr addrspace(2) getelementptr ([32 x i32], ptr addrspace(2) @as2_array, i32 0, i32 8) to ptr addrspace(1)) }
 
 

diff  --git a/llvm/test/Verifier/bitcast-address-spaces.ll b/llvm/test/Verifier/bitcast-address-spaces.ll
index 7f37df66b306e..d809bf6469c20 100644
--- a/llvm/test/Verifier/bitcast-address-spaces.ll
+++ b/llvm/test/Verifier/bitcast-address-spaces.ll
@@ -2,9 +2,9 @@
 
 target datalayout = "e-p:32:32:32-p1:16:16:16-p2:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
 
-; CHECK: error: invalid cast opcode for cast from 'i32*' to 'i32 addrspace(1)*'
-define i32 addrspace(1)* @illegal_bitcast_as_0_to_1(i32 addrspace(0) *%p) {
-  %cast = bitcast i32 addrspace(0)* %p to i32 addrspace(1)*
-  ret i32 addrspace(1)* %cast
+; CHECK: error: invalid cast opcode for cast from 'ptr' to 'ptr addrspace(1)'
+define ptr addrspace(1) @illegal_bitcast_as_0_to_1(ptr addrspace(0) %p) {
+  %cast = bitcast ptr %p to ptr addrspace(1)
+  ret ptr addrspace(1) %cast
 }
 

diff  --git a/llvm/test/Verifier/bitcast-alias-address-space.ll b/llvm/test/Verifier/bitcast-alias-address-space.ll
index d5f2266aa6190..bac9dd94b2a04 100644
--- a/llvm/test/Verifier/bitcast-alias-address-space.ll
+++ b/llvm/test/Verifier/bitcast-alias-address-space.ll
@@ -1,10 +1,10 @@
 ; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
 
-; CHECK: error: invalid cast opcode for cast from 'i32 addrspace(2)*' to 'i32 addrspace(1)*'
+; CHECK: error: invalid cast opcode for cast from 'ptr addrspace(2)' to 'ptr addrspace(1)'
 
 target datalayout = "e-p:32:32:32-p1:16:16:16-p2:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
 
 
 @data = addrspace(2) global i32 27
 
- at illegal_alias_data = alias i32, bitcast (i32 addrspace(2)* @data to i32 addrspace(1)*)
+ at illegal_alias_data = alias i32, bitcast (ptr addrspace(2) @data to ptr addrspace(1))

diff  --git a/llvm/test/Verifier/bitcast-pointer-vector-neg.ll b/llvm/test/Verifier/bitcast-pointer-vector-neg.ll
index 68b67725471c0..e1078a5662992 100644
--- a/llvm/test/Verifier/bitcast-pointer-vector-neg.ll
+++ b/llvm/test/Verifier/bitcast-pointer-vector-neg.ll
@@ -2,9 +2,9 @@
 
 target datalayout = "e-p:32:32:32-p1:16:16:16-p2:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
 
-; CHECK: error: invalid cast opcode for cast from 'i64*' to '<2 x i32*>'
+; CHECK: error: invalid cast opcode for cast from 'ptr' to '<2 x ptr>'
 
-define <2 x i32*> @illegal_bitcast_pointer_to_vector_of_pointers(i64* %a) {
-  %b = bitcast i64* %a to <2 x i32*>
-  ret <2 x i32*> %b
+define <2 x ptr> @illegal_bitcast_pointer_to_vector_of_pointers(ptr %a) {
+  %b = bitcast ptr %a to <2 x ptr>
+  ret <2 x ptr> %b
 }

diff  --git a/llvm/test/Verifier/bitcast-vector-pointer-pos.ll b/llvm/test/Verifier/bitcast-vector-pointer-pos.ll
index 6a08f1135c880..444e740857bb8 100644
--- a/llvm/test/Verifier/bitcast-vector-pointer-pos.ll
+++ b/llvm/test/Verifier/bitcast-vector-pointer-pos.ll
@@ -2,13 +2,13 @@
 
 target datalayout = "e-p:32:32:32-p1:16:16:16-p2:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
 
-define <1 x i32*> @vector_legal_bitcast_pointer_to_vector_of_pointers(i64* %a) {
-  %b = bitcast i64* %a to <1 x i32*>
-  ret <1 x i32*> %b
+define <1 x ptr> @vector_legal_bitcast_pointer_to_vector_of_pointers(ptr %a) {
+  %b = bitcast ptr %a to <1 x ptr>
+  ret <1 x ptr> %b
 }
 
-define i64* @vector_legal_bitcast_vector_of_pointers_to_pointer(<1 x i32*> %a) {
-  %b = bitcast <1 x i32*> %a to i64*
-  ret i64* %b
+define ptr @vector_legal_bitcast_vector_of_pointers_to_pointer(<1 x ptr> %a) {
+  %b = bitcast <1 x ptr> %a to ptr
+  ret ptr %b
 }
 

diff  --git a/llvm/test/Verifier/byref.ll b/llvm/test/Verifier/byref.ll
index 6a8df2df2724c..f7b0e84cd9008 100644
--- a/llvm/test/Verifier/byref.ll
+++ b/llvm/test/Verifier/byref.ll
@@ -1,100 +1,87 @@
 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
 
-; CHECK: Attribute 'byref' type does not match parameter!
-; CHECK-NEXT: void (i32*)* @byref_mismatched_pointee_type0
-define void @byref_mismatched_pointee_type0(i32* byref(i8)) {
-  ret void
-}
-
-; CHECK: Attribute 'byref' type does not match parameter!
-; CHECK-NEXT: void (i8*)* @byref_mismatched_pointee_type1
-define void @byref_mismatched_pointee_type1(i8* byref(i32)) {
-  ret void
-}
-
 %opaque.ty = type opaque
 
 ; CHECK: Attribute 'byref' does not support unsized types!
-; CHECK-NEXT: void (%opaque.ty*)* @byref_unsized
-define void @byref_unsized(%opaque.ty* byref(%opaque.ty)) {
+; CHECK-NEXT: ptr @byref_unsized
+define void @byref_unsized(ptr byref(%opaque.ty)) {
   ret void
 }
 
 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
-; CHECK-NEXT: void (i32*)* @byref_byval
-define void @byref_byval(i32* byref(i32) byval(i32)) {
+; CHECK-NEXT: ptr @byref_byval
+define void @byref_byval(ptr byref(i32) byval(i32)) {
   ret void
 }
 
 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
-; CHECK-NEXT: void (i32*)* @byref_inalloca
-define void @byref_inalloca(i32* byref(i32) inalloca(i32)) {
+; CHECK-NEXT: ptr @byref_inalloca
+define void @byref_inalloca(ptr byref(i32) inalloca(i32)) {
   ret void
 }
 
 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
-; CHECK-NEXT: void (i32*)* @byref_preallocated
-define void @byref_preallocated(i32* byref(i32) preallocated(i32)) {
+; CHECK-NEXT: ptr @byref_preallocated
+define void @byref_preallocated(ptr byref(i32) preallocated(i32)) {
   ret void
 }
 
 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
-; CHECK-NEXT: void (i32*)* @byref_sret
-define void @byref_sret(i32* byref(i32) sret(i32)) {
+; CHECK-NEXT: ptr @byref_sret
+define void @byref_sret(ptr byref(i32) sret(i32)) {
   ret void
 }
 
 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
-; CHECK-NEXT: void (i32*)* @byref_inreg
-define void @byref_inreg(i32* byref(i32) inreg) {
+; CHECK-NEXT: ptr @byref_inreg
+define void @byref_inreg(ptr byref(i32) inreg) {
   ret void
 }
 
 ; CHECK: Attributes 'byval', 'inalloca', 'preallocated', 'inreg', 'nest', 'byref', and 'sret' are incompatible!
-; CHECK-NEXT: void (i32*)* @byref_nest
-define void @byref_nest(i32* byref(i32) nest) {
+; CHECK-NEXT: ptr @byref_nest
+define void @byref_nest(ptr byref(i32) nest) {
   ret void
 }
 
 ; CHECK: Attribute 'byref(i32)' applied to incompatible type!
-; CHECK-NEXT: void (i32)* @byref_non_pointer
+; CHECK-NEXT: ptr @byref_non_pointer
 define void @byref_non_pointer(i32 byref(i32)) {
   ret void
 }
 
-define void @byref_callee([64 x i8]* byref([64 x i8])) {
+define void @byref_callee(ptr byref([64 x i8])) {
   ret void
 }
 
-define void @no_byref_callee(i8*) {
+define void @no_byref_callee(ptr) {
   ret void
 }
 
 ; CHECK: cannot guarantee tail call due to mismatched ABI impacting function attributes
-; CHECK-NEXT: musttail call void @byref_callee([64 x i8]* byref([64 x i8]) %cast)
-; CHECK-NEXT: i8* %ptr
-define void @musttail_byref_caller(i8* %ptr) {
-  %cast = bitcast i8* %ptr to [64 x i8]*
-  musttail call void @byref_callee([64 x i8]* byref([64 x i8]) %cast)
+; CHECK-NEXT: musttail call void @byref_callee(ptr byref([64 x i8]) %ptr)
+; CHECK-NEXT: ptr %ptr
+define void @musttail_byref_caller(ptr %ptr) {
+  musttail call void @byref_callee(ptr byref([64 x i8]) %ptr)
   ret void
 }
 
 ; CHECK: cannot guarantee tail call due to mismatched ABI impacting function attributes
-; CHECK-NEXT: musttail call void @byref_callee([64 x i8]* %ptr)
-; CHECK-NEXT: [64 x i8]* %ptr
-define void @musttail_byref_callee([64 x i8]* byref([64 x i8]) %ptr) {
-  musttail call void @byref_callee([64 x i8]* %ptr)
+; CHECK-NEXT: musttail call void @byref_callee(ptr %ptr)
+; CHECK-NEXT: ptr %ptr
+define void @musttail_byref_callee(ptr byref([64 x i8]) %ptr) {
+  musttail call void @byref_callee(ptr %ptr)
   ret void
 }
 
-define void @byref_callee_align32(i8* byref([64 x i8]) align 32) {
+define void @byref_callee_align32(ptr byref([64 x i8]) align 32) {
   ret void
 }
 
 ; CHECK: cannot guarantee tail call due to mismatched ABI impacting function attributes
-; CHECK-NEXT: musttail call void @byref_callee_align32(i8* byref([64 x i8]) align 32 %ptr)
-; CHECK-NEXT: i8* %ptr
-define void @musttail_byref_caller_mismatched_align(i8* byref([64 x i8]) align 16 %ptr) {
-  musttail call void @byref_callee_align32(i8* byref([64 x i8]) align 32 %ptr)
+; CHECK-NEXT: musttail call void @byref_callee_align32(ptr byref([64 x i8]) align 32 %ptr)
+; CHECK-NEXT: ptr %ptr
+define void @musttail_byref_caller_mismatched_align(ptr byref([64 x i8]) align 16 %ptr) {
+  musttail call void @byref_callee_align32(ptr byref([64 x i8]) align 32 %ptr)
   ret void
 }

diff  --git a/llvm/test/Verifier/elementtype.ll b/llvm/test/Verifier/elementtype.ll
index 22bfe720c7482..c42c12afccc09 100644
--- a/llvm/test/Verifier/elementtype.ll
+++ b/llvm/test/Verifier/elementtype.ll
@@ -1,37 +1,31 @@
 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
 
-declare void @some_function(i32*)
+declare void @some_function(ptr)
 
 ; CHECK: Attribute 'elementtype(i32)' applied to incompatible type!
 define void @type_mismatch1() {
-  call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* null, i32 elementtype(i32) 0, i32 0)
-  ret void
-}
-
-; CHECK: Attribute 'elementtype' type does not match parameter!
-define void @type_mismatch2() {
-  call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* elementtype(i64) null, i32 0, i32 0)
+  call ptr @llvm.preserve.array.access.index.p0.p0(ptr null, i32 elementtype(i32) 0, i32 0)
   ret void
 }
 
 ; CHECK: Attribute 'elementtype' can only be applied to intrinsics and inline asm.
 define void @not_intrinsic() {
-  call void @some_function(i32* elementtype(i32) null)
+  call void @some_function(ptr elementtype(i32) null)
   ret void
 }
 
 ; CHECK: Attribute 'elementtype' can only be applied to a callsite.
-define void @llvm.not_call(i32* elementtype(i32)) {
+define void @llvm.not_call(ptr elementtype(i32)) {
   ret void
 }
 
 define void @elementtype_required() {
 ; CHECK: Intrinsic requires elementtype attribute on first argument.
-  call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* null, i32 0, i32 0)
+  call ptr @llvm.preserve.array.access.index.p0.p0(ptr null, i32 0, i32 0)
 ; CHECK: Intrinsic requires elementtype attribute on first argument.
-  call i32* @llvm.preserve.struct.access.index.p0i32.p0i32(i32* null, i32 0, i32 0)
+  call ptr @llvm.preserve.struct.access.index.p0.p0(ptr null, i32 0, i32 0)
   ret void
 }
 
-declare i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32*, i32, i32)
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0i32(i32*, i32, i32)
+declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32)
+declare ptr @llvm.preserve.struct.access.index.p0.p0(ptr, i32, i32)

diff  --git a/llvm/test/Verifier/gcroot.ll b/llvm/test/Verifier/gcroot.ll
index 75e51d7ec5bcb..1d0e6b59b0cd0 100644
--- a/llvm/test/Verifier/gcroot.ll
+++ b/llvm/test/Verifier/gcroot.ll
@@ -1,52 +1,49 @@
 ; RUN: not llvm-as -o /dev/null %s 2>&1 | FileCheck %s
 ; PR1633
 
-declare void @llvm.gcroot(i8**, i8*)
+declare void @llvm.gcroot(ptr, ptr)
 
 define void @caller_must_use_gc() {
   ; CHECK: Enclosing function does not use GC.
-  ; CHECK-NEXT: call void @llvm.gcroot(i8** %alloca, i8* null)
-  %alloca = alloca i8*
-  call void @llvm.gcroot(i8** %alloca, i8* null)
+  ; CHECK-NEXT: call void @llvm.gcroot(ptr %alloca, ptr null)
+  %alloca = alloca ptr
+  call void @llvm.gcroot(ptr %alloca, ptr null)
   ret void
 }
 
 define void @must_be_alloca() gc "test" {
 ; CHECK: llvm.gcroot parameter #1 must be an alloca.
-; CHECK-NEXT: call void @llvm.gcroot(i8** null, i8* null)
-  call void @llvm.gcroot(i8** null, i8* null)
+; CHECK-NEXT: call void @llvm.gcroot(ptr null, ptr null)
+  call void @llvm.gcroot(ptr null, ptr null)
   ret void
 }
 
 define void @non_ptr_alloca_null() gc "test" {
   ; CHECK: llvm.gcroot parameter #1 must either be a pointer alloca, or argument #2 must be a non-null constant.
-  ; CHECK-NEXT: call void @llvm.gcroot(i8** %cast.alloca, i8* null)
+  ; CHECK-NEXT: call void @llvm.gcroot(ptr %alloca, ptr null)
   %alloca = alloca i32
-  %cast.alloca = bitcast i32* %alloca to i8**
-  call void @llvm.gcroot(i8** %cast.alloca, i8* null)
+  call void @llvm.gcroot(ptr %alloca, ptr null)
   ret void
 }
 
-define void @non_constant_arg1(i8* %arg) gc "test" {
+define void @non_constant_arg1(ptr %arg) gc "test" {
   ; CHECK: llvm.gcroot parameter #2 must be a constant.
-  ; CHECK-NEXT: call void @llvm.gcroot(i8** %alloca, i8* %arg)
-  %alloca = alloca i8*
-  call void @llvm.gcroot(i8** %alloca, i8* %arg)
+  ; CHECK-NEXT: call void @llvm.gcroot(ptr %alloca, ptr %arg)
+  %alloca = alloca ptr
+  call void @llvm.gcroot(ptr %alloca, ptr %arg)
   ret void
 }
 
 define void @non_ptr_alloca_non_null() gc "test" {
 ; CHECK-NOT: llvm.gcroot parameter
   %alloca = alloca i32
-  %cast.alloca = bitcast i32* %alloca to i8**
-  call void @llvm.gcroot(i8** %cast.alloca, i8* inttoptr (i64 123 to i8*))
+  call void @llvm.gcroot(ptr %alloca, ptr inttoptr (i64 123 to ptr))
   ret void
 }
 
 define void @casted_alloca() gc "test" {
 ; CHECK-NOT: llvm.gcroot parameter
-  %alloca = alloca i32*
-  %ptr.cast.alloca = bitcast i32** %alloca to i8**
-  call void @llvm.gcroot(i8** %ptr.cast.alloca, i8* null)
+  %alloca = alloca ptr
+  call void @llvm.gcroot(ptr %alloca, ptr null)
   ret void
 }

diff  --git a/llvm/test/Verifier/global-ctors-2.ll b/llvm/test/Verifier/global-ctors-2.ll
index 634fef10d944b..c59e1199d662b 100644
--- a/llvm/test/Verifier/global-ctors-2.ll
+++ b/llvm/test/Verifier/global-ctors-2.ll
@@ -1,6 +1,6 @@
 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
 
- at llvm.global_ctors = appending global [1 x { i32, void()* } ] [
-  { i32, void()* } { i32 65535, void ()* null }
+ at llvm.global_ctors = appending global [1 x { i32, ptr } ] [
+  { i32, ptr } { i32 65535, ptr null }
 ]
 ; CHECK: the third field of the element type is mandatory, specify ptr null to migrate from the obsoleted 2-field form

diff  --git a/llvm/test/Verifier/ifunc.ll b/llvm/test/Verifier/ifunc.ll
index b9fb456ac7a21..2b5dde3ebb02d 100644
--- a/llvm/test/Verifier/ifunc.ll
+++ b/llvm/test/Verifier/ifunc.ll
@@ -1,36 +1,32 @@
 ; RUN:  not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
 
-define void ()* @resolver() {
-  ret void ()* null
+define ptr @resolver() {
+  ret ptr null
 }
 
- at inval_linkage = extern_weak ifunc void (), void ()* ()* @resolver
+ at inval_linkage = extern_weak ifunc void (), ptr @resolver
 ; CHECK: IFunc should have {{.*}} linkage!
 ; CHECK-NEXT: @inval_linkage
 
 @g = external global i32
- at inval_objtype = ifunc void (), bitcast(i32* @g to void ()* ()*)
+ at inval_objtype = ifunc void (), ptr @g
 ; CHECK: IFunc must have a Function resolver
 
-declare void ()* @resolver_decl()
- at inval_resolver_decl = ifunc void (), void ()* ()* @resolver_decl
+declare ptr @resolver_decl()
+ at inval_resolver_decl = ifunc void (), ptr @resolver_decl
 ; CHECK: IFunc resolver must be a definition
 ; CHECK-NEXT: @inval_resolver_decl
 
-define available_externally void ()* @resolver_linker_decl() {
-  ret void ()* null
+define available_externally ptr @resolver_linker_decl() {
+  ret ptr null
 }
- at inval_resolver_decl2 = ifunc void (), void ()* ()* @resolver_linker_decl
+ at inval_resolver_decl2 = ifunc void (), ptr @resolver_linker_decl
 ; CHECK: IFunc resolver must be a definition
 ; CHECK-NEXT: @inval_resolver_decl2
 
- at inval_resolver_type = ifunc i32 (), void ()* ()* @resolver
-; CHECK: IFunc resolver has incorrect type
-; CHECK-NEXT: @inval_resolver_type
-
- at ifunc_nonpointer_return_type = ifunc i32 (), i32 ()* @resolver_returns_nonpointer
+ at ifunc_nonpointer_return_type = ifunc i32 (), ptr @resolver_returns_nonpointer
 ; CHECK: IFunc resolver must return a pointer
-; CHECK-NEXT: i32 ()* @ifunc_nonpointer_return_type
+; CHECK-NEXT: ptr @ifunc_nonpointer_return_type
 
 define i32 @resolver_returns_nonpointer() {
   ret i32 0

diff  --git a/llvm/test/Verifier/inalloca1.ll b/llvm/test/Verifier/inalloca1.ll
index af31f89120629..e892a6c4f268e 100644
--- a/llvm/test/Verifier/inalloca1.ll
+++ b/llvm/test/Verifier/inalloca1.ll
@@ -1,34 +1,28 @@
 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
 
-declare void @a(i64* byval(i64) inalloca(i64) %p)
+declare void @a(ptr byval(i64) inalloca(i64) %p)
 ; CHECK: Attributes {{.*}} are incompatible
 
-declare void @b(i64* inreg inalloca(i64) %p)
+declare void @b(ptr inreg inalloca(i64) %p)
 ; CHECK: Attributes {{.*}} are incompatible
 
-declare void @c(i64* sret(i64) inalloca(i64) %p)
+declare void @c(ptr sret(i64) inalloca(i64) %p)
 ; CHECK: Attributes {{.*}} are incompatible
 
-declare void @d(i64* nest inalloca(i64) %p)
+declare void @d(ptr nest inalloca(i64) %p)
 ; CHECK: Attributes {{.*}} are incompatible
 
-declare void @e(i64* readonly inalloca(i64) %p)
+declare void @e(ptr readonly inalloca(i64) %p)
 ; CHECK: Attributes {{.*}} are incompatible
 
-declare void @f(void ()* inalloca(void()) %p)
+declare void @f(ptr inalloca(void()) %p)
 ; CHECK: Attribute 'inalloca' does not support unsized types
 
-declare void @g(i32* inalloca(i32) %p, i32 %p2)
+declare void @g(ptr inalloca(i32) %p, i32 %p2)
 ; CHECK: inalloca isn't on the last parameter!
 
-; CHECK: Attribute 'inalloca' type does not match parameter!
-; CHECK-NEXT: void (i32*)* @inalloca_mismatched_pointee_type0
-define void @inalloca_mismatched_pointee_type0(i32* inalloca(i8)) {
-  ret void
-}
-
 ; CHECK: Attribute 'inalloca(i8)' applied to incompatible type!
-; CHECK-NEXT: void (i8)* @inalloca_not_pointer
+; CHECK-NEXT: ptr @inalloca_not_pointer
 define void @inalloca_not_pointer(i8 inalloca(i8)) {
   ret void
 }

diff  --git a/llvm/test/Verifier/inline-asm-indirect-operand.ll b/llvm/test/Verifier/inline-asm-indirect-operand.ll
index 030fa2af6f18e..df8186724ada3 100644
--- a/llvm/test/Verifier/inline-asm-indirect-operand.ll
+++ b/llvm/test/Verifier/inline-asm-indirect-operand.ll
@@ -1,14 +1,7 @@
 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
 
-define void @okay(i32* %p, i32 %x) {
-	call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i32) %p, i32 %x)
-  ret void
-}
-
-; CHECK: Attribute 'elementtype' type does not match parameter!
-; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i64) %p, i32 %x)
-define void @wrong_element_type(i32* %p, i32 %x) {
-	call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i64) %p, i32 %x)
+define void @okay(ptr %p, i32 %x) {
+	call void asm "addl $1, $0", "=*rm,r"(ptr elementtype(i32) %p, i32 %x)
   ret void
 }
 
@@ -20,22 +13,22 @@ define void @not_pointer_arg(i32 %p, i32 %x) {
 }
 
 ; CHECK: Elementtype attribute can only be applied for indirect constraints
-; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i32) %p, i32* elementtype(i32) %x)
-define void @not_indirect(i32* %p, i32* %x) {
-	call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i32) %p, i32* elementtype(i32) %x)
+; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(ptr elementtype(i32) %p, ptr elementtype(i32) %x)
+define void @not_indirect(ptr %p, ptr %x) {
+	call void asm "addl $1, $0", "=*rm,r"(ptr elementtype(i32) %p, ptr elementtype(i32) %x)
   ret void
 }
 
 ; CHECK: Operand for indirect constraint must have elementtype attribute
-; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(i32* %p, i32 %x)
-define void @missing_elementtype(i32* %p, i32 %x) {
-	call void asm "addl $1, $0", "=*rm,r"(i32* %p, i32 %x)
+; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(ptr %p, i32 %x)
+define void @missing_elementtype(ptr %p, i32 %x) {
+	call void asm "addl $1, $0", "=*rm,r"(ptr %p, i32 %x)
   ret void
 }
 
 ; CHECK: Operand for indirect constraint must have pointer type
 ; CHECK-NEXT: invoke void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
-define void @not_pointer_arg_invoke(i32 %p, i32 %x) personality i8* null {
+define void @not_pointer_arg_invoke(i32 %p, i32 %x) personality ptr null {
 	invoke void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
       to label %cont unwind label %lpad
 

diff  --git a/llvm/test/Verifier/intrinsic-immarg.ll b/llvm/test/Verifier/intrinsic-immarg.ll
index 5a58f33890f89..47189c0b7d052 100644
--- a/llvm/test/Verifier/intrinsic-immarg.ll
+++ b/llvm/test/Verifier/intrinsic-immarg.ll
@@ -1,101 +1,101 @@
 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
 
-declare i8* @llvm.returnaddress(i32)
+declare ptr @llvm.returnaddress(i32)
 define void @return_address(i32 %var) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %var
-  ; CHECK-NEXT: %result = call i8* @llvm.returnaddress(i32 %var)
-  %result = call i8* @llvm.returnaddress(i32 %var)
+  ; CHECK-NEXT: %result = call ptr @llvm.returnaddress(i32 %var)
+  %result = call ptr @llvm.returnaddress(i32 %var)
   ret void
 }
 
-declare i8* @llvm.frameaddress(i32)
+declare ptr @llvm.frameaddress(i32)
 define void @frame_address(i32 %var) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %var
-  ; CHECK-NEXT: %result = call i8* @llvm.frameaddress.p0i8(i32 %var)
-  %result = call i8* @llvm.frameaddress(i32 %var)
+  ; CHECK-NEXT: %result = call ptr @llvm.frameaddress.p0(i32 %var)
+  %result = call ptr @llvm.frameaddress(i32 %var)
   ret void
 }
 
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1)
-define void @memcpy(i8* %dest, i8* %src, i1 %is.volatile) {
+declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1)
+define void @memcpy(ptr %dest, ptr %src, i1 %is.volatile) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i1 %is.volatile
-  ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
-  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
+  ; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
+  call void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
   ret void
 }
 
-declare void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1)
-define void @memcpy_inline_is_volatile(i8* %dest, i8* %src, i1 %is.volatile) {
+declare void @llvm.memcpy.inline.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1)
+define void @memcpy_inline_is_volatile(ptr %dest, ptr %src, i1 %is.volatile) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i1 %is.volatile
-  ; CHECK-NEXT: call void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
-  call void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
+  ; CHECK-NEXT: call void @llvm.memcpy.inline.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
+  call void @llvm.memcpy.inline.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
   ret void
 }
 
-define void @memcpy_inline_variable_size(i8* %dest, i8* %src, i32 %size) {
+define void @memcpy_inline_variable_size(ptr %dest, ptr %src, i32 %size) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %size
-  ; CHECK-NEXT: call void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %size, i1 true)
-  call void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %size, i1 true)
+  ; CHECK-NEXT: call void @llvm.memcpy.inline.p0.p0.i32(ptr %dest, ptr %src, i32 %size, i1 true)
+  call void @llvm.memcpy.inline.p0.p0.i32(ptr %dest, ptr %src, i32 %size, i1 true)
   ret void
 }
 
-declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1)
-define void @memmove(i8* %dest, i8* %src, i1 %is.volatile) {
+declare void @llvm.memmove.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1)
+define void @memmove(ptr %dest, ptr %src, i1 %is.volatile) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i1 %is.volatile
-  ; CHECK-NEXT: call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
-  call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 8, i1 %is.volatile)
+  ; CHECK-NEXT: call void @llvm.memmove.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
+  call void @llvm.memmove.p0.p0.i32(ptr %dest, ptr %src, i32 8, i1 %is.volatile)
   ret void
 }
 
-declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1)
-define void @memset(i8* %dest, i8 %val, i1 %is.volatile) {
+declare void @llvm.memset.p0.i32(ptr nocapture, i8, i32, i1)
+define void @memset(ptr %dest, i8 %val, i1 %is.volatile) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i1 %is.volatile
-  ; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* %dest, i8 %val, i32 8, i1 %is.volatile)
-  call void @llvm.memset.p0i8.i32(i8* %dest, i8 %val, i32 8, i1 %is.volatile)
+  ; CHECK-NEXT: call void @llvm.memset.p0.i32(ptr %dest, i8 %val, i32 8, i1 %is.volatile)
+  call void @llvm.memset.p0.i32(ptr %dest, i8 %val, i32 8, i1 %is.volatile)
   ret void
 }
 
-declare void @llvm.memset.inline.p0i8.i32(i8* nocapture, i8, i32, i1)
-define void @memset_inline_is_volatile(i8* %dest, i8 %value, i1 %is.volatile) {
+declare void @llvm.memset.inline.p0.i32(ptr nocapture, i8, i32, i1)
+define void @memset_inline_is_volatile(ptr %dest, i8 %value, i1 %is.volatile) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i1 %is.volatile
-  ; CHECK-NEXT: call void @llvm.memset.inline.p0i8.i32(i8* %dest, i8 %value, i32 8, i1 %is.volatile)
-  call void @llvm.memset.inline.p0i8.i32(i8* %dest, i8 %value, i32 8, i1 %is.volatile)
+  ; CHECK-NEXT: call void @llvm.memset.inline.p0.i32(ptr %dest, i8 %value, i32 8, i1 %is.volatile)
+  call void @llvm.memset.inline.p0.i32(ptr %dest, i8 %value, i32 8, i1 %is.volatile)
   ret void
 }
 
-define void @memset_inline_variable_size(i8* %dest, i8 %value, i32 %size) {
+define void @memset_inline_variable_size(ptr %dest, i8 %value, i32 %size) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %size
-  ; CHECK-NEXT: call void @llvm.memset.inline.p0i8.i32(i8* %dest, i8 %value, i32 %size, i1 true)
-  call void @llvm.memset.inline.p0i8.i32(i8* %dest, i8 %value, i32 %size, i1 true)
+  ; CHECK-NEXT: call void @llvm.memset.inline.p0.i32(ptr %dest, i8 %value, i32 %size, i1 true)
+  call void @llvm.memset.inline.p0.i32(ptr %dest, i8 %value, i32 %size, i1 true)
   ret void
 }
 
 
-declare i64 @llvm.objectsize.i64.p0i8(i8*, i1, i1, i1)
-define void @objectsize(i8* %ptr, i1 %a, i1 %b, i1 %c) {
+declare i64 @llvm.objectsize.i64.p0(ptr, i1, i1, i1)
+define void @objectsize(ptr %ptr, i1 %a, i1 %b, i1 %c) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i1 %a
-  ; CHECK-NEXT: %val0 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 %a, i1 false, i1 false)
-  %val0 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 %a, i1 false, i1 false)
+  ; CHECK-NEXT: %val0 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 %a, i1 false, i1 false)
+  %val0 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 %a, i1 false, i1 false)
 
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i1 %b
-  ; CHECK-NEXT: %val1 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 %b, i1 false)
-  %val1 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 %b, i1 false)
+  ; CHECK-NEXT: %val1 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 false, i1 %b, i1 false)
+  %val1 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 false, i1 %b, i1 false)
 
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i1 %c
-  ; CHECK-NEXT: %val2 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 false, i1 %c)
-  %val2 = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr, i1 false, i1 false, i1 %c)
+  ; CHECK-NEXT: %val2 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 false, i1 false, i1 %c)
+  %val2 = call i64 @llvm.objectsize.i64.p0(ptr %ptr, i1 false, i1 false, i1 %c)
   ret void
 }
 
@@ -135,133 +135,132 @@ define i64 @umul_fix_sat(i64 %arg0, i64 %arg1, i32 %arg2) {
   ret i64 %ret
 }
 
-declare <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>*, i32, <2 x i1>, <2 x double>)
-define <2 x double> @masked_load(<2 x i1> %mask, <2 x double>* %addr, <2 x double> %dst, i32 %align) {
+declare <2 x double> @llvm.masked.load.v2f64.p0(ptr, i32, <2 x i1>, <2 x double>)
+define <2 x double> @masked_load(<2 x i1> %mask, ptr %addr, <2 x double> %dst, i32 %align) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %align
-  ; CHECK-NEXT: %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %addr, i32 %align, <2 x i1> %mask, <2 x double> %dst)
-  %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %addr, i32 %align, <2 x i1> %mask, <2 x double> %dst)
+  ; CHECK-NEXT: %res = call <2 x double> @llvm.masked.load.v2f64.p0(ptr %addr, i32 %align, <2 x i1> %mask, <2 x double> %dst)
+  %res = call <2 x double> @llvm.masked.load.v2f64.p0(ptr %addr, i32 %align, <2 x i1> %mask, <2 x double> %dst)
   ret <2 x double> %res
 }
 
-declare void @llvm.masked.store.v4i32.p0v4i32(<4 x i32>, <4 x i32>*, i32, <4 x i1>)
-define void @masked_store(<4 x i1> %mask, <4 x i32>* %addr, <4 x i32> %val, i32 %align) {
+declare void @llvm.masked.store.v4i32.p0(<4 x i32>, ptr, i32, <4 x i1>)
+define void @masked_store(<4 x i1> %mask, ptr %addr, <4 x i32> %val, i32 %align) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %align
-  ; CHECK-NEXT: call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %val, <4 x i32>* %addr, i32 %align, <4 x i1> %mask)
-  call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %val, <4 x i32>* %addr, i32 %align, <4 x i1> %mask)
+  ; CHECK-NEXT: call void @llvm.masked.store.v4i32.p0(<4 x i32> %val, ptr %addr, i32 %align, <4 x i1> %mask)
+  call void @llvm.masked.store.v4i32.p0(<4 x i32> %val, ptr %addr, i32 %align, <4 x i1> %mask)
   ret void
 }
 
-declare <2 x double> @llvm.masked.gather.v2f64.v2p0f64(<2 x double*>, i32, <2 x i1>, <2 x double>)
-define <2 x double> @test_gather(<2 x double*> %ptrs, <2 x i1> %mask, <2 x double> %src0, i32 %align)  {
+declare <2 x double> @llvm.masked.gather.v2f64.v2p0(<2 x ptr>, i32, <2 x i1>, <2 x double>)
+define <2 x double> @test_gather(<2 x ptr> %ptrs, <2 x i1> %mask, <2 x double> %src0, i32 %align)  {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK: i32 %align
-  ; CHECK: %res = call <2 x double> @llvm.masked.gather.v2f64.v2p0f64(<2 x double*> %ptrs, i32 %align, <2 x i1> %mask, <2 x double> %src0)
-  %res = call <2 x double> @llvm.masked.gather.v2f64.v2p0f64(<2 x double*> %ptrs, i32 %align, <2 x i1> %mask, <2 x double> %src0)
+  ; CHECK: %res = call <2 x double> @llvm.masked.gather.v2f64.v2p0(<2 x ptr> %ptrs, i32 %align, <2 x i1> %mask, <2 x double> %src0)
+  %res = call <2 x double> @llvm.masked.gather.v2f64.v2p0(<2 x ptr> %ptrs, i32 %align, <2 x i1> %mask, <2 x double> %src0)
   ret <2 x double> %res
 }
 
-declare void @llvm.masked.scatter.v8i32.v8p0i32(<8 x i32>, <8 x i32*>, i32, <8 x i1>)
-define void @test_scatter_8i32(<8 x i32> %a1, <8 x i32*> %ptr, <8 x i1> %mask, i32 %align) {
+declare void @llvm.masked.scatter.v8i32.v8p0(<8 x i32>, <8 x ptr>, i32, <8 x i1>)
+define void @test_scatter_8i32(<8 x i32> %a1, <8 x ptr> %ptr, <8 x i1> %mask, i32 %align) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %align
-  ; CHECK-NEXT: call void @llvm.masked.scatter.v8i32.v8p0i32(<8 x i32> %a1, <8 x i32*> %ptr, i32 %align, <8 x i1> %mask)
-  call void @llvm.masked.scatter.v8i32.v8p0i32(<8 x i32> %a1, <8 x i32*> %ptr, i32 %align, <8 x i1> %mask)
+  ; CHECK-NEXT: call void @llvm.masked.scatter.v8i32.v8p0(<8 x i32> %a1, <8 x ptr> %ptr, i32 %align, <8 x i1> %mask)
+  call void @llvm.masked.scatter.v8i32.v8p0(<8 x i32> %a1, <8 x ptr> %ptr, i32 %align, <8 x i1> %mask)
   ret void
 }
 
-declare void @llvm.lifetime.start.p0i8(i64, i8*)
-define void @test_lifetime_start(i64 %arg0, i8* %ptr) {
+declare void @llvm.lifetime.start.p0(i64, ptr)
+define void @test_lifetime_start(i64 %arg0, ptr %ptr) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i64 %arg0
-  ; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 %arg0, i8* %ptr)
-  call void @llvm.lifetime.start.p0i8(i64 %arg0, i8* %ptr)
+  ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 %arg0, ptr %ptr)
+  call void @llvm.lifetime.start.p0(i64 %arg0, ptr %ptr)
   ret void
 }
 
-declare void @llvm.lifetime.end.p0i8(i64, i8*)
-define void @test_lifetime_end(i64 %arg0, i8* %ptr) {
+declare void @llvm.lifetime.end.p0(i64, ptr)
+define void @test_lifetime_end(i64 %arg0, ptr %ptr) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i64 %arg0
-  ; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 %arg0, i8* %ptr)
-  call void @llvm.lifetime.end.p0i8(i64 %arg0, i8* %ptr)
+  ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 %arg0, ptr %ptr)
+  call void @llvm.lifetime.end.p0(i64 %arg0, ptr %ptr)
   ret void
 }
 
-declare void @llvm.invariant.start.p0i8(i64, i8*)
-define void @test_invariant_start(i64 %arg0, i8* %ptr) {
+declare void @llvm.invariant.start.p0(i64, ptr)
+define void @test_invariant_start(i64 %arg0, ptr %ptr) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i64 %arg0
-  ; CHECK-NEXT: call void @llvm.invariant.start.p0i8(i64 %arg0, i8* %ptr)
-  call void @llvm.invariant.start.p0i8(i64 %arg0, i8* %ptr)
+  ; CHECK-NEXT: call void @llvm.invariant.start.p0(i64 %arg0, ptr %ptr)
+  call void @llvm.invariant.start.p0(i64 %arg0, ptr %ptr)
   ret void
 }
 
-declare void @llvm.invariant.end.p0i8({}*, i64, i8*)
-define void @test_invariant_end({}* %scope, i64 %arg1, i8* %ptr) {
+declare void @llvm.invariant.end.p0(ptr, i64, ptr)
+define void @test_invariant_end(ptr %scope, i64 %arg1, ptr %ptr) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i64 %arg1
-  ; CHECK-NEXT: call void @llvm.invariant.end.p0i8({}* %scope, i64 %arg1, i8* %ptr)
-  call void @llvm.invariant.end.p0i8({}* %scope, i64 %arg1, i8* %ptr)
+  ; CHECK-NEXT: call void @llvm.invariant.end.p0(ptr %scope, i64 %arg1, ptr %ptr)
+  call void @llvm.invariant.end.p0(ptr %scope, i64 %arg1, ptr %ptr)
   ret void
 }
 
-declare void @llvm.prefetch(i8*, i32, i32, i32)
-define void @test_prefetch(i8* %ptr, i32 %arg0, i32 %arg1) {
+declare void @llvm.prefetch(ptr, i32, i32, i32)
+define void @test_prefetch(ptr %ptr, i32 %arg0, i32 %arg1) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %arg0
-  ; CHECK-NEXT: call void @llvm.prefetch.p0i8(i8* %ptr, i32 %arg0, i32 0, i32 0)
+  ; CHECK-NEXT: call void @llvm.prefetch.p0(ptr %ptr, i32 %arg0, i32 0, i32 0)
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT:  i32 %arg1
-  call void @llvm.prefetch(i8* %ptr, i32 %arg0, i32 0, i32 0)
-  call void @llvm.prefetch(i8* %ptr, i32 0, i32 %arg1, i32 0)
+  call void @llvm.prefetch(ptr %ptr, i32 %arg0, i32 0, i32 0)
+  call void @llvm.prefetch(ptr %ptr, i32 0, i32 %arg1, i32 0)
   ret void
 }
 
-declare void @llvm.localrecover(i8*, i8*, i32)
-define void @test_localrecover(i8* %func, i8* %fp, i32 %idx) {
+declare void @llvm.localrecover(ptr, ptr, i32)
+define void @test_localrecover(ptr %func, ptr %fp, i32 %idx) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %idx
-  ; CHECK-NEXT: call void @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
-  call void @llvm.localrecover(i8* %func, i8* %fp, i32 %idx)
+  ; CHECK-NEXT: call void @llvm.localrecover(ptr %func, ptr %fp, i32 %idx)
+  call void @llvm.localrecover(ptr %func, ptr %fp, i32 %idx)
   ret void
 }
 
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
 
 define private void @f() {
   ret void
 }
 
-define void @calls_statepoint(i8 addrspace(1)* %arg0, i64 %arg1, i32 %arg2, i32 %arg4, i32 %arg5) gc "statepoint-example" {
+define void @calls_statepoint(ptr addrspace(1) %arg0, i64 %arg1, i32 %arg2, i32 %arg4, i32 %arg5) gc "statepoint-example" {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i64 %arg1
-  ; CHECK-NEXT: %safepoint0 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 %arg1, i32 0, void ()* @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
+  ; CHECK-NEXT: %safepoint0 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 %arg1, i32 0, ptr @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %arg2
-  ; CHECK-NEXT: %safepoint1 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 %arg2, void ()* @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
+  ; CHECK-NEXT: %safepoint1 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 %arg2, ptr @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %arg4
-  ; CHECK-NEXT: %safepoint2 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @f, i32 %arg4, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
+  ; CHECK-NEXT: %safepoint2 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @f, i32 %arg4, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK-NEXT: i32 %arg5
-  ; CHECK-NEXT: %safepoint3 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @f, i32 0, i32 %arg5, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
-  %cast = bitcast i8 addrspace(1)* %arg0 to i64 addrspace(1)*
-  %safepoint0 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 %arg1, i32 0, void ()* @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
-  %safepoint1 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 %arg2, void ()* @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
-  %safepoint2 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @f, i32 %arg4, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
-  %safepoint3 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @f, i32 0, i32 %arg5, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg0, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg0, i8 addrspace(1)* %arg0)
+  ; CHECK-NEXT: %safepoint3 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @f, i32 0, i32 %arg5, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
+  %safepoint0 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 %arg1, i32 0, ptr @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
+  %safepoint1 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 %arg2, ptr @f, i32 0, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
+  %safepoint2 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @f, i32 %arg4, i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
+  %safepoint3 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @f, i32 0, i32 %arg5, i32 0, i32 5, i32 0, i32 0, i32 0, i32 10, i32 0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0, ptr addrspace(1) %arg0)
   ret void
 }
 
-declare void @llvm.hwasan.check.memaccess(i8*, i8*, i32)
+declare void @llvm.hwasan.check.memaccess(ptr, ptr, i32)
 
-define void @hwasan_check_memaccess(i8* %arg0,i8* %arg1, i32 %arg2) {
+define void @hwasan_check_memaccess(ptr %arg0,ptr %arg1, i32 %arg2) {
   ; CHECK: immarg operand has non-immediate parameter
   ; CHECK: i32 %arg2
-  ; CHECK: call void @llvm.hwasan.check.memaccess(i8* %arg0, i8* %arg1, i32 %arg2)
-  call void @llvm.hwasan.check.memaccess(i8* %arg0,i8* %arg1, i32 %arg2)
+  ; CHECK: call void @llvm.hwasan.check.memaccess(ptr %arg0, ptr %arg1, i32 %arg2)
+  call void @llvm.hwasan.check.memaccess(ptr %arg0,ptr %arg1, i32 %arg2)
   ret void
 }
 

diff  --git a/llvm/test/Verifier/invalid-statepoint.ll b/llvm/test/Verifier/invalid-statepoint.ll
index 1816112719ff3..dda82494621bb 100644
--- a/llvm/test/Verifier/invalid-statepoint.ll
+++ b/llvm/test/Verifier/invalid-statepoint.ll
@@ -3,33 +3,25 @@
 declare zeroext i1 @return0i1()
 
 ; Function Attrs: nounwind
-declare token @llvm.experimental.gc.statepoint.p0f0i1f(i64, i32, i1 ()*, i32, i32, ...) #0
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...) #0
 
 ; Function Attrs: nounwind
-declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(token, i32, i32) #0
+declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32) #0
 
 ; CHECK: gc.statepoint callee argument must have elementtype attribute
-define i32 addrspace(1)* @missing_elementtype(i32 addrspace(1)* %dparam) gc "statepoint-example" {
-  %a00 = load i32, i32 addrspace(1)* %dparam
-  %to0 = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f0i1f(i64 0, i32 0, i1 ()* @return0i1, i32 9, i32 0, i2 0) ["gc-live" (i32 addrspace(1)* %dparam)]
-  %relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(token %to0, i32 0, i32 0)
-  ret i32 addrspace(1)* %relocate
-}
-
-; CHECK: Attribute 'elementtype' type does not match parameter!
-define i32 addrspace(1)* @elementtype_mismatch(i32 addrspace(1)* %dparam) gc "statepoint-example" {
-  %a00 = load i32, i32 addrspace(1)* %dparam
-  %to0 = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f0i1f(i64 0, i32 0, i1 ()* elementtype(i32 ()) @return0i1, i32 9, i32 0, i2 0) ["gc-live" (i32 addrspace(1)* %dparam)]
-  %relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(token %to0, i32 0, i32 0)
-  ret i32 addrspace(1)* %relocate
+define ptr addrspace(1) @missing_elementtype(ptr addrspace(1) %dparam) gc "statepoint-example" {
+  %a00 = load i32, ptr addrspace(1) %dparam
+  %to0 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @return0i1, i32 9, i32 0, i2 0) ["gc-live" (ptr addrspace(1) %dparam)]
+  %relocate = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %to0, i32 0, i32 0)
+  ret ptr addrspace(1) %relocate
 }
 
 ; CHECK: gc.statepoint mismatch in number of call args
-define i32 addrspace(1)* @num_args_mismatch(i32 addrspace(1)* %dparam) gc "statepoint-example" {
-  %a00 = load i32, i32 addrspace(1)* %dparam
-  %to0 = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f0i1f(i64 0, i32 0, i1 ()* elementtype(i1 ()) @return0i1, i32 9, i32 0, i2 0) ["gc-live" (i32 addrspace(1)* %dparam)]
-  %relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(token %to0, i32 0, i32 0)
-  ret i32 addrspace(1)* %relocate
+define ptr addrspace(1) @num_args_mismatch(ptr addrspace(1) %dparam) gc "statepoint-example" {
+  %a00 = load i32, ptr addrspace(1) %dparam
+  %to0 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i1 ()) @return0i1, i32 9, i32 0, i2 0) ["gc-live" (ptr addrspace(1) %dparam)]
+  %relocate = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %to0, i32 0, i32 0)
+  ret ptr addrspace(1) %relocate
 }
 
 attributes #0 = { nounwind }

diff  --git a/llvm/test/Verifier/matrix-intrinsics.ll b/llvm/test/Verifier/matrix-intrinsics.ll
index 6f90fcb5ce925..d3ab278e5a69e 100644
--- a/llvm/test/Verifier/matrix-intrinsics.ll
+++ b/llvm/test/Verifier/matrix-intrinsics.ll
@@ -33,38 +33,38 @@ define <4 x float> @multiply(<4 x float> %m, i32 %arg) {
   ret <4 x float> %result.3
 }
 
-define <4 x float> @column.major_load(float* %m, float* %n, i32 %arg) {
+define <4 x float> @column.major_load(ptr %m, ptr %n, i32 %arg) {
 ; CHECK-NEXT: Result of a matrix operation does not fit in the returned vector!
 ; CHECK-NEXT: Result of a matrix operation does not fit in the returned vector!
 ; CHECK-NEXT: Result of a matrix operation does not fit in the returned vector!
 ; CHECK-NEXT: immarg operand has non-immediate parameter
 ; CHECK-NEXT: i32 %arg
-; CHECK-NEXT:   %result.3 = call <6 x float> @llvm.matrix.column.major.load.v6f32.i64(float* %n, i64 2, i1 true, i32 3, i32 %arg)
-  %result.0 = call <4 x float> @llvm.matrix.column.major.load.v4f32.i64(float* %m, i64 0, i1 false, i32 0, i32 0)
-  %result.1 = call <4 x float> @llvm.matrix.column.major.load.v4f32.i64(float* %m, i64 2, i1 false, i32 1, i32 2)
-  %result.2 = call <6 x float> @llvm.matrix.column.major.load.v6f32.i64(float* %n, i64 2, i1 true, i32 3, i32 3)
-  %result.3 = call <6 x float> @llvm.matrix.column.major.load.v6f32.i64(float* %n, i64 2, i1 true, i32 3, i32 %arg)
+; CHECK-NEXT:   %result.3 = call <6 x float> @llvm.matrix.column.major.load.v6f32.i64(ptr %n, i64 2, i1 true, i32 3, i32 %arg)
+  %result.0 = call <4 x float> @llvm.matrix.column.major.load.v4f32.i64(ptr %m, i64 0, i1 false, i32 0, i32 0)
+  %result.1 = call <4 x float> @llvm.matrix.column.major.load.v4f32.i64(ptr %m, i64 2, i1 false, i32 1, i32 2)
+  %result.2 = call <6 x float> @llvm.matrix.column.major.load.v6f32.i64(ptr %n, i64 2, i1 true, i32 3, i32 3)
+  %result.3 = call <6 x float> @llvm.matrix.column.major.load.v6f32.i64(ptr %n, i64 2, i1 true, i32 3, i32 %arg)
   ret <4 x float> %result.1
 }
 
-define void @column.major_store(float* %m, float* %n, i64 %arg) {
+define void @column.major_store(ptr %m, ptr %n, i64 %arg) {
 ; CHECK-NEXT: Result of a matrix operation does not fit in the returned vector!
 ; CHECK-NEXT: Result of a matrix operation does not fit in the returned vector!
 ; CHECK-NEXT: Result of a matrix operation does not fit in the returned vector!
 ; CHECK-NEXT: Result of a matrix operation does not fit in the returned vector!
-  call void @llvm.matrix.column.major.store.v4f32.i64(<4 x float> zeroinitializer, float* %m, i64 0, i1 false, i32 0, i32 0)
-  call void @llvm.matrix.column.major.store.v4f32.i64(<4 x float> zeroinitializer, float* %m, i64 2, i1 false, i32 1, i32 2)
-  call void @llvm.matrix.column.major.store.v6f32.i64(<6 x float> zeroinitializer, float* %n, i64 2, i1 false, i32 3, i32 3)
-  call void @llvm.matrix.column.major.store.v6f32.i64(<6 x float> zeroinitializer, float* %n, i64 %arg, i1 false, i32 3, i32 3)
+  call void @llvm.matrix.column.major.store.v4f32.i64(<4 x float> zeroinitializer, ptr %m, i64 0, i1 false, i32 0, i32 0)
+  call void @llvm.matrix.column.major.store.v4f32.i64(<4 x float> zeroinitializer, ptr %m, i64 2, i1 false, i32 1, i32 2)
+  call void @llvm.matrix.column.major.store.v6f32.i64(<6 x float> zeroinitializer, ptr %n, i64 2, i1 false, i32 3, i32 3)
+  call void @llvm.matrix.column.major.store.v6f32.i64(<6 x float> zeroinitializer, ptr %n, i64 %arg, i1 false, i32 3, i32 3)
   ret void
 }
 
 define <4 x float> @transpose_mixed_types(<4 x float> %fvec, <4 x i32> %ivec, i32 %arg) {
 ;
 ; CHECK-NEXT: Intrinsic has incorrect argument type!
-; CHECK-NEXT: <4 x float> (<4 x i32>, i32, i32)* @llvm.matrix.transpose.v4f32.v4i32
+; CHECK-NEXT: ptr @llvm.matrix.transpose.v4f32.v4i32
 ; CHECK-NEXT: Intrinsic has incorrect argument type!
-; CHECK-NEXT: <4 x i32> (<4 x float>, i32, i32)* @llvm.matrix.transpose.v4i32.v4f32
+; CHECK-NEXT: ptr @llvm.matrix.transpose.v4i32.v4f32
 ;
   %result.0 = call <4 x float> @llvm.matrix.transpose.v4f32.v4i32(<4 x i32> %ivec, i32 0, i32 0)
   %result.1 = call <4 x i32> @llvm.matrix.transpose.v4i32.v4f32(<4 x float> %result.0, i32 3, i32 2)
@@ -74,13 +74,13 @@ define <4 x float> @transpose_mixed_types(<4 x float> %fvec, <4 x i32> %ivec, i3
 define <4 x float> @multiply_mixed_types(<4 x i32> %ivec, <4 x float> %fvec, i32 %arg) {
 ;
 ; CHECK-NEXT: Vector element type mismatch of the result and first operand vector!
-; CHECK-NEXT: <4 x i32> (<4 x float>, <4 x float>, i32, i32, i32)* @llvm.matrix.multiply.v4i32.v4f32.v4f32
+; CHECK-NEXT: ptr @llvm.matrix.multiply.v4i32.v4f32.v4f32
 ; CHECK-NEXT: Vector element type mismatch of the result and first operand vector!
-; CHECK-NEXT: <4 x float> (<4 x i32>, <4 x float>, i32, i32, i32)* @llvm.matrix.multiply.v4f32.v4i32.v4f32
+; CHECK-NEXT: ptr @llvm.matrix.multiply.v4f32.v4i32.v4f32
 ; CHECK-NEXT: Vector element type mismatch of the result and second operand vector!
-; CHECK-NEXT: <4 x float> (<4 x float>, <4 x i32>, i32, i32, i32)* @llvm.matrix.multiply.v4f32.v4f32.v4i32
+; CHECK-NEXT: ptr @llvm.matrix.multiply.v4f32.v4f32.v4i32
 ; CHECK-NEXT: Vector element type mismatch of the result and first operand vector!
-; CHECK-NEXT: <4 x float> (<4 x i32>, <4 x i32>, i32, i32, i32)* @llvm.matrix.multiply.v4f32.v4i32.v4i32
+; CHECK-NEXT: ptr @llvm.matrix.multiply.v4f32.v4i32.v4i32
 ;
   %result.0 = call <4 x i32> @llvm.matrix.multiply.v4i32.v4f32.v4f32(<4 x float> %fvec, <4 x float> %fvec, i32 2, i32 2, i32 2)
   %result.1 = call <4 x float> @llvm.matrix.multiply.v4f32.v4i32.v4f32(<4 x i32> %result.0, <4 x float> %fvec, i32 2, i32 2, i32 2)
@@ -89,67 +89,34 @@ define <4 x float> @multiply_mixed_types(<4 x i32> %ivec, <4 x float> %fvec, i32
   ret <4 x float> %result.3
 }
 
-define <4 x float> @column.major_load_mixed_types(i32* %m, float* %n, i32 %arg) {
-;
-; CHECK-NEXT: Intrinsic has incorrect argument type!
-; CHECK-NEXT: <4 x float> (i32*, i64, i1, i32, i32)* @llvm.matrix.column.major.load.v4f32.pi32
-; CHECK-NEXT: Intrinsic has incorrect argument type!
-; CHECK-NEXT: <4 x i32> (float*, i64, i1, i32, i32)* @llvm.matrix.column.major.load.v4i32.i64
-;
-  %result.0 = call <4 x float> @llvm.matrix.column.major.load.v4f32.pi32(i32* %m, i64 2, i1 false, i32 2, i32 2)
-  %result.1 = call <4 x i32> @llvm.matrix.column.major.load.v4i32.i64(float* %n, i64 2, i1 false, i32 2, i32 2)
-  ret <4 x float> %result.0
-}
-
-define void @column.major_store_mixed_types(float* %m, i32* %n, i64 %arg) {
-;
-; CHECK-NEXT: Intrinsic has incorrect argument type!
-; CHECK-NEXT: void (<4 x i32>, float*, i64, i1, i32, i32)* @llvm.matrix.column.major.store.v4i32.vi32
-; CHECK-NEXT: Intrinsic has incorrect argument type!
-; CHECK-NEXT: void (<4 x float>, i32*, i64, i1, i32, i32)* @llvm.matrix.column.major.store.v4f32.pi32
-;
-  call void @llvm.matrix.column.major.store.v4i32.vi32(<4 x i32> zeroinitializer, float* %m, i64 2, i1 false, i32 2, i32 2)
-  call void @llvm.matrix.column.major.store.v4f32.pi32(<4 x float> zeroinitializer, i32* %n, i64 2, i1 false, i32 2, i32 2)
-  ret void
-}
-
-define void @column.major_store_non_int_float_type(<4 x float>* %m, <4 x float>* %n, i64 %arg) {
-;
-; CHECK-NEXT: Intrinsic has incorrect argument type!
-; CHECK-NEXT: void (<4 x float*>, <4 x float>*, i64, i1, i32, i32)* @llvm.matrix.column.major.store.v4f32p0.p0v4f32
-;
-  call void @llvm.matrix.column.major.store.v4f32p0.p0v4f32(<4 x float*> zeroinitializer, <4 x float>* %n, i64 2, i1 false, i32 2, i32 2)
-  ret void
-}
-
-define <4 x float> @column.major_load_stride_too_small(float* %m, i32 %arg) {
+define <4 x float> @column.major_load_stride_too_small(ptr %m, i32 %arg) {
 ;
 ; CHECK-NEXT: Stride must be greater or equal than the number of rows!
-; CHECK-NEXT: <4 x float> (float*, i64, i1, i32, i32)* @llvm.matrix.column.major.load.v4f32.i64
+; CHECK-NEXT: ptr @llvm.matrix.column.major.load.v4f32.i64
 ;
-  %result.1 = call <4 x float> @llvm.matrix.column.major.load.v4f32.i64(float* %m, i64 1, i1 false, i32 2, i32 2)
+  %result.1 = call <4 x float> @llvm.matrix.column.major.load.v4f32.i64(ptr %m, i64 1, i1 false, i32 2, i32 2)
   ret <4 x float> %result.1
 }
 
-define void @column.major_store_stride_too_small(float* %m, i64 %arg) {
+define void @column.major_store_stride_too_small(ptr %m, i64 %arg) {
 ;
 ; CHECK-NEXT: Stride must be greater or equal than the number of rows!
-; CHECK-NEXT: void (<4 x float>, float*, i64, i1, i32, i32)* @llvm.matrix.column.major.store.v4f32.i64
+; CHECK-NEXT: ptr @llvm.matrix.column.major.store.v4f32.i64
 ;
-  call void @llvm.matrix.column.major.store.v4f32.i64(<4 x float> zeroinitializer, float* %m, i64 1, i1 false, i32 2, i32 2)
+  call void @llvm.matrix.column.major.store.v4f32.i64(<4 x float> zeroinitializer, ptr %m, i64 1, i1 false, i32 2, i32 2)
   ret void
 }
 
-declare <4 x i32>   @llvm.matrix.column.major.load.v4i32.i64(float*, i64, i1, i32, i32)
-declare <4 x float> @llvm.matrix.column.major.load.v4f32.pi32(i32*, i64, i1, i32, i32)
-declare <4 x float> @llvm.matrix.column.major.load.v4f32.i64(float*, i64, i1, i32, i32)
-declare <6 x float> @llvm.matrix.column.major.load.v6f32.i64(float*, i64, i1, i32, i32)
+declare <4 x i32>   @llvm.matrix.column.major.load.v4i32.i64(ptr, i64, i1, i32, i32)
+declare <4 x float> @llvm.matrix.column.major.load.v4f32.pi32(ptr, i64, i1, i32, i32)
+declare <4 x float> @llvm.matrix.column.major.load.v4f32.i64(ptr, i64, i1, i32, i32)
+declare <6 x float> @llvm.matrix.column.major.load.v6f32.i64(ptr, i64, i1, i32, i32)
 
-declare void @llvm.matrix.column.major.store.v4f32.i64(<4 x float>, float*, i64, i1, i32, i32)
-declare void @llvm.matrix.column.major.store.v6f32.i64(<6 x float>, float*, i64, i1, i32, i32)
-declare void @llvm.matrix.column.major.store.v4i32.vi32(<4 x i32>, float*, i64, i1, i32, i32)
-declare void @llvm.matrix.column.major.store.v4f32.pi32(<4 x float>, i32*, i64, i1, i32, i32)
-declare void @llvm.matrix.column.major.store.v4f32p0.p0v4f32(<4 x float*>, <4 x float>*, i64, i1, i32, i32)
+declare void @llvm.matrix.column.major.store.v4f32.i64(<4 x float>, ptr, i64, i1, i32, i32)
+declare void @llvm.matrix.column.major.store.v6f32.i64(<6 x float>, ptr, i64, i1, i32, i32)
+declare void @llvm.matrix.column.major.store.v4i32.vi32(<4 x i32>, ptr, i64, i1, i32, i32)
+declare void @llvm.matrix.column.major.store.v4f32.pi32(<4 x float>, ptr, i64, i1, i32, i32)
+declare void @llvm.matrix.column.major.store.v4f32p0.p0(<4 x ptr>, ptr, i64, i1, i32, i32)
 
 declare <4 x i32>   @llvm.matrix.transpose.v4i32.v4f32(<4 x float>, i32, i32)
 declare <4 x float> @llvm.matrix.transpose.v4f32(<4 x float>, i32, i32)

diff  --git a/llvm/test/Verifier/preallocated-invalid.ll b/llvm/test/Verifier/preallocated-invalid.ll
index 2b5b9b912a1d8..38ed1067c497d 100644
--- a/llvm/test/Verifier/preallocated-invalid.ll
+++ b/llvm/test/Verifier/preallocated-invalid.ll
@@ -1,23 +1,22 @@
 ; RUN: not opt -S %s -passes=verify 2>&1 | FileCheck %s
 
 declare token @llvm.call.preallocated.setup(i32)
-declare i8* @llvm.call.preallocated.arg(token, i32)
+declare ptr @llvm.call.preallocated.arg(token, i32)
 declare void @llvm.call.preallocated.teardown(token)
 
 ; Fake LLVM intrinsic to return a token
 declare token @llvm.what()
 
 declare void @foo0()
-declare void @foo1(i32* preallocated(i32))
-declare void @foo2(i32* preallocated(i32), i32*, i32* preallocated(i32))
+declare void @foo1(ptr preallocated(i32))
+declare void @foo2(ptr preallocated(i32), ptr, ptr preallocated(i32))
 declare i32 @blackbox()
 
 ; CHECK: llvm.call.preallocated.arg must be called with a "preallocated" call site attribute
 define void @preallocated_arg_missing_preallocated_attribute() {
     %cs = call token @llvm.call.preallocated.setup(i32 1)
-    %x = call i8* @llvm.call.preallocated.arg(token %cs, i32 0)
-    %y = bitcast i8* %x to i32*
-    call void @foo1(i32* preallocated(i32) %y) ["preallocated"(token %cs)]
+    %x = call ptr @llvm.call.preallocated.arg(token %cs, i32 0)
+    call void @foo1(ptr preallocated(i32) %x) ["preallocated"(token %cs)]
     ret void
 }
 
@@ -60,10 +59,9 @@ define void @preallocated_multiple_bundles() {
 ; CHECK: Can have at most one call
 define void @preallocated_one_call() {
     %cs = call token @llvm.call.preallocated.setup(i32 1)
-    %x = call i8* @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
-    %y = bitcast i8* %x to i32*
-    call void @foo1(i32* preallocated(i32) %y) ["preallocated"(token %cs)]
-    call void @foo1(i32* preallocated(i32) %y) ["preallocated"(token %cs)]
+    %x = call ptr @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
+    call void @foo1(ptr preallocated(i32) %x) ["preallocated"(token %cs)]
+    call void @foo1(ptr preallocated(i32) %x) ["preallocated"(token %cs)]
     ret void
 }
 
@@ -77,44 +75,32 @@ define void @preallocated_setup_constant() {
 ; CHECK: must be between 0 and corresponding
 define void @preallocated_setup_arg_index_in_bounds() {
     %cs = call token @llvm.call.preallocated.setup(i32 2)
-    %a0 = call i8* @llvm.call.preallocated.arg(token %cs, i32 2) preallocated(i32)
-    ret void
-}
-
-; CHECK: Attribute 'preallocated' type does not match parameter
-define void @preallocated_attribute_type_mismatch() {
-    %cs = call token @llvm.call.preallocated.setup(i32 1)
-    %x = call i8* @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
-    %y = bitcast i8* %x to i32*
-    call void @foo1(i32* preallocated(i8) %y) ["preallocated"(token %cs)]
+    %a0 = call ptr @llvm.call.preallocated.arg(token %cs, i32 2) preallocated(i32)
     ret void
 }
 
 ; CHECK: preallocated operand either requires a preallocated bundle or the call to be musttail
 define void @preallocated_require_bundle() {
     %cs = call token @llvm.call.preallocated.setup(i32 1)
-    %x = call i8* @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
-    %y = bitcast i8* %x to i32*
-    call void @foo1(i32* preallocated(i32) %y)
+    %x = call ptr @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
+    call void @foo1(ptr preallocated(i32) %x)
     ret void
 }
 
 ; CHECK: arg size must be equal to number of preallocated arguments
 define void @preallocated_num_args() {
     %cs = call token @llvm.call.preallocated.setup(i32 3)
-    %x = call i8* @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
-    %x1 = bitcast i8* %x to i32*
-    %y = call i8* @llvm.call.preallocated.arg(token %cs, i32 1) preallocated(i32)
-    %y1 = bitcast i8* %y to i32*
-    %a = inttoptr i32 0 to i32*
-    call void @foo2(i32* preallocated(i32) %x1, i32* %a, i32* preallocated(i32) %y1) ["preallocated"(token %cs)]
+    %x = call ptr @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
+    %y = call ptr @llvm.call.preallocated.arg(token %cs, i32 1) preallocated(i32)
+    %a = inttoptr i32 0 to ptr
+    call void @foo2(ptr preallocated(i32) %x, ptr %a, ptr preallocated(i32) %y) ["preallocated"(token %cs)]
     ret void
 }
 
 ; CHECK: token argument must be a llvm.call.preallocated.setup
 define void @preallocated_arg_token() {
     %t = call token @llvm.what()
-    %x = call i8* @llvm.call.preallocated.arg(token %t, i32 1) preallocated(i32)
+    %x = call ptr @llvm.call.preallocated.arg(token %t, i32 1) preallocated(i32)
     ret void
 }
 
@@ -126,15 +112,15 @@ define void @preallocated_no_preallocated_args() {
 }
 
 ; CHECK: preallocated operand either requires a preallocated bundle or the call to be musttail
-define void @musttail_and_bundle(i32* preallocated(i32) %a) {
+define void @musttail_and_bundle(ptr preallocated(i32) %a) {
     %cs = call token @llvm.call.preallocated.setup(i32 0)
-    musttail call void @musttail_and_bundle(i32* preallocated(i32) %a) ["preallocated"(token %cs)]
+    musttail call void @musttail_and_bundle(ptr preallocated(i32) %a) ["preallocated"(token %cs)]
     ret void
 }
 
 ; CHECK: cannot guarantee tail call due to mismatched ABI impacting function attributes
-define void @musttail_attr_no_match(i32* preallocated(i32) %a) {
-    musttail call void @musttail_and_bundle(i32* %a)
+define void @musttail_attr_no_match(ptr preallocated(i32) %a) {
+    musttail call void @musttail_and_bundle(ptr %a)
     ret void
 }
 
@@ -146,5 +132,5 @@ define void @teardown_token_not_from_setup() {
 }
 
 ; CHECK: Attribute 'preallocated(i32)' applied to incompatible type!
-; CHECK-NEXT: void (i32)* @not_pointer
+; CHECK-NEXT: ptr @not_pointer
 declare void @not_pointer(i32 preallocated(i32))

diff  --git a/llvm/test/Verifier/scatter_gather.ll b/llvm/test/Verifier/scatter_gather.ll
index fadb6edc1d78e..53be5026f759e 100644
--- a/llvm/test/Verifier/scatter_gather.ll
+++ b/llvm/test/Verifier/scatter_gather.ll
@@ -2,35 +2,35 @@
 
 ; Mask is not a vector
 ; CHECK: Intrinsic has incorrect argument type!
-define <16 x float> @gather2(<16 x float*> %ptrs, <16 x i1>* %mask, <16 x float> %passthru) {
-  %res = call <16 x float> @llvm.masked.gather.v16f32.v16p0f32(<16 x float*> %ptrs, i32 4, <16 x i1>* %mask, <16 x float> %passthru)
+define <16 x float> @gather2(<16 x ptr> %ptrs, ptr %mask, <16 x float> %passthru) {
+  %res = call <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr> %ptrs, i32 4, ptr %mask, <16 x float> %passthru)
   ret <16 x float> %res
 }
-declare <16 x float> @llvm.masked.gather.v16f32.v16p0f32(<16 x float*>, i32, <16 x i1>*, <16 x float>)
+declare <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr>, i32, ptr, <16 x float>)
 
 ; Mask length != return length
 ; CHECK: Intrinsic has incorrect argument type!
-define <8 x float> @gather3(<8 x float*> %ptrs, <16 x i1> %mask, <8 x float> %passthru) {
-  %res = call <8 x float> @llvm.masked.gather.v8f32.v8p0f32(<8 x float*> %ptrs, i32 4, <16 x i1> %mask, <8 x float> %passthru)
+define <8 x float> @gather3(<8 x ptr> %ptrs, <16 x i1> %mask, <8 x float> %passthru) {
+  %res = call <8 x float> @llvm.masked.gather.v8f32.v8p0(<8 x ptr> %ptrs, i32 4, <16 x i1> %mask, <8 x float> %passthru)
   ret <8 x float> %res
 }
-declare <8 x float> @llvm.masked.gather.v8f32.v8p0f32(<8 x float*>, i32, <16 x i1>, <8 x float>)
+declare <8 x float> @llvm.masked.gather.v8f32.v8p0(<8 x ptr>, i32, <16 x i1>, <8 x float>)
 
 ; Return type is not a vector
 ; CHECK: Intrinsic has incorrect return type!
-define <8 x float>* @gather4(<8 x float*> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
-  %res = call <8 x float>* @llvm.masked.gather.p0v8f32.v8p0f32(<8 x float*> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
-  ret <8 x float>* %res
+define ptr @gather4(<8 x ptr> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
+  %res = call ptr @llvm.masked.gather.p0.v8p0(<8 x ptr> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
+  ret ptr %res
 }
-declare <8 x float>* @llvm.masked.gather.p0v8f32.v8p0f32(<8 x float*>, i32, <8 x i1>, <8 x float>)
+declare ptr @llvm.masked.gather.p0.v8p0(<8 x ptr>, i32, <8 x i1>, <8 x float>)
 
 ; Value type is not a vector
 ; CHECK: Intrinsic has incorrect argument type!
-define <8 x float> @gather5(<8 x float*>* %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
-  %res = call <8 x float> @llvm.masked.gather.v8f32.p0v8p0f32(<8 x float*>* %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
+define <8 x float> @gather5(ptr %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
+  %res = call <8 x float> @llvm.masked.gather.v8f32.p0(ptr %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
   ret <8 x float> %res
 }
-declare <8 x float> @llvm.masked.gather.v8f32.p0v8p0f32(<8 x float*>*, i32, <8 x i1>, <8 x float>)
+declare <8 x float> @llvm.masked.gather.v8f32.p0(ptr, i32, <8 x i1>, <8 x float>)
 
 ; Value type is not a vector of pointers
 ; CHECK: Intrinsic has incorrect argument type!
@@ -40,83 +40,75 @@ define <8 x float> @gather6(<8 x float> %ptrs, <8 x i1> %mask, <8 x float> %pass
 }
 declare <8 x float> @llvm.masked.gather.v8f32.v8f32(<8 x float>, i32, <8 x i1>, <8 x float>)
 
-; Value element type != vector of pointers element
-; CHECK: Intrinsic has incorrect argument type!
-define <8 x float> @gather7(<8 x double*> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
-  %res = call <8 x float> @llvm.masked.gather.v8f32.v8p0f64(<8 x double*> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
-  ret <8 x float> %res
-}
-declare <8 x float> @llvm.masked.gather.v8f32.v8p0f64(<8 x double*>, i32, <8 x i1>, <8 x float>)
-
 ; Value length!= vector of pointers length
 ; CHECK: Intrinsic has incorrect argument type!
-define <8 x float> @gather8(<16 x float*> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
-  %res = call <8 x float> @llvm.masked.gather.v8f32.v16p0f32(<16 x float*> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
+; CHECK-NEXT: ptr @llvm.masked.gather.v8f32.v16p0
+define <8 x float> @gather8(<16 x ptr> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
+  %res = call <8 x float> @llvm.masked.gather.v8f32.v16p0(<16 x ptr> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
   ret <8 x float> %res
 }
-declare <8 x float> @llvm.masked.gather.v8f32.v16p0f32(<16 x float*>, i32, <8 x i1>, <8 x float>)
+declare <8 x float> @llvm.masked.gather.v8f32.v16p0(<16 x ptr>, i32, <8 x i1>, <8 x float>)
 
 ; Passthru type doesn't match return type
 ; CHECK: Intrinsic has incorrect argument type!
-define <16 x i32> @gather9(<16 x i32*> %ptrs, <16 x i1> %mask, <8 x i32> %passthru) {
-  %res = call <16 x i32> @llvm.masked.gather.v16i32.v16p0i32(<16 x i32*> %ptrs, i32 4, <16 x i1> %mask, <8 x i32> %passthru)
+; CHECK-NEXT: ptr @llvm.masked.gather.v16i32.v16p0
+define <16 x i32> @gather9(<16 x ptr> %ptrs, <16 x i1> %mask, <8 x i32> %passthru) {
+  %res = call <16 x i32> @llvm.masked.gather.v16i32.v16p0(<16 x ptr> %ptrs, i32 4, <16 x i1> %mask, <8 x i32> %passthru)
   ret <16 x i32> %res
 }
-declare <16 x i32> @llvm.masked.gather.v16i32.v16p0i32(<16 x i32*>, i32, <16 x i1>, <8 x i32>)
+declare <16 x i32> @llvm.masked.gather.v16i32.v16p0(<16 x ptr>, i32, <16 x i1>, <8 x i32>)
 
 ; Mask is not a vector
 ; CHECK: Intrinsic has incorrect argument type!
-define void @scatter2(<16 x float> %value, <16 x float*> %ptrs, <16 x i1>* %mask) {
-  call void @llvm.masked.scatter.v16f32.v16p0f32(<16 x float> %value, <16 x float*> %ptrs, i32 4, <16 x i1>* %mask)
+; CHECK-NEXT: ptr @llvm.masked.scatter.v16f32.v16p0
+define void @scatter2(<16 x float> %value, <16 x ptr> %ptrs, ptr %mask) {
+  call void @llvm.masked.scatter.v16f32.v16p0(<16 x float> %value, <16 x ptr> %ptrs, i32 4, ptr %mask)
   ret void
 }
-declare void @llvm.masked.scatter.v16f32.v16p0f32(<16 x float>, <16 x float*>, i32, <16 x i1>*)
+declare void @llvm.masked.scatter.v16f32.v16p0(<16 x float>, <16 x ptr>, i32, ptr)
 
 ; Mask length != value length
 ; CHECK: Intrinsic has incorrect argument type!
-define void @scatter3(<8 x float> %value, <8 x float*> %ptrs, <16 x i1> %mask) {
-  call void @llvm.masked.scatter.v8f32.v8p0f32(<8 x float> %value, <8 x float*> %ptrs, i32 4, <16 x i1> %mask)
+; CHECK-NEXT: ptr @llvm.masked.scatter.v8f32.v8p0
+define void @scatter3(<8 x float> %value, <8 x ptr> %ptrs, <16 x i1> %mask) {
+  call void @llvm.masked.scatter.v8f32.v8p0(<8 x float> %value, <8 x ptr> %ptrs, i32 4, <16 x i1> %mask)
   ret void
 }
-declare void @llvm.masked.scatter.v8f32.v8p0f32(<8 x float>, <8 x float*>, i32, <16 x i1>)
+declare void @llvm.masked.scatter.v8f32.v8p0(<8 x float>, <8 x ptr>, i32, <16 x i1>)
 
 ; Value type is not a vector
 ; CHECK: Intrinsic has incorrect argument type!
-define void @scatter4(<8 x float>* %value, <8 x float*> %ptrs, <8 x i1> %mask) {
-  call void @llvm.masked.scatter.p0v8f32.v8p0f32(<8 x float>* %value, <8 x float*> %ptrs, i32 4, <8 x i1> %mask)
+; CHECK-NEXT: ptr @llvm.masked.scatter.p0.v8p0
+define void @scatter4(ptr %value, <8 x ptr> %ptrs, <8 x i1> %mask) {
+  call void @llvm.masked.scatter.p0.v8p0(ptr %value, <8 x ptr> %ptrs, i32 4, <8 x i1> %mask)
   ret void
 }
-declare void @llvm.masked.scatter.p0v8f32.v8p0f32(<8 x float>*, <8 x float*>, i32, <8 x i1>)
+declare void @llvm.masked.scatter.p0.v8p0(ptr, <8 x ptr>, i32, <8 x i1>)
 
 ; ptrs is not a vector
 ; CHECK: Intrinsic has incorrect argument type!
-define void @scatter5(<8 x float> %value, <8 x float*>* %ptrs, <8 x i1> %mask) {
-  call void @llvm.masked.scatter.v8f32.p0v8p0f32(<8 x float> %value, <8 x float*>* %ptrs, i32 4, <8 x i1> %mask)
+; CHECK-NEXT: ptr @llvm.masked.scatter.v8f32.p0
+define void @scatter5(<8 x float> %value, ptr %ptrs, <8 x i1> %mask) {
+  call void @llvm.masked.scatter.v8f32.p0(<8 x float> %value, ptr %ptrs, i32 4, <8 x i1> %mask)
   ret void
 }
-declare void @llvm.masked.scatter.v8f32.p0v8p0f32(<8 x float>, <8 x float*>*, i32, <8 x i1>)
+declare void @llvm.masked.scatter.v8f32.p0(<8 x float>, ptr, i32, <8 x i1>)
 
 ; Value type is not a vector of pointers
 ; CHECK: Intrinsic has incorrect argument type!
+; CHECK-NEXT: ptr @llvm.masked.scatter.v8f32.v8f32
 define void @scatter6(<8 x float> %value, <8 x float> %ptrs, <8 x i1> %mask) {
   call void @llvm.masked.scatter.v8f32.v8f32(<8 x float> %value, <8 x float> %ptrs, i32 4, <8 x i1> %mask)
   ret void
 }
 declare void @llvm.masked.scatter.v8f32.v8f32(<8 x float>, <8 x float>, i32, <8 x i1>)
 
-; Value element type != vector of pointers element
-; CHECK: Intrinsic has incorrect argument type!
-define void @scatter7(<8 x float> %value, <8 x double*> %ptrs, <8 x i1> %mask) {
-  call void @llvm.masked.scatter.v8f32.v8p0f64(<8 x float> %value, <8 x double*> %ptrs, i32 4, <8 x i1> %mask)
-  ret void
-}
-declare void @llvm.masked.scatter.v8f32.v8p0f64(<8 x float>, <8 x double*>, i32, <8 x i1>)
-
 ; Value length!= vector of pointers length
 ; CHECK: Intrinsic has incorrect argument type!
-define void @scatter8(<8 x float> %value, <16 x float*> %ptrs, <8 x i1> %mask) {
-  call void @llvm.masked.scatter.v8f32.v16p0f32(<8 x float> %value, <16 x float*> %ptrs, i32 4, <8 x i1> %mask)
+; CHECK-NEXT: ptr @llvm.masked.scatter.v8f32.v16p0
+define void @scatter8(<8 x float> %value, <16 x ptr> %ptrs, <8 x i1> %mask) {
+  call void @llvm.masked.scatter.v8f32.v16p0(<8 x float> %value, <16 x ptr> %ptrs, i32 4, <8 x i1> %mask)
   ret void
 }
-declare void @llvm.masked.scatter.v8f32.v16p0f32(<8 x float>, <16 x float*>, i32, <8 x i1>)
+declare void @llvm.masked.scatter.v8f32.v16p0(<8 x float>, <16 x ptr>, i32, <8 x i1>)
 

diff  --git a/llvm/test/Verifier/swifterror.ll b/llvm/test/Verifier/swifterror.ll
index 73d79abb1f67d..d27b43234cadc 100644
--- a/llvm/test/Verifier/swifterror.ll
+++ b/llvm/test/Verifier/swifterror.ll
@@ -3,21 +3,21 @@
 %swift_error = type {i64, i8}
 
 ; CHECK: swifterror value can only be loaded and stored from, or as a swifterror argument!
-; CHECK: %swift_error** %error_ptr_ref
-; CHECK: %t = getelementptr inbounds %swift_error*, %swift_error** %error_ptr_ref, i64 1
-define float @foo(%swift_error** swifterror %error_ptr_ref) {
-  %t = getelementptr inbounds %swift_error*, %swift_error** %error_ptr_ref, i64 1
+; CHECK: ptr %error_ptr_ref
+; CHECK: %t = getelementptr inbounds ptr, ptr %error_ptr_ref, i64 1
+define float @foo(ptr swifterror %error_ptr_ref) {
+  %t = getelementptr inbounds ptr, ptr %error_ptr_ref, i64 1
   ret float 1.0
 }
 
 ; CHECK: swifterror argument for call has mismatched alloca
-; CHECK: %error_ptr_ref = alloca %swift_error*
-; CHECK: %call = call float @foo(%swift_error** swifterror %error_ptr_ref)
-define float @caller(i8* %error_ref) {
+; CHECK: %error_ptr_ref = alloca ptr
+; CHECK: %call = call float @foo(ptr swifterror %error_ptr_ref)
+define float @caller(ptr %error_ref) {
 entry:
-  %error_ptr_ref = alloca %swift_error*
-  store %swift_error* null, %swift_error** %error_ptr_ref
-  %call = call float @foo(%swift_error** swifterror %error_ptr_ref)
+  %error_ptr_ref = alloca ptr
+  store ptr null, ptr %error_ptr_ref
+  %call = call float @foo(ptr swifterror %error_ptr_ref)
   ret float 1.0
 }
 
@@ -29,15 +29,12 @@ define void @swifterror_alloca_invalid_type() {
 
 ; CHECK: swifterror alloca must not be array allocation
 define void @swifterror_alloca_array() {
-  %a = alloca swifterror i8*, i64 2
+  %a = alloca swifterror ptr, i64 2
   ret void
 }
 
 ; CHECK: Cannot have multiple 'swifterror' parameters!
-declare void @a(i32** swifterror %a, i32** swifterror %b)
+declare void @a(ptr swifterror %a, ptr swifterror %b)
 
 ; CHECK: Attribute 'swifterror' applied to incompatible type!
 declare void @b(i32 swifterror %a)
-
-; CHECK: Attribute 'swifterror' only applies to parameters with pointer to pointer type!
-declare void @c(i32* swifterror %a)

diff  --git a/llvm/test/Verifier/x86_amx8.ll b/llvm/test/Verifier/x86_amx8.ll
deleted file mode 100644
index 9dadc1f3eca7d..0000000000000
--- a/llvm/test/Verifier/x86_amx8.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
-
- at GV = dso_local global x86_amx* null
-; CHECK: pointer to this type is invalid


        


More information about the llvm-commits mailing list