[llvm] 8e44f13 - [MemorySSA] Convert tests to use opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 01:34:44 PDT 2022


Author: Nikita Popov
Date: 2022-09-23T10:34:09+02:00
New Revision: 8e44f13c6d294e6b4864441b22045b507782540c

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

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

Added: 
    

Modified: 
    llvm/test/Analysis/MemorySSA/assume.ll
    llvm/test/Analysis/MemorySSA/atomic-clobber.ll
    llvm/test/Analysis/MemorySSA/basicaa-memcpy.ll
    llvm/test/Analysis/MemorySSA/call-bitcast.ll
    llvm/test/Analysis/MemorySSA/constant-memory.ll
    llvm/test/Analysis/MemorySSA/cyclicphi.ll
    llvm/test/Analysis/MemorySSA/debugvalue.ll
    llvm/test/Analysis/MemorySSA/debugvalue2.ll
    llvm/test/Analysis/MemorySSA/forward-unreachable.ll
    llvm/test/Analysis/MemorySSA/function-clobber.ll
    llvm/test/Analysis/MemorySSA/function-mem-attrs.ll
    llvm/test/Analysis/MemorySSA/invalidate.ll
    llvm/test/Analysis/MemorySSA/invariant-groups.ll
    llvm/test/Analysis/MemorySSA/lifetime-simple.ll
    llvm/test/Analysis/MemorySSA/load-invariant.ll
    llvm/test/Analysis/MemorySSA/loop-rotate-disablebasicaa.ll
    llvm/test/Analysis/MemorySSA/loop-rotate-inv-template.ll
    llvm/test/Analysis/MemorySSA/loop-rotate-simplified-clone.ll
    llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll
    llvm/test/Analysis/MemorySSA/loop_rotate_remove_trivial_phis.ll
    llvm/test/Analysis/MemorySSA/many-dom-backedge.ll
    llvm/test/Analysis/MemorySSA/many-doms.ll
    llvm/test/Analysis/MemorySSA/multi-edges.ll
    llvm/test/Analysis/MemorySSA/multiple-backedges-hal.ll
    llvm/test/Analysis/MemorySSA/multiple-locations.ll
    llvm/test/Analysis/MemorySSA/no-disconnected.ll
    llvm/test/Analysis/MemorySSA/noalias-scope-decl.ll
    llvm/test/Analysis/MemorySSA/nondeterminism.ll
    llvm/test/Analysis/MemorySSA/optimize-use.ll
    llvm/test/Analysis/MemorySSA/phi-translation.ll
    llvm/test/Analysis/MemorySSA/pr28880.ll
    llvm/test/Analysis/MemorySSA/pr36883.ll
    llvm/test/Analysis/MemorySSA/pr39197.ll
    llvm/test/Analysis/MemorySSA/pr40037.ll
    llvm/test/Analysis/MemorySSA/pr40038.ll
    llvm/test/Analysis/MemorySSA/pr40509.ll
    llvm/test/Analysis/MemorySSA/pr40749.ll
    llvm/test/Analysis/MemorySSA/pr40749_2.ll
    llvm/test/Analysis/MemorySSA/pr40754.ll
    llvm/test/Analysis/MemorySSA/pr41254.ll
    llvm/test/Analysis/MemorySSA/pr41640.ll
    llvm/test/Analysis/MemorySSA/pr41853.ll
    llvm/test/Analysis/MemorySSA/pr42294.ll
    llvm/test/Analysis/MemorySSA/pr42940.ll
    llvm/test/Analysis/MemorySSA/pr43044.ll
    llvm/test/Analysis/MemorySSA/pr43317.ll
    llvm/test/Analysis/MemorySSA/pr43320.ll
    llvm/test/Analysis/MemorySSA/pr43426.ll
    llvm/test/Analysis/MemorySSA/pr43427.ll
    llvm/test/Analysis/MemorySSA/pr43438.ll
    llvm/test/Analysis/MemorySSA/pr43493.ll
    llvm/test/Analysis/MemorySSA/pr43540.ll
    llvm/test/Analysis/MemorySSA/pr43541.ll
    llvm/test/Analysis/MemorySSA/pr43569.ll
    llvm/test/Analysis/MemorySSA/pr43641.ll
    llvm/test/Analysis/MemorySSA/pr44027.ll
    llvm/test/Analysis/MemorySSA/pr44029.ll
    llvm/test/Analysis/MemorySSA/pr45927.ll
    llvm/test/Analysis/MemorySSA/pr45976.ll
    llvm/test/Analysis/MemorySSA/pr46574.ll
    llvm/test/Analysis/MemorySSA/pr49859.ll
    llvm/test/Analysis/MemorySSA/print-dot-cfg-mssa.ll
    llvm/test/Analysis/MemorySSA/print-walker.ll
    llvm/test/Analysis/MemorySSA/ptr-const-mem.ll
    llvm/test/Analysis/MemorySSA/reduce_clobber_limit.ll
    llvm/test/Analysis/MemorySSA/renamephis.ll
    llvm/test/Analysis/MemorySSA/scalable-vec.ll
    llvm/test/Analysis/MemorySSA/update-remove-dead-blocks.ll
    llvm/test/Analysis/MemorySSA/update_unroll.ll
    llvm/test/Analysis/MemorySSA/volatile-clobber.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Analysis/MemorySSA/assume.ll b/llvm/test/Analysis/MemorySSA/assume.ll
index 543205ebff775..941c1863f7fdf 100644
--- a/llvm/test/Analysis/MemorySSA/assume.ll
+++ b/llvm/test/Analysis/MemorySSA/assume.ll
@@ -4,15 +4,15 @@
 
 declare void @llvm.assume(i1)
 
-define i32 @foo(i32* %a, i32* %b, i1 %c) {
+define i32 @foo(ptr %a, ptr %b, i1 %c) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 4
-  store i32 4, i32* %a, align 4
+  store i32 4, ptr %a, align 4
 ; CHECK-NOT: MemoryDef
 ; CHECK: call void @llvm.assume
   call void @llvm.assume(i1 %c)
 ; CHECK: MemoryUse(1)
 ; CHECK-NEXT: %1 = load i32
-  %1 = load i32, i32* %a, align 4
+  %1 = load i32, ptr %a, align 4
   ret i32 %1
 }

diff  --git a/llvm/test/Analysis/MemorySSA/atomic-clobber.ll b/llvm/test/Analysis/MemorySSA/atomic-clobber.ll
index ea765915280c1..326ec8b15283d 100644
--- a/llvm/test/Analysis/MemorySSA/atomic-clobber.ll
+++ b/llvm/test/Analysis/MemorySSA/atomic-clobber.ll
@@ -3,96 +3,96 @@
 ; Ensures that atomic loads count as MemoryDefs
 
 ; CHECK-LABEL: define i32 @foo
-define i32 @foo(i32* %a, i32* %b) {
+define i32 @foo(ptr %a, ptr %b) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 4
-  store i32 4, i32* %a, align 4
+  store i32 4, ptr %a, align 4
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: %1 = load atomic i32
-  %1 = load atomic i32, i32* %b acquire, align 4
+  %1 = load atomic i32, ptr %b acquire, align 4
 ; CHECK: MemoryUse(2)
 ; CHECK-NEXT: %2 = load i32
-  %2 = load i32, i32* %a, align 4
+  %2 = load i32, ptr %a, align 4
   %3 = add i32 %1, %2
   ret i32 %3
 }
 
 ; CHECK-LABEL: define void @bar
-define void @bar(i32* %a) {
+define void @bar(ptr %a) {
 ; CHECK: MemoryUse(liveOnEntry)
-; CHECK-NEXT: load atomic i32, i32* %a unordered, align 4
-  load atomic i32, i32* %a unordered, align 4
+; CHECK-NEXT: load atomic i32, ptr %a unordered, align 4
+  load atomic i32, ptr %a unordered, align 4
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: load atomic i32, i32* %a monotonic, align 4
-  load atomic i32, i32* %a monotonic, align 4
+; CHECK-NEXT: load atomic i32, ptr %a monotonic, align 4
+  load atomic i32, ptr %a monotonic, align 4
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: load atomic i32, i32* %a acquire, align 4
-  load atomic i32, i32* %a acquire, align 4
+; CHECK-NEXT: load atomic i32, ptr %a acquire, align 4
+  load atomic i32, ptr %a acquire, align 4
 ; CHECK: 3 = MemoryDef(2)
-; CHECK-NEXT: load atomic i32, i32* %a seq_cst, align 4
-  load atomic i32, i32* %a seq_cst, align 4
+; CHECK-NEXT: load atomic i32, ptr %a seq_cst, align 4
+  load atomic i32, ptr %a seq_cst, align 4
   ret void
 }
 
 ; CHECK-LABEL: define void @baz
-define void @baz(i32* %a) {
+define void @baz(ptr %a) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: %1 = load atomic i32
-  %1 = load atomic i32, i32* %a acquire, align 4
+  %1 = load atomic i32, ptr %a acquire, align 4
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: %2 = load atomic i32, i32* %a unordered, align 4
-  %2 = load atomic i32, i32* %a unordered, align 4
+; CHECK-NEXT: %2 = load atomic i32, ptr %a unordered, align 4
+  %2 = load atomic i32, ptr %a unordered, align 4
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: %3 = load atomic i32, i32* %a monotonic, align 4
-  %3 = load atomic i32, i32* %a monotonic, align 4
+; CHECK-NEXT: %3 = load atomic i32, ptr %a monotonic, align 4
+  %3 = load atomic i32, ptr %a monotonic, align 4
   ret void
 }
 
 ; CHECK-LABEL: define void @fences
-define void @fences(i32* %a) {
+define void @fences(ptr %a) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: fence acquire
   fence acquire
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: %1 = load i32, i32* %a
-  %1 = load i32, i32* %a
+; CHECK-NEXT: %1 = load i32, ptr %a
+  %1 = load i32, ptr %a
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: fence release
   fence release
 ; CHECK: MemoryUse(2)
-; CHECK-NEXT: %2 = load i32, i32* %a
-  %2 = load i32, i32* %a
+; CHECK-NEXT: %2 = load i32, ptr %a
+  %2 = load i32, ptr %a
 
 ; CHECK: 3 = MemoryDef(2)
 ; CHECK-NEXT: fence acq_rel
   fence acq_rel
 ; CHECK: MemoryUse(3)
-; CHECK-NEXT: %3 = load i32, i32* %a
-  %3 = load i32, i32* %a
+; CHECK-NEXT: %3 = load i32, ptr %a
+  %3 = load i32, ptr %a
 
 ; CHECK: 4 = MemoryDef(3)
 ; CHECK-NEXT: fence seq_cst
   fence seq_cst
 ; CHECK: MemoryUse(4)
-; CHECK-NEXT: %4 = load i32, i32* %a
-  %4 = load i32, i32* %a
+; CHECK-NEXT: %4 = load i32, ptr %a
+  %4 = load i32, ptr %a
   ret void
 }
 
 ; CHECK-LABEL: define void @seq_cst_clobber
-define void @seq_cst_clobber(i32* noalias %a, i32* noalias %b) {
+define void @seq_cst_clobber(ptr noalias %a, ptr noalias %b) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: %1 = load atomic i32, i32* %a monotonic, align 4
-  load atomic i32, i32* %a monotonic, align 4
+; CHECK-NEXT: %1 = load atomic i32, ptr %a monotonic, align 4
+  load atomic i32, ptr %a monotonic, align 4
 
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: %2 = load atomic i32, i32* %a seq_cst, align 4
-  load atomic i32, i32* %a seq_cst, align 4
+; CHECK-NEXT: %2 = load atomic i32, ptr %a seq_cst, align 4
+  load atomic i32, ptr %a seq_cst, align 4
 
 ; CHECK: 3 = MemoryDef(2)
-; CHECK-NEXT: load atomic i32, i32* %a monotonic, align 4
-  load atomic i32, i32* %a monotonic, align 4
+; CHECK-NEXT: load atomic i32, ptr %a monotonic, align 4
+  load atomic i32, ptr %a monotonic, align 4
 
   ret void
 }
@@ -106,13 +106,13 @@ define void @seq_cst_clobber(i32* noalias %a, i32* noalias %b) {
 ; If AA gets more aggressive, we can find another way.
 ;
 ; CHECK-LABEL: define void @check_aa_is_sane
-define void @check_aa_is_sane(i32* noalias %a, i32* noalias %b) {
+define void @check_aa_is_sane(ptr noalias %a, ptr noalias %b) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: cmpxchg i32* %a, i32 0, i32 1 acquire acquire
-  cmpxchg i32* %a, i32 0, i32 1 acquire acquire
+; CHECK-NEXT: cmpxchg ptr %a, i32 0, i32 1 acquire acquire
+  cmpxchg ptr %a, i32 0, i32 1 acquire acquire
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: load i32, i32* %b, align 4
-  load i32, i32* %b, align 4
+; CHECK-NEXT: load i32, ptr %b, align 4
+  load i32, ptr %b, align 4
 
   ret void
 }

diff  --git a/llvm/test/Analysis/MemorySSA/basicaa-memcpy.ll b/llvm/test/Analysis/MemorySSA/basicaa-memcpy.ll
index 69a3b3229ce43..d548c9be92d25 100644
--- a/llvm/test/Analysis/MemorySSA/basicaa-memcpy.ll
+++ b/llvm/test/Analysis/MemorySSA/basicaa-memcpy.ll
@@ -1,16 +1,16 @@
 ; RUN: opt -disable-output -passes='print<memoryssa>' %s 2>&1 | FileCheck %s
 
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind
 
-define void @source_clobber(i8* %a, i8* %b) {
+define void @source_clobber(ptr %a, ptr %b) {
 ; CHECK-LABEL: @source_clobber(
 ; CHECK-NEXT:  ; 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 128, i1 false)
+; CHECK-NEXT:    call void @llvm.memcpy.p0.p0.i64(ptr %a, ptr %b, i64 128, i1 false)
 ; CHECK-NEXT:  ; MemoryUse(1)
-; CHECK-NEXT:    [[X:%.*]] = load i8, i8* %b
+; CHECK-NEXT:    [[X:%.*]] = load i8, ptr %b
 ; CHECK-NEXT:    ret void
 ;
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 128, i1 false)
-  %x = load i8, i8* %b
+  call void @llvm.memcpy.p0.p0.i64(ptr %a, ptr %b, i64 128, i1 false)
+  %x = load i8, ptr %b
   ret void
 }

diff  --git a/llvm/test/Analysis/MemorySSA/call-bitcast.ll b/llvm/test/Analysis/MemorySSA/call-bitcast.ll
index f0d1955b718fc..0e946091273ce 100644
--- a/llvm/test/Analysis/MemorySSA/call-bitcast.ll
+++ b/llvm/test/Analysis/MemorySSA/call-bitcast.ll
@@ -1,14 +1,15 @@
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
-; Ensures that MemorySSA leverages the ground truth of the function being called when wrapped in a bitcast.
+; Ensures that MemorySSA leverages the ground truth of the function being
+; called even if the call and function signatures don't match.
 
 declare i1 @opaque_true(i1) nounwind readonly
 
-define i1 @foo(i32* %ptr, i1 %cond) {
+define i1 @foo(ptr %ptr, i1 %cond) {
   %cond_wide = zext i1 %cond to i32
 ; CHECK: MemoryUse(liveOnEntry)
-; CHECK-NEXT: call i32 bitcast
-  %cond_hidden_wide = call i32 bitcast (i1 (i1)* @opaque_true to i32 (i32)*)(i32 %cond_wide)
+; CHECK-NEXT: call i32 @opaque_true(i32 %cond_wide)
+  %cond_hidden_wide = call i32 @opaque_true(i32 %cond_wide)
   %cond_hidden = trunc i32 %cond_hidden_wide to i1
   ret i1 %cond_hidden
 }

diff  --git a/llvm/test/Analysis/MemorySSA/constant-memory.ll b/llvm/test/Analysis/MemorySSA/constant-memory.ll
index be4a1ba9ed263..5db4e66da14b5 100644
--- a/llvm/test/Analysis/MemorySSA/constant-memory.ll
+++ b/llvm/test/Analysis/MemorySSA/constant-memory.ll
@@ -11,31 +11,29 @@ define i8 @foo() {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: call void @clobberAllTheThings()
   call void @clobberAllTheThings()
-  %1 = getelementptr [2 x i8], [2 x i8]* @str, i64 0, i64 0
 ; CHECK: MemoryUse(liveOnEntry)
-; CHECK-NEXT: %2 = load i8
-  %2 = load i8, i8* %1, align 1
-  %3 = getelementptr [2 x i8], [2 x i8]* @str, i64 0, i64 1
+; CHECK-NEXT: %1 = load i8
+  %1 = load i8, ptr @str, align 1
+  %2 = getelementptr [2 x i8], ptr @str, i64 0, i64 1
 ; CHECK: MemoryUse(liveOnEntry)
-; CHECK-NEXT: %4 = load i8
-  %4 = load i8, i8* %3, align 1
-  %5 = add i8 %2, %4
-  ret i8 %5
+; CHECK-NEXT: %3 = load i8
+  %3 = load i8, ptr %2, align 1
+  %4 = add i8 %1, %3
+  ret i8 %4
 }
 
 define i8 @select(i1 %b) {
   %1 = alloca i8, align 1
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i8 0
-  store i8 0, i8* %1, align 1
+  store i8 0, ptr %1, align 1
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: call void @clobberAllTheThings()
   call void @clobberAllTheThings()
-  %2 = getelementptr [2 x i8], [2 x i8]* @str, i64 0, i64 0
-  %3 = select i1 %b, i8* %2, i8* %1
+  %2 = select i1 %b, ptr @str, ptr %1
 ; CHECK: MemoryUse(2)
-; CHECK-NEXT: %4 = load i8
-  %4 = load i8, i8* %3, align 1
-  ret i8 %4
+; CHECK-NEXT: %3 = load i8
+  %3 = load i8, ptr %2, align 1
+  ret i8 %3
 }

diff  --git a/llvm/test/Analysis/MemorySSA/cyclicphi.ll b/llvm/test/Analysis/MemorySSA/cyclicphi.ll
index f1980bb7302e1..8a4ec1753fdc5 100644
--- a/llvm/test/Analysis/MemorySSA/cyclicphi.ll
+++ b/llvm/test/Analysis/MemorySSA/cyclicphi.ll
@@ -3,10 +3,9 @@
 %struct.hoge = type { i32, %struct.widget }
 %struct.widget = type { i64 }
 
-define hidden void @quux(%struct.hoge *%f) align 2 {
-  %tmp = getelementptr inbounds %struct.hoge, %struct.hoge* %f, i64 0, i32 1, i32 0
-  %tmp24 = getelementptr inbounds %struct.hoge, %struct.hoge* %f, i64 0, i32 1
-  %tmp25 = bitcast %struct.widget* %tmp24 to i64**
+define hidden void @quux(ptr %f) align 2 {
+  %tmp = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1, i32 0
+  %tmp24 = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1
   br label %bb26
 
 bb26:                                             ; preds = %bb77, %0
@@ -16,27 +15,26 @@ bb26:                                             ; preds = %bb77, %0
 
 bb68:                                             ; preds = %bb26
 ; CHECK:  MemoryUse(liveOnEntry)
-; CHECK-NEXT:   %tmp69 = load i64, i64* null, align 8
-  %tmp69 = load i64, i64* null, align 8
+; CHECK-NEXT:   %tmp69 = load i64, ptr null, align 8
+  %tmp69 = load i64, ptr null, align 8
 ; CHECK:  1 = MemoryDef(3)
-; CHECK-NEXT:   store i64 %tmp69, i64* %tmp, align 8
-  store i64 %tmp69, i64* %tmp, align 8
+; CHECK-NEXT:   store i64 %tmp69, ptr %tmp, align 8
+  store i64 %tmp69, ptr %tmp, align 8
   br label %bb77
 
 bb77:                                             ; preds = %bb68, %bb26
 ; CHECK:  2 = MemoryPhi({bb26,3},{bb68,1})
 ; CHECK:  MemoryUse(2)
-; CHECK-NEXT:   %tmp78 = load i64*, i64** %tmp25, align 8
-  %tmp78 = load i64*, i64** %tmp25, align 8
-  %tmp79 = getelementptr inbounds i64, i64* %tmp78, i64 undef
+; CHECK-NEXT:   %tmp78 = load ptr, ptr %tmp24, align 8
+  %tmp78 = load ptr, ptr %tmp24, align 8
+  %tmp79 = getelementptr inbounds i64, ptr %tmp78, i64 undef
   br label %bb26
 }
 
-define hidden void @quux_no_null_opt(%struct.hoge *%f) align 2 #0 {
+define hidden void @quux_no_null_opt(ptr %f) align 2 #0 {
 ; CHECK-LABEL: quux_no_null_opt(
-  %tmp = getelementptr inbounds %struct.hoge, %struct.hoge* %f, i64 0, i32 1, i32 0
-  %tmp24 = getelementptr inbounds %struct.hoge, %struct.hoge* %f, i64 0, i32 1
-  %tmp25 = bitcast %struct.widget* %tmp24 to i64**
+  %tmp = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1, i32 0
+  %tmp24 = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1
   br label %bb26
 
 bb26:                                             ; preds = %bb77, %0
@@ -46,27 +44,26 @@ bb26:                                             ; preds = %bb77, %0
 
 bb68:                                             ; preds = %bb26
 ; CHECK:  MemoryUse(3)
-; CHECK-NEXT:   %tmp69 = load i64, i64* null, align 8
-  %tmp69 = load i64, i64* null, align 8
+; CHECK-NEXT:   %tmp69 = load i64, ptr null, align 8
+  %tmp69 = load i64, ptr null, align 8
 ; CHECK:  1 = MemoryDef(3)
-; CHECK-NEXT:   store i64 %tmp69, i64* %tmp, align 8
-  store i64 %tmp69, i64* %tmp, align 8
+; CHECK-NEXT:   store i64 %tmp69, ptr %tmp, align 8
+  store i64 %tmp69, ptr %tmp, align 8
   br label %bb77
 
 bb77:                                             ; preds = %bb68, %bb26
 ; CHECK:  2 = MemoryPhi({bb26,3},{bb68,1})
 ; CHECK:  MemoryUse(2)
-; CHECK-NEXT:   %tmp78 = load i64*, i64** %tmp25, align 8
-  %tmp78 = load i64*, i64** %tmp25, align 8
-  %tmp79 = getelementptr inbounds i64, i64* %tmp78, i64 undef
+; CHECK-NEXT:   %tmp78 = load ptr, ptr %tmp24, align 8
+  %tmp78 = load ptr, ptr %tmp24, align 8
+  %tmp79 = getelementptr inbounds i64, ptr %tmp78, i64 undef
   br label %bb26
 }
 
 ; CHECK-LABEL: define void @quux_skip
-define void @quux_skip(%struct.hoge* noalias %f, i64* noalias %g) align 2 {
-  %tmp = getelementptr inbounds %struct.hoge, %struct.hoge* %f, i64 0, i32 1, i32 0
-  %tmp24 = getelementptr inbounds %struct.hoge, %struct.hoge* %f, i64 0, i32 1
-  %tmp25 = bitcast %struct.widget* %tmp24 to i64**
+define void @quux_skip(ptr noalias %f, ptr noalias %g) align 2 {
+  %tmp = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1, i32 0
+  %tmp24 = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1
   br label %bb26
 
 bb26:                                             ; preds = %bb77, %0
@@ -76,73 +73,71 @@ bb26:                                             ; preds = %bb77, %0
 
 bb68:                                             ; preds = %bb26
 ; CHECK: MemoryUse(3)
-; CHECK-NEXT: %tmp69 = load i64, i64* %g, align 8
-  %tmp69 = load i64, i64* %g, align 8
+; CHECK-NEXT: %tmp69 = load i64, ptr %g, align 8
+  %tmp69 = load i64, ptr %g, align 8
 ; CHECK: 1 = MemoryDef(3)
-; CHECK-NEXT: store i64 %tmp69, i64* %g, align 8
-  store i64 %tmp69, i64* %g, align 8
+; CHECK-NEXT: store i64 %tmp69, ptr %g, align 8
+  store i64 %tmp69, ptr %g, align 8
   br label %bb77
 
 bb77:                                             ; preds = %bb68, %bb26
 ; CHECK: 2 = MemoryPhi({bb26,3},{bb68,1})
 ; CHECK: MemoryUse(liveOnEntry)
-; CHECK-NEXT: %tmp78 = load i64*, i64** %tmp25, align 8
-  %tmp78 = load i64*, i64** %tmp25, align 8
+; CHECK-NEXT: %tmp78 = load ptr, ptr %tmp24, align 8
+  %tmp78 = load ptr, ptr %tmp24, align 8
   br label %bb26
 }
 
 ; CHECK-LABEL: define void @quux_dominated
-define void @quux_dominated(%struct.hoge* noalias %f, i64* noalias %g) align 2 {
-  %tmp = getelementptr inbounds %struct.hoge, %struct.hoge* %f, i64 0, i32 1, i32 0
-  %tmp24 = getelementptr inbounds %struct.hoge, %struct.hoge* %f, i64 0, i32 1
-  %tmp25 = bitcast %struct.widget* %tmp24 to i64**
+define void @quux_dominated(ptr noalias %f, ptr noalias %g) align 2 {
+  %tmp = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1, i32 0
+  %tmp24 = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1
   br label %bb26
 
 bb26:                                             ; preds = %bb77, %0
 ; CHECK: 3 = MemoryPhi({%0,liveOnEntry},{bb77,2})
 ; CHECK: MemoryUse(3)
-; CHECK-NEXT: load i64*, i64** %tmp25, align 8
-  load i64*, i64** %tmp25, align 8
+; CHECK-NEXT: load ptr, ptr %tmp24, align 8
+  load ptr, ptr %tmp24, align 8
   br i1 undef, label %bb68, label %bb77
 
 bb68:                                             ; preds = %bb26
 ; CHECK: MemoryUse(3)
-; CHECK-NEXT: %tmp69 = load i64, i64* %g, align 8
-  %tmp69 = load i64, i64* %g, align 8
+; CHECK-NEXT: %tmp69 = load i64, ptr %g, align 8
+  %tmp69 = load i64, ptr %g, align 8
 ; CHECK: 1 = MemoryDef(3)
-; CHECK-NEXT: store i64 %tmp69, i64* %g, align 8
-  store i64 %tmp69, i64* %g, align 8
+; CHECK-NEXT: store i64 %tmp69, ptr %g, align 8
+  store i64 %tmp69, ptr %g, align 8
   br label %bb77
 
 bb77:                                             ; preds = %bb68, %bb26
 ; CHECK: 4 = MemoryPhi({bb26,3},{bb68,1})
 ; CHECK: 2 = MemoryDef(4)
-; CHECK-NEXT: store i64* null, i64** %tmp25, align 8
-  store i64* null, i64** %tmp25, align 8
+; CHECK-NEXT: store ptr null, ptr %tmp24, align 8
+  store ptr null, ptr %tmp24, align 8
   br label %bb26
 }
 
 ; CHECK-LABEL: define void @quux_nodominate
-define void @quux_nodominate(%struct.hoge* noalias %f, i64* noalias %g) align 2 {
-  %tmp = getelementptr inbounds %struct.hoge, %struct.hoge* %f, i64 0, i32 1, i32 0
-  %tmp24 = getelementptr inbounds %struct.hoge, %struct.hoge* %f, i64 0, i32 1
-  %tmp25 = bitcast %struct.widget* %tmp24 to i64**
+define void @quux_nodominate(ptr noalias %f, ptr noalias %g) align 2 {
+  %tmp = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1, i32 0
+  %tmp24 = getelementptr inbounds %struct.hoge, ptr %f, i64 0, i32 1
   br label %bb26
 
 bb26:                                             ; preds = %bb77, %0
 ; CHECK: 3 = MemoryPhi({%0,liveOnEntry},{bb77,2})
 ; CHECK: MemoryUse(liveOnEntry)
-; CHECK-NEXT: load i64*, i64** %tmp25, align 8
-  load i64*, i64** %tmp25, align 8
+; CHECK-NEXT: load ptr, ptr %tmp24, align 8
+  load ptr, ptr %tmp24, align 8
   br i1 undef, label %bb68, label %bb77
 
 bb68:                                             ; preds = %bb26
 ; CHECK: MemoryUse(3)
-; CHECK-NEXT: %tmp69 = load i64, i64* %g, align 8
-  %tmp69 = load i64, i64* %g, align 8
+; CHECK-NEXT: %tmp69 = load i64, ptr %g, align 8
+  %tmp69 = load i64, ptr %g, align 8
 ; CHECK: 1 = MemoryDef(3)
-; CHECK-NEXT: store i64 %tmp69, i64* %g, align 8
-  store i64 %tmp69, i64* %g, align 8
+; CHECK-NEXT: store i64 %tmp69, ptr %g, align 8
+  store i64 %tmp69, ptr %g, align 8
   br label %bb77
 
 bb77:                                             ; preds = %bb68, %bb26

diff  --git a/llvm/test/Analysis/MemorySSA/debugvalue.ll b/llvm/test/Analysis/MemorySSA/debugvalue.ll
index a0b9b63ef64a3..7d8e87a2d8404 100644
--- a/llvm/test/Analysis/MemorySSA/debugvalue.ll
+++ b/llvm/test/Analysis/MemorySSA/debugvalue.ll
@@ -15,7 +15,7 @@ for.cond.cleanup:                                 ; preds = %for.cond
   ret void
 
 for.body:                                         ; preds = %for.cond
-  store i32 undef, i32* undef, align 1
+  store i32 undef, ptr undef, align 1
   %inc = add i16 %i.0, 1
   call void @llvm.dbg.value(metadata i16 %inc, metadata !32, metadata !DIExpression()), !dbg !31
   br label %for.cond

diff  --git a/llvm/test/Analysis/MemorySSA/debugvalue2.ll b/llvm/test/Analysis/MemorySSA/debugvalue2.ll
index 05cad73071cfb..4565e3f7bc560 100644
--- a/llvm/test/Analysis/MemorySSA/debugvalue2.ll
+++ b/llvm/test/Analysis/MemorySSA/debugvalue2.ll
@@ -19,7 +19,7 @@ for.cond:                                         ; preds = %for.body, %entry
   br i1 undef, label %for.end, label %for.body
 
 for.body:                                         ; preds = %for.cond
-  %0 = load i16, i16* undef, align 1
+  %0 = load i16, ptr undef, align 1
   br label %for.cond
 
 for.end:                                          ; preds = %for.cond

diff  --git a/llvm/test/Analysis/MemorySSA/forward-unreachable.ll b/llvm/test/Analysis/MemorySSA/forward-unreachable.ll
index 2bbf399daae45..aead6277a1fba 100644
--- a/llvm/test/Analysis/MemorySSA/forward-unreachable.ll
+++ b/llvm/test/Analysis/MemorySSA/forward-unreachable.ll
@@ -6,7 +6,7 @@ entry:
   br i1 undef, label %split1, label %split2
 
 split1:
-  store i16 undef, i16* undef, align 2
+  store i16 undef, ptr undef, align 2
  br label %merge
 split2:
  br label %merge
@@ -17,7 +17,7 @@ merge:
 ; because it is reverse reachable, so the CFG still has it as a
 ; predecessor of the block
 ; CHECK:  3 = MemoryPhi({split1,1},{split2,liveOnEntry},{forwardunreachable,liveOnEntry})
-  store i16 undef, i16* undef, align 2
+  store i16 undef, ptr undef, align 2
   ret void
 }
 

diff  --git a/llvm/test/Analysis/MemorySSA/function-clobber.ll b/llvm/test/Analysis/MemorySSA/function-clobber.ll
index dd1df96b04b0f..53662b1930c34 100644
--- a/llvm/test/Analysis/MemorySSA/function-clobber.ll
+++ b/llvm/test/Analysis/MemorySSA/function-clobber.ll
@@ -8,11 +8,11 @@ declare void @modifyG()
 define i32 @foo() {
 ; CHECK: MemoryUse(liveOnEntry)
 ; CHECK-NEXT: %1 = load i32
-  %1 = load i32, i32* @g
+  %1 = load i32, ptr @g
 
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 4
-  store i32 4, i32* @g, align 4
+  store i32 4, ptr @g, align 4
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: call void @modifyG()
@@ -20,7 +20,7 @@ define i32 @foo() {
 
 ; CHECK: MemoryUse(2)
 ; CHECK-NEXT: %2 = load i32
-  %2 = load i32, i32* @g
+  %2 = load i32, ptr @g
   %3 = add i32 %2, %1
   ret i32 %3
 }

diff  --git a/llvm/test/Analysis/MemorySSA/function-mem-attrs.ll b/llvm/test/Analysis/MemorySSA/function-mem-attrs.ll
index 3758e91aa6797..f3f9faf53a306 100644
--- a/llvm/test/Analysis/MemorySSA/function-mem-attrs.ll
+++ b/llvm/test/Analysis/MemorySSA/function-mem-attrs.ll
@@ -10,12 +10,12 @@ declare void @noattrsFunction()
 define void @readonlyAttr() {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* @g, align 4
+  store i32 0, ptr @g, align 4
 
   %1 = alloca i32, align 4
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* %1, align 4
+  store i32 0, ptr %1, align 4
 
 ; CHECK: MemoryUse(1)
 ; CHECK-NEXT: call void @readonlyFunction()
@@ -33,26 +33,26 @@ define void @readonlyAttr() {
   ret void
 }
 
-declare void @argMemOnly(i32*) argmemonly
+declare void @argMemOnly(ptr) argmemonly
 
 define void @inaccessableOnlyAttr() {
   %1 = alloca i32, align 4
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* %1, align 4
+  store i32 0, ptr %1, align 4
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* @g, align 4
+  store i32 0, ptr @g, align 4
 
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: call void @argMemOnly(i32* %1) #
+; CHECK-NEXT: call void @argMemOnly(ptr %1) #
 ; Assume that #N is readonly
-  call void @argMemOnly(i32* %1) readonly
+  call void @argMemOnly(ptr %1) readonly
 
 ; CHECK: 3 = MemoryDef(2)
-; CHECK-NEXT: call void @argMemOnly(i32* %1)
-  call void @argMemOnly(i32* %1)
+; CHECK-NEXT: call void @argMemOnly(ptr %1)
+  call void @argMemOnly(ptr %1)
 
   ret void
 }

diff  --git a/llvm/test/Analysis/MemorySSA/invalidate.ll b/llvm/test/Analysis/MemorySSA/invalidate.ll
index 99faf8bed5113..80d3504a69970 100644
--- a/llvm/test/Analysis/MemorySSA/invalidate.ll
+++ b/llvm/test/Analysis/MemorySSA/invalidate.ll
@@ -35,19 +35,17 @@
 ; Function Attrs: ssp uwtable
 define i32 @main() {
 entry:
-  %call = call noalias i8* @_Znwm(i64 4)
-  %0 = bitcast i8* %call to i32*
-  %call1 = call noalias i8* @_Znwm(i64 4)
-  %1 = bitcast i8* %call1 to i32*
-  store i32 5, i32* %0, align 4
-  store i32 7, i32* %1, align 4
-  %2 = load i32, i32* %0, align 4
-  %3 = load i32, i32* %1, align 4
-  %4 = load i32, i32* %0, align 4
-  %5 = load i32, i32* %1, align 4
-  %add = add nsw i32 %3, %5
+  %call = call noalias ptr @_Znwm(i64 4)
+  %call1 = call noalias ptr @_Znwm(i64 4)
+  store i32 5, ptr %call, align 4
+  store i32 7, ptr %call1, align 4
+  %0 = load i32, ptr %call, align 4
+  %1 = load i32, ptr %call1, align 4
+  %2 = load i32, ptr %call, align 4
+  %3 = load i32, ptr %call1, align 4
+  %add = add nsw i32 %1, %3
   ret i32 %add
 }
 
-declare noalias i8* @_Znwm(i64)
+declare noalias ptr @_Znwm(i64)
 

diff  --git a/llvm/test/Analysis/MemorySSA/invariant-groups.ll b/llvm/test/Analysis/MemorySSA/invariant-groups.ll
index 9a4bbb5c859b5..8d1ec5226be5e 100644
--- a/llvm/test/Analysis/MemorySSA/invariant-groups.ll
+++ b/llvm/test/Analysis/MemorySSA/invariant-groups.ll
@@ -6,17 +6,17 @@
 define i32 @global() {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* @g, align 4, !invariant.group !0
+  store i32 0, ptr @g, align 4, !invariant.group !0
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: call void @clobber
-  call void @clobber(i32* @g)
+  call void @clobber(ptr @g)
 
 ; FIXME: this could be clobbered by 1 if we walked the instruction list for loads/stores to @g.
 ; But we can't look at the uses of @g in a function analysis.
 ; CHECK: MemoryUse(2) {{.*}} clobbered by 2
 ; CHECK-NEXT: %1 = load i32
-  %1 = load i32, i32* @g, align 4, !invariant.group !0
+  %1 = load i32, ptr @g, align 4, !invariant.group !0
   ret i32 %1
 }
 
@@ -24,153 +24,145 @@ define i32 @global() {
 define i32 @global2() {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* inttoptr (i64 ptrtoint (i32* @g to i64) to i32*), align 4, !invariant.group !0
+  store i32 0, ptr inttoptr (i64 ptrtoint (ptr @g to i64) to ptr), align 4, !invariant.group !0
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: call void @clobber
-  call void @clobber(i32* inttoptr (i64 ptrtoint (i32* @g to i64) to i32*))
+  call void @clobber(ptr inttoptr (i64 ptrtoint (ptr @g to i64) to ptr))
 
 ; FIXME: this could be clobbered by 1 if we walked the instruction list for loads/stores to @g.
 ; But we can't look at the uses of @g in a function analysis.
 ; CHECK: MemoryUse(2) {{.*}} clobbered by 2
 ; CHECK-NEXT: %1 = load i32
-  %1 = load i32, i32* inttoptr (i64 ptrtoint (i32* @g to i64) to i32*), align 4, !invariant.group !0
+  %1 = load i32, ptr inttoptr (i64 ptrtoint (ptr @g to i64) to ptr), align 4, !invariant.group !0
   ret i32 %1
 }
 
 ; CHECK-LABEL: define {{.*}} @foo(
-define i32 @foo(i32* %a) {
+define i32 @foo(ptr %a) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* %a, align 4, !invariant.group !0
+  store i32 0, ptr %a, align 4, !invariant.group !0
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: store i32 1
-  store i32 1, i32* @g, align 4
+  store i32 1, ptr @g, align 4
 
-  %1 = bitcast i32* %a to i8*
 ; CHECK:  3 = MemoryDef(2)
-; CHECK-NEXT: %a8 = call i8* @llvm.launder.invariant.group.p0i8(i8* %1)
-  %a8 = call i8* @llvm.launder.invariant.group.p0i8(i8* %1)
-  %a32 = bitcast i8* %a8 to i32*
+; CHECK-NEXT: %a8 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
+  %a8 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
 
 ; This have to be MemoryUse(2), because we can't skip the barrier based on
 ; invariant.group.
 ; CHECK: MemoryUse(2)
-; CHECK-NEXT: %2 = load i32
-  %2 = load i32, i32* %a32, align 4, !invariant.group !0
-  ret i32 %2
+; CHECK-NEXT: %1 = load i32
+  %1 = load i32, ptr %a8, align 4, !invariant.group !0
+  ret i32 %1
 }
 
 ; CHECK-LABEL: define {{.*}} @volatile1(
-define void @volatile1(i32* %a) {
+define void @volatile1(ptr %a) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* %a, align 4, !invariant.group !0
+  store i32 0, ptr %a, align 4, !invariant.group !0
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: call void @clobber
-  call void @clobber(i32* %a)
+  call void @clobber(ptr %a)
 
 ; CHECK: 3 = MemoryDef(2){{.*}} clobbered by 2
 ; CHECK-NEXT: load volatile
-  %b = load volatile i32, i32* %a, align 4, !invariant.group !0
+  %b = load volatile i32, ptr %a, align 4, !invariant.group !0
 
   ret void
 }
 
 ; CHECK-LABEL: define {{.*}} @volatile2(
-define void @volatile2(i32* %a) {
+define void @volatile2(ptr %a) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store volatile i32 0
-  store volatile i32 0, i32* %a, align 4, !invariant.group !0
+  store volatile i32 0, ptr %a, align 4, !invariant.group !0
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: call void @clobber
-  call void @clobber(i32* %a)
+  call void @clobber(ptr %a)
 
 ; CHECK: MemoryUse(2){{.*}} clobbered by 2
 ; CHECK-NEXT: load i32
-  %b = load i32, i32* %a, align 4, !invariant.group !0
+  %b = load i32, ptr %a, align 4, !invariant.group !0
 
   ret void
 }
 
 ; CHECK-LABEL: define {{.*}} @skipBarrier(
-define i32 @skipBarrier(i32* %a) {
+define i32 @skipBarrier(ptr %a) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* %a, align 4, !invariant.group !0
+  store i32 0, ptr %a, align 4, !invariant.group !0
 
-  %1 = bitcast i32* %a to i8*
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: %a8 = call i8* @llvm.launder.invariant.group.p0i8(i8* %1)
-  %a8 = call i8* @llvm.launder.invariant.group.p0i8(i8* %1)  
-  %a32 = bitcast i8* %a8 to i32*
+; CHECK-NEXT: %a8 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
+  %a8 = call ptr @llvm.launder.invariant.group.p0(ptr %a)  
 
 ; We can skip the barrier only if the "skip" is not based on !invariant.group.
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: %2 = load i32
-  %2 = load i32, i32* %a32, align 4, !invariant.group !0
-  ret i32 %2
+; CHECK-NEXT: %1 = load i32
+  %1 = load i32, ptr %a8, align 4, !invariant.group !0
+  ret i32 %1
 }
 
 ; CHECK-LABEL: define {{.*}} @skipBarrier2(
-define i32 @skipBarrier2(i32* %a) {
+define i32 @skipBarrier2(ptr %a) {
 
 ; CHECK: MemoryUse(liveOnEntry)
 ; CHECK-NEXT: %v = load i32
-  %v = load i32, i32* %a, align 4, !invariant.group !0
+  %v = load i32, ptr %a, align 4, !invariant.group !0
 
-  %1 = bitcast i32* %a to i8*
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: %a8 = call i8* @llvm.launder.invariant.group.p0i8(i8* %1)
-  %a8 = call i8* @llvm.launder.invariant.group.p0i8(i8* %1)
-  %a32 = bitcast i8* %a8 to i32*
+; CHECK-NEXT: %a8 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
+  %a8 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
 
 ; We can skip the barrier only if the "skip" is not based on !invariant.group.
 ; CHECK: MemoryUse(liveOnEntry)
 ; CHECK-NEXT: %v2 = load i32
-  %v2 = load i32, i32* %a32, align 4, !invariant.group !0
+  %v2 = load i32, ptr %a8, align 4, !invariant.group !0
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: store i32 1
-  store i32 1, i32* @g, align 4
+  store i32 1, ptr @g, align 4
 
 ; CHECK: MemoryUse(2) {{.*}} clobbered by liveOnEntry
 ; CHECK-NEXT: %v3 = load i32
-  %v3 = load i32, i32* %a32, align 4, !invariant.group !0
+  %v3 = load i32, ptr %a8, align 4, !invariant.group !0
   %add = add nsw i32 %v2, %v3
   %add2 = add nsw i32 %add, %v
   ret i32 %add2
 }
 
 ; CHECK-LABEL: define {{.*}} @handleInvariantGroups(
-define i32 @handleInvariantGroups(i32* %a) {
+define i32 @handleInvariantGroups(ptr %a) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* %a, align 4, !invariant.group !0
+  store i32 0, ptr %a, align 4, !invariant.group !0
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: store i32 1
-  store i32 1, i32* @g, align 4
-  %1 = bitcast i32* %a to i8*
+  store i32 1, ptr @g, align 4
 ; CHECK: 3 = MemoryDef(2)
-; CHECK-NEXT: %a8 = call i8* @llvm.launder.invariant.group.p0i8(i8* %1)
-  %a8 = call i8* @llvm.launder.invariant.group.p0i8(i8* %1)
-  %a32 = bitcast i8* %a8 to i32*
+; CHECK-NEXT: %a8 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
+  %a8 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
 
 ; CHECK: MemoryUse(2)
-; CHECK-NEXT: %2 = load i32
-  %2 = load i32, i32* %a32, align 4, !invariant.group !0
+; CHECK-NEXT: %1 = load i32
+  %1 = load i32, ptr %a8, align 4, !invariant.group !0
 
 ; CHECK: 4 = MemoryDef(3)
 ; CHECK-NEXT: store i32 2
-  store i32 2, i32* @g, align 4
+  store i32 2, ptr @g, align 4
 
 ; CHECK: MemoryUse(4) {{.*}} clobbered by 2
-; CHECK-NEXT: %3 = load i32
-  %3 = load i32, i32* %a32, align 4, !invariant.group !0
-  %add = add nsw i32 %2, %3
+; CHECK-NEXT: %2 = load i32
+  %2 = load i32, ptr %a8, align 4, !invariant.group !0
+  %add = add nsw i32 %1, %2
   ret i32 %add
 }
 
@@ -180,22 +172,22 @@ entry:
   %0 = alloca i32, align 4
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 4
-  store i32 4, i32* %0, !invariant.group !0
+  store i32 4, ptr %0, !invariant.group !0
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: call void @clobber
-  call void @clobber(i32* %0)
+  call void @clobber(ptr %0)
   br i1 %a, label %Loop.Body, label %Loop.End
 
 Loop.Body:
 ; CHECK: MemoryUse(2) {{.*}} clobbered by 1
 ; CHECK-NEXT: %1 = load i32
-  %1 = load i32, i32* %0, !invariant.group !0
+  %1 = load i32, ptr %0, !invariant.group !0
   br i1 %a, label %Loop.End, label %Loop.Body
 
 Loop.End:
 ; CHECK: MemoryUse(2) {{.*}} clobbered by 1
 ; CHECK-NEXT: %2 = load
-  %2 = load i32, i32* %0, align 4, !invariant.group !0
+  %2 = load i32, ptr %0, align 4, !invariant.group !0
   br i1 %a, label %Ret, label %Loop.Body
 
 Ret:
@@ -203,42 +195,42 @@ Ret:
 }
 
 ; CHECK-LABEL: define {{.*}} @loop2(
-define i8 @loop2(i8* %p) {
+define i8 @loop2(ptr %p) {
 entry:
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i8
-  store i8 4, i8* %p, !invariant.group !0
+  store i8 4, ptr %p, !invariant.group !0
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: call void @clobber
-  call void @clobber8(i8* %p)
+  call void @clobber8(ptr %p)
 
 ; CHECK: 3 = MemoryDef(2)
-; CHECK-NEXT: %after = call i8* @llvm.launder.invariant.group.p0i8(i8* %p)
-  %after = call i8* @llvm.launder.invariant.group.p0i8(i8* %p)
+; CHECK-NEXT: %after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
+  %after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
   br i1 undef, label %Loop.Body, label %Loop.End
 
 Loop.Body:
 ; CHECK: MemoryUse(6)
 ; CHECK-NEXT: %0 = load i8
-  %0 = load i8, i8* %after, !invariant.group !0
+  %0 = load i8, ptr %after, !invariant.group !0
 
 ; CHECK: MemoryUse(6) {{.*}} clobbered by 1
 ; CHECK-NEXT: %1 = load i8
-  %1 = load i8, i8* %p, !invariant.group !0
+  %1 = load i8, ptr %p, !invariant.group !0
 
 ; CHECK: 4 = MemoryDef(6)
-  store i8 4, i8* %after, !invariant.group !0
+  store i8 4, ptr %after, !invariant.group !0
 
   br i1 undef, label %Loop.End, label %Loop.Body
 
 Loop.End:
 ; CHECK: MemoryUse(5)
 ; CHECK-NEXT: %2 = load
-  %2 = load i8, i8* %after, align 4, !invariant.group !0
+  %2 = load i8, ptr %after, align 4, !invariant.group !0
 
 ; CHECK: MemoryUse(5) {{.*}} clobbered by 1
 ; CHECK-NEXT: %3 = load
-  %3 = load i8, i8* %p, align 4, !invariant.group !0
+  %3 = load i8, ptr %p, align 4, !invariant.group !0
   br i1 undef, label %Ret, label %Loop.Body
 
 Ret:
@@ -247,57 +239,57 @@ Ret:
 
 
 ; CHECK-LABEL: define {{.*}} @loop3(
-define i8 @loop3(i8* %p) {
+define i8 @loop3(ptr %p) {
 entry:
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i8
-  store i8 4, i8* %p, !invariant.group !0
+  store i8 4, ptr %p, !invariant.group !0
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: call void @clobber
-  call void @clobber8(i8* %p)
+  call void @clobber8(ptr %p)
 
 ; CHECK: 3 = MemoryDef(2)
-; CHECK-NEXT: %after = call i8* @llvm.launder.invariant.group.p0i8(i8* %p)
-  %after = call i8* @llvm.launder.invariant.group.p0i8(i8* %p)
+; CHECK-NEXT: %after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
+  %after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
   br i1 undef, label %Loop.Body, label %Loop.End
 
 Loop.Body:
 ; CHECK: MemoryUse(8)
 ; CHECK-NEXT: %0 = load i8
-  %0 = load i8, i8* %after, !invariant.group !0
+  %0 = load i8, ptr %after, !invariant.group !0
 
 ; CHECK: 4 = MemoryDef(8)
 ; CHECK-NEXT: call void @clobber8
-  call void @clobber8(i8* %after)
+  call void @clobber8(ptr %after)
 
 ; CHECK: MemoryUse(4) {{.*}} clobbered by 8
 ; CHECK-NEXT: %1 = load i8
-  %1 = load i8, i8* %after, !invariant.group !0
+  %1 = load i8, ptr %after, !invariant.group !0
 
   br i1 undef, label %Loop.next, label %Loop.Body
 Loop.next:
 ; CHECK: 5 = MemoryDef(4)
 ; CHECK-NEXT: call void @clobber8
-  call void @clobber8(i8* %after)
+  call void @clobber8(ptr %after)
 
 ; CHECK: MemoryUse(5) {{.*}} clobbered by 8
 ; CHECK-NEXT: %2 = load i8
-  %2 = load i8, i8* %after, !invariant.group !0
+  %2 = load i8, ptr %after, !invariant.group !0
 
   br i1 undef, label %Loop.End, label %Loop.Body
 
 Loop.End:
 ; CHECK: MemoryUse(7)
 ; CHECK-NEXT: %3 = load
-  %3 = load i8, i8* %after, align 4, !invariant.group !0
+  %3 = load i8, ptr %after, align 4, !invariant.group !0
 
 ; CHECK: 6 = MemoryDef(7)
 ; CHECK-NEXT: call void @clobber8
-  call void @clobber8(i8* %after)
+  call void @clobber8(ptr %after)
 
 ; CHECK: MemoryUse(6) {{.*}} clobbered by 7
 ; CHECK-NEXT: %4 = load
-  %4 = load i8, i8* %after, align 4, !invariant.group !0
+  %4 = load i8, ptr %after, align 4, !invariant.group !0
   br i1 undef, label %Ret, label %Loop.Body
 
 Ret:
@@ -305,45 +297,45 @@ Ret:
 }
 
 ; CHECK-LABEL: define {{.*}} @loop4(
-define i8 @loop4(i8* %p) {
+define i8 @loop4(ptr %p) {
 entry:
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i8
-  store i8 4, i8* %p, !invariant.group !0
+  store i8 4, ptr %p, !invariant.group !0
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: call void @clobber
-  call void @clobber8(i8* %p)
+  call void @clobber8(ptr %p)
 ; CHECK: 3 = MemoryDef(2)
-; CHECK-NEXT: %after = call i8* @llvm.launder.invariant.group.p0i8(i8* %p)
-  %after = call i8* @llvm.launder.invariant.group.p0i8(i8* %p)
+; CHECK-NEXT: %after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
+  %after = call ptr @llvm.launder.invariant.group.p0(ptr %p)
   br i1 undef, label %Loop.Pre, label %Loop.End
 
 Loop.Pre:
 ; CHECK: MemoryUse(2)
 ; CHECK-NEXT: %0 = load i8
-  %0 = load i8, i8* %after, !invariant.group !0
+  %0 = load i8, ptr %after, !invariant.group !0
   br label %Loop.Body
 Loop.Body:
 ; CHECK: MemoryUse(6)
 ; CHECK-NEXT: %1 = load i8
-  %1 = load i8, i8* %after, !invariant.group !0
+  %1 = load i8, ptr %after, !invariant.group !0
 
 ; CHECK: MemoryUse(6) {{.*}} clobbered by 1
 ; CHECK-NEXT: %2 = load i8
-  %2 = load i8, i8* %p, !invariant.group !0
+  %2 = load i8, ptr %p, !invariant.group !0
 
 ; CHECK: 4 = MemoryDef(6)
-  store i8 4, i8* %after, !invariant.group !0
+  store i8 4, ptr %after, !invariant.group !0
   br i1 undef, label %Loop.End, label %Loop.Body
 
 Loop.End:
 ; CHECK: MemoryUse(5)
 ; CHECK-NEXT: %3 = load
-  %3 = load i8, i8* %after, align 4, !invariant.group !0
+  %3 = load i8, ptr %after, align 4, !invariant.group !0
 
 ; CHECK: MemoryUse(5) {{.*}} clobbered by 1
 ; CHECK-NEXT: %4 = load
-  %4 = load i8, i8* %p, align 4, !invariant.group !0
+  %4 = load i8, ptr %p, align 4, !invariant.group !0
   br i1 undef, label %Ret, label %Loop.Body
 
 Ret:
@@ -356,27 +348,27 @@ define i8 @optimizable() {
 entry:
   %ptr = alloca i8
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: store i8 42, i8* %ptr, align 1, !invariant.group !0
-  store i8 42, i8* %ptr, !invariant.group !0
+; CHECK-NEXT: store i8 42, ptr %ptr, align 1, !invariant.group !0
+  store i8 42, ptr %ptr, !invariant.group !0
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: call i8* @llvm.launder.invariant.group
-  %ptr2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
+; CHECK-NEXT: call ptr @llvm.launder.invariant.group
+  %ptr2 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
 ; FIXME: This one could be CSEd.
 ; CHECK: 3 = MemoryDef(2)
-; CHECK: call i8* @llvm.launder.invariant.group
-  %ptr3 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
+; CHECK: call ptr @llvm.launder.invariant.group
+  %ptr3 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
 ; CHECK: 4 = MemoryDef(3)
-; CHECK-NEXT: call void @clobber8(i8* %ptr)
-  call void @clobber8(i8* %ptr)
+; CHECK-NEXT: call void @clobber8(ptr %ptr)
+  call void @clobber8(ptr %ptr)
 ; CHECK: 5 = MemoryDef(4)
-; CHECK-NEXT: call void @use(i8* %ptr2)
-  call void @use(i8* %ptr2)
+; CHECK-NEXT: call void @use(ptr %ptr2)
+  call void @use(ptr %ptr2)
 ; CHECK: 6 = MemoryDef(5)
-; CHECK-NEXT: call void @use(i8* %ptr3)
-  call void @use(i8* %ptr3)
+; CHECK-NEXT: call void @use(ptr %ptr3)
+  call void @use(ptr %ptr3)
 ; CHECK: MemoryUse(6)
-; CHECK-NEXT: load i8, i8* %ptr3, {{.*}}!invariant.group
-  %v = load i8, i8* %ptr3, !invariant.group !0
+; CHECK-NEXT: load i8, ptr %ptr3, {{.*}}!invariant.group
+  %v = load i8, ptr %ptr3, !invariant.group !0
 
   ret i8 %v
 }
@@ -385,35 +377,35 @@ entry:
 define i8 @unoptimizable2() {
   %ptr = alloca i8
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: store i8 42, i8* %ptr, align 1, !invariant.group !0
-  store i8 42, i8* %ptr, !invariant.group !0
+; CHECK-NEXT: store i8 42, ptr %ptr, align 1, !invariant.group !0
+  store i8 42, ptr %ptr, !invariant.group !0
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: call i8* @llvm.launder.invariant.group
-  %ptr2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
+; CHECK-NEXT: call ptr @llvm.launder.invariant.group
+  %ptr2 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
 ; CHECK: 3 = MemoryDef(2)
-  store i8 43, i8* %ptr
+  store i8 43, ptr %ptr
 ; CHECK: 4 = MemoryDef(3)
-; CHECK-NEXT: call i8* @llvm.launder.invariant.group
-  %ptr3 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
+; CHECK-NEXT: call ptr @llvm.launder.invariant.group
+  %ptr3 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
 ; CHECK: 5 = MemoryDef(4)
-; CHECK-NEXT: call void @clobber8(i8* %ptr)
-  call void @clobber8(i8* %ptr)
+; CHECK-NEXT: call void @clobber8(ptr %ptr)
+  call void @clobber8(ptr %ptr)
 ; CHECK: 6 = MemoryDef(5)
-; CHECK-NEXT: call void @use(i8* %ptr2)
-  call void @use(i8* %ptr2)
+; CHECK-NEXT: call void @use(ptr %ptr2)
+  call void @use(ptr %ptr2)
 ; CHECK: 7 = MemoryDef(6)
-; CHECK-NEXT: call void @use(i8* %ptr3)
-  call void @use(i8* %ptr3)
+; CHECK-NEXT: call void @use(ptr %ptr3)
+  call void @use(ptr %ptr3)
 ; CHECK: MemoryUse(7)
-; CHECK-NEXT: %v = load i8, i8* %ptr3, align 1, !invariant.group !0
-  %v = load i8, i8* %ptr3, !invariant.group !0
+; CHECK-NEXT: %v = load i8, ptr %ptr3, align 1, !invariant.group !0
+  %v = load i8, ptr %ptr3, !invariant.group !0
   ret i8 %v
 }
 
 
-declare i8* @llvm.launder.invariant.group.p0i8(i8*)
-declare void @clobber(i32*)
-declare void @clobber8(i8*)
-declare void @use(i8* readonly)
+declare ptr @llvm.launder.invariant.group.p0(ptr)
+declare void @clobber(ptr)
+declare void @clobber8(ptr)
+declare void @use(ptr readonly)
 
 !0 = !{!"group1"}

diff  --git a/llvm/test/Analysis/MemorySSA/lifetime-simple.ll b/llvm/test/Analysis/MemorySSA/lifetime-simple.ll
index 9d3de796d3cfc..d409c140dc7b2 100644
--- a/llvm/test/Analysis/MemorySSA/lifetime-simple.ll
+++ b/llvm/test/Analysis/MemorySSA/lifetime-simple.ll
@@ -2,27 +2,27 @@
 ; This test checks that lifetime markers are considered clobbers of %P,
 ; and due to lack of noalias information, of %Q as well.
 
-define i8 @test(i8* %P, i8* %Q) {
+define i8 @test(ptr %P, ptr %Q) {
 entry:
 ; CHECK:  1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:   call void @llvm.lifetime.start.p0i8(i64 32, i8* %P)
-  call void @llvm.lifetime.start.p0i8(i64 32, i8* %P)
+; CHECK-NEXT:   call void @llvm.lifetime.start.p0(i64 32, ptr %P)
+  call void @llvm.lifetime.start.p0(i64 32, ptr %P)
 ; CHECK:  MemoryUse(1)
-; CHECK-NEXT:   %0 = load i8, i8* %P
-  %0 = load i8, i8* %P
+; CHECK-NEXT:   %0 = load i8, ptr %P
+  %0 = load i8, ptr %P
 ; CHECK:  2 = MemoryDef(1)
-; CHECK-NEXT:   store i8 1, i8* %P
-  store i8 1, i8* %P
+; CHECK-NEXT:   store i8 1, ptr %P
+  store i8 1, ptr %P
 ; CHECK:  3 = MemoryDef(2)
-; CHECK-NEXT:   call void @llvm.lifetime.end.p0i8(i64 32, i8* %P)
-  call void @llvm.lifetime.end.p0i8(i64 32, i8* %P)
+; CHECK-NEXT:   call void @llvm.lifetime.end.p0(i64 32, ptr %P)
+  call void @llvm.lifetime.end.p0(i64 32, ptr %P)
 ; CHECK:  MemoryUse(3)
-; CHECK-NEXT:   %1 = load i8, i8* %P
-  %1 = load i8, i8* %P
+; CHECK-NEXT:   %1 = load i8, ptr %P
+  %1 = load i8, ptr %P
 ; CHECK:  MemoryUse(3)
-; CHECK-NEXT:   %2 = load i8, i8* %Q
-  %2 = load i8, i8* %Q
+; CHECK-NEXT:   %2 = load i8, ptr %Q
+  %2 = load i8, ptr %Q
   ret i8 %1
 }
-declare void @llvm.lifetime.start.p0i8(i64 %S, i8* nocapture %P) readonly
-declare void @llvm.lifetime.end.p0i8(i64 %S, i8* nocapture %P)
+declare void @llvm.lifetime.start.p0(i64 %S, ptr nocapture %P) readonly
+declare void @llvm.lifetime.end.p0(i64 %S, ptr nocapture %P)

diff  --git a/llvm/test/Analysis/MemorySSA/load-invariant.ll b/llvm/test/Analysis/MemorySSA/load-invariant.ll
index 3ae0b76e0fe96..a7c37afdf9722 100644
--- a/llvm/test/Analysis/MemorySSA/load-invariant.ll
+++ b/llvm/test/Analysis/MemorySSA/load-invariant.ll
@@ -14,23 +14,23 @@ define i32 @foo() {
   call void @clobberAllTheThings()
 ; CHECK: MemoryUse(liveOnEntry)
 ; CHECK-NEXT: %1 = load i32
-  %1 = load i32, i32* @g, align 4, !invariant.load !0
+  %1 = load i32, ptr @g, align 4, !invariant.load !0
   ret i32 %1
 }
 
 ; CHECK-LABEL: define i32 @bar
-define i32 @bar(i32* %a) {
+define i32 @bar(ptr %a) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: call void @clobberAllTheThings()
   call void @clobberAllTheThings()
 
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: %1 = load atomic i32
-  %1 = load atomic i32, i32* %a acquire, align 4, !invariant.load !0
+  %1 = load atomic i32, ptr %a acquire, align 4, !invariant.load !0
 
 ; CHECK: MemoryUse(2)
 ; CHECK-NEXT: %2 = load i32
-  %2 = load i32, i32* %a, align 4
+  %2 = load i32, ptr %a, align 4
   ret i32 %2
 }
 

diff  --git a/llvm/test/Analysis/MemorySSA/loop-rotate-disablebasicaa.ll b/llvm/test/Analysis/MemorySSA/loop-rotate-disablebasicaa.ll
index 2e9316cd3e719..dcf83d2fe280d 100644
--- a/llvm/test/Analysis/MemorySSA/loop-rotate-disablebasicaa.ll
+++ b/llvm/test/Analysis/MemorySSA/loop-rotate-disablebasicaa.ll
@@ -17,7 +17,7 @@ for.cond.cleanup126:                              ; preds = %for.cond120
   unreachable
 
 for.body127:                                      ; preds = %for.cond120
-  %0 = load i16**, i16*** undef, align 1
+  %0 = load ptr, ptr undef, align 1
   br label %for.cond120
 }
 

diff  --git a/llvm/test/Analysis/MemorySSA/loop-rotate-inv-template.ll b/llvm/test/Analysis/MemorySSA/loop-rotate-inv-template.ll
index 0760d946ccc75..f302f86bf4bf8 100644
--- a/llvm/test/Analysis/MemorySSA/loop-rotate-inv-template.ll
+++ b/llvm/test/Analysis/MemorySSA/loop-rotate-inv-template.ll
@@ -7,12 +7,12 @@ entry:
   br label %looplabel.exit.i
 
 looplabel.exit.i: ; preds = %if.end.i, %entry
-  %0 = phi i1 (i32*, i32*)* [ @foo, %entry ], [ undef, %if.end.i ]
-  %call3.i.i = call zeroext i1 %0(i32* nonnull dereferenceable(16) undef, i32* nonnull undef)
+  %0 = phi ptr [ @foo, %entry ], [ undef, %if.end.i ]
+  %call3.i.i = call zeroext i1 %0(ptr nonnull dereferenceable(16) undef, ptr nonnull undef)
   br i1 %call3.i.i, label %if.end.i, label %label.exit
 
 if.end.i:                                         ; preds = %looplabel.exit.i
-  %tobool.i = icmp eq i32* undef, null
+  %tobool.i = icmp eq ptr undef, null
   br label %looplabel.exit.i
 
 label.exit: ; preds = %looplabel.exit.i
@@ -20,7 +20,7 @@ label.exit: ; preds = %looplabel.exit.i
 }
 
 ; Function Attrs: readonly
-declare dso_local i1 @foo(i32*, i32*) #1 align 32
+declare dso_local i1 @foo(ptr, ptr) #1 align 32
 
 attributes #0 = { nounwind }
 attributes #1 = { readonly }

diff  --git a/llvm/test/Analysis/MemorySSA/loop-rotate-simplified-clone.ll b/llvm/test/Analysis/MemorySSA/loop-rotate-simplified-clone.ll
index 8769d60b26635..aab65955a2854 100644
--- a/llvm/test/Analysis/MemorySSA/loop-rotate-simplified-clone.ll
+++ b/llvm/test/Analysis/MemorySSA/loop-rotate-simplified-clone.ll
@@ -10,13 +10,13 @@ preheader:
   br label %l39
 
 l39:
-  %v40 = phi float (float)* [ @foo, %preheader ], [ %v43, %crit_edge ]
+  %v40 = phi ptr [ @foo, %preheader ], [ %v43, %crit_edge ]
   %v41 = call float %v40(float undef)
-  %v42 = load i32, i32* undef, align 8
+  %v42 = load i32, ptr undef, align 8
   br i1 undef, label %crit_edge, label %loopexit
 
 crit_edge:
-  %v43 = load float (float)*, float (float)** undef, align 8
+  %v43 = load ptr, ptr undef, align 8
   br label %l39
 
 loopexit:

diff  --git a/llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll b/llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll
index 75fb0c61180b0..c4679e00d4fc9 100644
--- a/llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll
+++ b/llvm/test/Analysis/MemorySSA/loop-rotate-valuemap.ll
@@ -14,11 +14,11 @@ for.cond.cleanup15:                               ; preds = %for.body16
 
 for.body16:                                       ; preds = %for.body16.for.body16_crit_edge, %entry
   %call.i = tail call float @expf(float 0.000000e+00) #1
-  %0 = load float*, float** undef, align 8
+  %0 = load ptr, ptr undef, align 8
   br i1 undef, label %for.cond.cleanup15, label %for.body16.for.body16_crit_edge
 
 for.body16.for.body16_crit_edge:                  ; preds = %for.body16
-  %.pre = load float, float* undef, align 8
+  %.pre = load float, ptr undef, align 8
   br label %for.body16
 }
 

diff  --git a/llvm/test/Analysis/MemorySSA/loop_rotate_remove_trivial_phis.ll b/llvm/test/Analysis/MemorySSA/loop_rotate_remove_trivial_phis.ll
index 9c8d16ed9b048..7903f73364361 100644
--- a/llvm/test/Analysis/MemorySSA/loop_rotate_remove_trivial_phis.ll
+++ b/llvm/test/Analysis/MemorySSA/loop_rotate_remove_trivial_phis.ll
@@ -7,13 +7,13 @@ target triple = "x86_64-grtev4-linux-gnu"
 declare double @sqrt(double)
 
 ; CHECK-LABEL: @f
-define internal fastcc double @f(i32* %n_, double* %dx) align 32 {
+define internal fastcc double @f(ptr %n_, ptr %dx) align 32 {
 entry:
 ; CHECK: entry:
 ; CHECK: MemoryUse(liveOnEntry)
 ; CHECK-NOT: 7 = MemoryPhi
 ; CHECK-NOT: 6 = MemoryPhi
-  %v0 = load i32, i32* %n_, align 4
+  %v0 = load i32, ptr %n_, align 4
   br label %for.cond
 
 for.cond:                                         ; preds = %for.body, %entry
@@ -24,8 +24,8 @@ for.cond:                                         ; preds = %for.body, %entry
 
 for.body:                                         ; preds = %for.cond
   %idxprom = zext i32 %i.0 to i64
-  %arrayidx = getelementptr inbounds double, double* %dx, i64 %idxprom
-  %v1 = load double, double* %arrayidx, align 8
+  %arrayidx = getelementptr inbounds double, ptr %dx, i64 %idxprom
+  %v1 = load double, ptr %arrayidx, align 8
   %cmp1 = fcmp ueq double %v1, 0.000000e+00
   %xmax.1 = select i1 %cmp1, double %xmax.0, double %v1
   %inc = add nuw nsw i32 %i.0, 1
@@ -50,8 +50,8 @@ for.body7:                                        ; preds = %for.body7.lr.ph, %f
   %i.13 = phi i32 [ 0, %for.body7.lr.ph ], [ %inc14, %for.body7 ]
   %sum.02 = phi x86_fp80 [ undef, %for.body7.lr.ph ], [ %add, %for.body7 ]
   %idxprom9 = zext i32 %i.13 to i64
-  %arrayidx10 = getelementptr inbounds double, double* %dx, i64 %idxprom9
-  %v3 = load double, double* %arrayidx10, align 8
+  %arrayidx10 = getelementptr inbounds double, ptr %dx, i64 %idxprom9
+  %v3 = load double, ptr %arrayidx10, align 8
   %mul11 = fmul double %div, %v3
   %v2 = call double @sqrt(double %v3)
   %mul12 = fmul double %mul11, %v2

diff  --git a/llvm/test/Analysis/MemorySSA/many-dom-backedge.ll b/llvm/test/Analysis/MemorySSA/many-dom-backedge.ll
index f16223f2a2c08..d0d14b00e4d16 100644
--- a/llvm/test/Analysis/MemorySSA/many-dom-backedge.ll
+++ b/llvm/test/Analysis/MemorySSA/many-dom-backedge.ll
@@ -5,7 +5,7 @@
 
 declare i1 @getBool() readnone
 
-define i32 @foo(i32* %p) {
+define i32 @foo(ptr %p) {
 entry:
   br label %loopbegin
 
@@ -24,42 +24,42 @@ loopbegin:
 sw.bb:
 ; CHECK: 1 = MemoryDef(9)
 ; CHECK-NEXT: store i32 1
-  store i32 1, i32* %m, align 4
+  store i32 1, ptr %m, align 4
   br label %sw.epilog
 
 sw.bb1:
 ; CHECK: 2 = MemoryDef(9)
 ; CHECK-NEXT: store i32 2
-  store i32 2, i32* %m, align 4
+  store i32 2, ptr %m, align 4
   br label %sw.epilog
 
 sw.bb2:
 ; CHECK: 3 = MemoryDef(9)
 ; CHECK-NEXT: store i32 3
-  store i32 3, i32* %m, align 4
+  store i32 3, ptr %m, align 4
   br label %sw.epilog
 
 sw.bb3:
 ; CHECK: 10 = MemoryPhi({loopbegin,9},{sw.almostexit,6})
 ; CHECK: 4 = MemoryDef(10)
 ; CHECK-NEXT: store i32 4
-  store i32 4, i32* %m, align 4
+  store i32 4, ptr %m, align 4
   br label %sw.epilog
 
 sw.default:
 ; CHECK: 5 = MemoryDef(9)
 ; CHECK-NEXT: store i32 5
-  store i32 5, i32* %m, align 4
+  store i32 5, ptr %m, align 4
   br label %sw.epilog
 
 sw.epilog:
 ; CHECK: 8 = MemoryPhi({sw.default,5},{sw.bb3,4},{sw.bb,1},{sw.bb1,2},{sw.bb2,3})
 ; CHECK-NEXT: MemoryUse(8)
 ; CHECK-NEXT: %0 =
-  %0 = load i32, i32* %m, align 4
+  %0 = load i32, ptr %m, align 4
 ; CHECK: 6 = MemoryDef(8)
 ; CHECK-NEXT: %1 =
-  %1 = load volatile i32, i32* %p, align 4
+  %1 = load volatile i32, ptr %p, align 4
   %2 = icmp eq i32 %0, %1
   br i1 %2, label %sw.almostexit, label %loopbegin
 
@@ -70,7 +70,7 @@ sw.almostexit:
 exit:
 ; CHECK: 7 = MemoryDef(6)
 ; CHECK-NEXT: %4 = load volatile i32
-  %4 = load volatile i32, i32* %p, align 4
+  %4 = load volatile i32, ptr %p, align 4
   %5 = add i32 %4, %1
   ret i32 %5
 }

diff  --git a/llvm/test/Analysis/MemorySSA/many-doms.ll b/llvm/test/Analysis/MemorySSA/many-doms.ll
index 12126af95311b..cdf51f781dac1 100644
--- a/llvm/test/Analysis/MemorySSA/many-doms.ll
+++ b/llvm/test/Analysis/MemorySSA/many-doms.ll
@@ -4,7 +4,7 @@
 
 declare i1 @getBool() readnone
 
-define i32 @foo(i32* %p) {
+define i32 @foo(ptr %p) {
 entry:
   br label %loopbegin
 
@@ -23,41 +23,41 @@ loopbegin:
 sw.bb:
 ; CHECK: 1 = MemoryDef(8)
 ; CHECK-NEXT: store i32 1
-  store i32 1, i32* %m, align 4
+  store i32 1, ptr %m, align 4
   br label %sw.epilog
 
 sw.bb1:
 ; CHECK: 2 = MemoryDef(8)
 ; CHECK-NEXT: store i32 2
-  store i32 2, i32* %m, align 4
+  store i32 2, ptr %m, align 4
   br label %sw.epilog
 
 sw.bb2:
 ; CHECK: 3 = MemoryDef(8)
 ; CHECK-NEXT: store i32 3
-  store i32 3, i32* %m, align 4
+  store i32 3, ptr %m, align 4
   br label %sw.epilog
 
 sw.bb3:
 ; CHECK: 4 = MemoryDef(8)
 ; CHECK-NEXT: store i32 4
-  store i32 4, i32* %m, align 4
+  store i32 4, ptr %m, align 4
   br label %sw.epilog
 
 sw.default:
 ; CHECK: 5 = MemoryDef(8)
 ; CHECK-NEXT: store i32 5
-  store i32 5, i32* %m, align 4
+  store i32 5, ptr %m, align 4
   br label %sw.epilog
 
 sw.epilog:
 ; CHECK: 7 = MemoryPhi({sw.default,5},{sw.bb,1},{sw.bb1,2},{sw.bb2,3},{sw.bb3,4})
 ; CHECK-NEXT: MemoryUse(7)
 ; CHECK-NEXT: %0 =
-  %0 = load i32, i32* %m, align 4
+  %0 = load i32, ptr %m, align 4
 ; CHECK: 6 = MemoryDef(7)
 ; CHECK-NEXT: %1 =
-  %1 = load volatile i32, i32* %p, align 4
+  %1 = load volatile i32, ptr %p, align 4
   %2 = icmp eq i32 %0, %1
   br i1 %2, label %exit, label %loopbegin
 

diff  --git a/llvm/test/Analysis/MemorySSA/multi-edges.ll b/llvm/test/Analysis/MemorySSA/multi-edges.ll
index 135319721be94..cb76944eaa968 100644
--- a/llvm/test/Analysis/MemorySSA/multi-edges.ll
+++ b/llvm/test/Analysis/MemorySSA/multi-edges.ll
@@ -8,21 +8,21 @@ entry:
   %0 = alloca i32, align 4
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 4
-  store i32 4, i32* %0
+  store i32 4, ptr %0
   br i1 %a, label %Loop.Body, label %Loop.End
 
 Loop.Body:
 ; CHECK: 4 = MemoryPhi({entry,1},{Loop.End,3})
 ; CHECK-NEXT: 2 = MemoryDef(4)
 ; CHECK-NEXT: store i32 5
-  store i32 5, i32* %0, align 4
+  store i32 5, ptr %0, align 4
   br i1 %a, label %Loop.End, label %Loop.End ; WhyDoWeEvenHaveThatLever.gif
 
 Loop.End:
 ; CHECK: 3 = MemoryPhi({entry,1},{Loop.Body,2},{Loop.Body,2})
 ; CHECK-NEXT: MemoryUse(3)
 ; CHECK-NEXT: %1 = load
-  %1 = load i32, i32* %0, align 4
+  %1 = load i32, ptr %0, align 4
   %2 = icmp eq i32 5, %1
   br i1 %2, label %Ret, label %Loop.Body
 

diff  --git a/llvm/test/Analysis/MemorySSA/multiple-backedges-hal.ll b/llvm/test/Analysis/MemorySSA/multiple-backedges-hal.ll
index 9961e3fc20b34..601d98f06ea49 100644
--- a/llvm/test/Analysis/MemorySSA/multiple-backedges-hal.ll
+++ b/llvm/test/Analysis/MemorySSA/multiple-backedges-hal.ll
@@ -30,13 +30,13 @@ declare void @doThingWithoutReading() readnone
 declare i8 @getValue() readnone
 declare i1 @getBool() readnone
 
-define hidden void @testcase(i8* %Arg) {
+define hidden void @testcase(ptr %Arg) {
 Entry:
   call void @doThingWithoutReading()
   %Val.Entry = call i8 @getValue()
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i8 %Val.Entry
-  store i8 %Val.Entry, i8* %Arg
+  store i8 %Val.Entry, ptr %Arg
   call void @doThingWithoutReading()
   br label %OuterLoop
 
@@ -46,7 +46,7 @@ OuterLoop:
   %Val.Outer = call i8 @getValue()
 ; CHECK: 2 = MemoryDef(5)
 ; CHECK-NEXT: store i8 %Val.Outer
-  store i8 %Val.Outer, i8* %Arg
+  store i8 %Val.Outer, ptr %Arg
   call void @doThingWithoutReading()
   br label %InnerLoop
 
@@ -54,11 +54,11 @@ InnerLoop:
 ; CHECK: 4 = MemoryPhi({OuterLoop,2},{InnerLoop,3})
 ; CHECK-NEXT: ; MemoryUse(4)
 ; CHECK-NEXT: %StartingAccess = load
-  %StartingAccess = load i8, i8* %Arg, align 4
+  %StartingAccess = load i8, ptr %Arg, align 4
   %Val.Inner = call i8 @getValue()
 ; CHECK: 3 = MemoryDef(4)
 ; CHECK-NEXT: store i8 %Val.Inner
-  store i8 %Val.Inner, i8* %Arg
+  store i8 %Val.Inner, ptr %Arg
   call void @doThingWithoutReading()
   %KeepGoing = call i1 @getBool()
   br i1 %KeepGoing, label %InnerLoop.Tail, label %InnerLoop

diff  --git a/llvm/test/Analysis/MemorySSA/multiple-locations.ll b/llvm/test/Analysis/MemorySSA/multiple-locations.ll
index 99e818d90de5e..0ec05db88ea21 100644
--- a/llvm/test/Analysis/MemorySSA/multiple-locations.ll
+++ b/llvm/test/Analysis/MemorySSA/multiple-locations.ll
@@ -7,17 +7,17 @@ define i32 @foo(i1 %cond) {
   %b = alloca i32, align 4
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 0
-  store i32 0, i32* %a, align 4
+  store i32 0, ptr %a, align 4
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: store i32 1
-  store i32 1, i32* %b, align 4
+  store i32 1, ptr %b, align 4
 
 ; CHECK: MemoryUse(1)
 ; CHECK-NEXT: %1 = load i32
-  %1 = load i32, i32* %a, align 4
+  %1 = load i32, ptr %a, align 4
 ; CHECK: MemoryUse(2)
 ; CHECK-NEXT: %2 = load i32
-  %2 = load i32, i32* %b, align 4
+  %2 = load i32, ptr %b, align 4
 
   %3 = add i32 %1, %2
   ret i32 %3

diff  --git a/llvm/test/Analysis/MemorySSA/no-disconnected.ll b/llvm/test/Analysis/MemorySSA/no-disconnected.ll
index bf9d5b1b85b63..c56dce6899113 100644
--- a/llvm/test/Analysis/MemorySSA/no-disconnected.ll
+++ b/llvm/test/Analysis/MemorySSA/no-disconnected.ll
@@ -7,36 +7,36 @@
 ; entry on each edge, it would choose 2, 4 and disconnect 1 and 3 completely
 ; from the SSA graph, even though they are not dead
 
-define void @sink_store(i32 %index, i32* %foo, i32* %bar) {
+define void @sink_store(i32 %index, ptr %foo, ptr %bar) {
 entry:
   %cmp = trunc i32 %index to i1
   br i1 %cmp, label %if.then, label %if.else
 
 if.then:                                          ; preds = %entry
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:   store i32 %index, i32* %foo, align 4
-  store i32 %index, i32* %foo, align 4
+; CHECK-NEXT:   store i32 %index, ptr %foo, align 4
+  store i32 %index, ptr %foo, align 4
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT:   store i32 %index, i32* %bar, align 4
-  store i32 %index, i32* %bar, align 4
+; CHECK-NEXT:   store i32 %index, ptr %bar, align 4
+  store i32 %index, ptr %bar, align 4
   br label %if.end
 
 if.else:                                          ; preds = %entry
 ; CHECK: 3 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:   store i32 %index, i32* %foo, align 4
-  store i32 %index, i32* %foo, align 4
+; CHECK-NEXT:   store i32 %index, ptr %foo, align 4
+  store i32 %index, ptr %foo, align 4
 ; CHECK: 4 = MemoryDef(3)
-; CHECK-NEXT:   store i32 %index, i32* %bar, align 4
-  store i32 %index, i32* %bar, align 4
+; CHECK-NEXT:   store i32 %index, ptr %bar, align 4
+  store i32 %index, ptr %bar, align 4
   br label %if.end
 
 if.end:                                           ; preds = %if.else, %if.then
 ; CHECK: 5 = MemoryPhi({if.then,2},{if.else,4})
 ; CHECK: MemoryUse(5)
-; CHECK-NEXT:   %c = load i32, i32* %foo
-  %c = load i32, i32* %foo
+; CHECK-NEXT:   %c = load i32, ptr %foo
+  %c = load i32, ptr %foo
 ; CHECK: MemoryUse(5)
-; CHECK-NEXT:   %d = load i32, i32* %bar
-  %d = load i32, i32* %bar
+; CHECK-NEXT:   %d = load i32, ptr %bar
+  %d = load i32, ptr %bar
   ret void
 }

diff  --git a/llvm/test/Analysis/MemorySSA/noalias-scope-decl.ll b/llvm/test/Analysis/MemorySSA/noalias-scope-decl.ll
index 2517430b814e3..c17b78c920eaf 100644
--- a/llvm/test/Analysis/MemorySSA/noalias-scope-decl.ll
+++ b/llvm/test/Analysis/MemorySSA/noalias-scope-decl.ll
@@ -4,16 +4,16 @@
 
 declare void @llvm.experimental.noalias.scope.decl(metadata)
 
-define i32 @foo(i32* %a, i32* %b, i1 %c) {
+define i32 @foo(ptr %a, ptr %b, i1 %c) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store i32 4
-  store i32 4, i32* %a, align 4
+  store i32 4, ptr %a, align 4
 ; CHECK-NOT: MemoryDef
 ; CHECK: call void @llvm.experimental.noalias.scope.decl
   call void @llvm.experimental.noalias.scope.decl(metadata !0)
 ; CHECK: MemoryUse(1)
 ; CHECK-NEXT: %1 = load i32
-  %1 = load i32, i32* %a, align 4
+  %1 = load i32, ptr %a, align 4
   ret i32 %1
 }
 

diff  --git a/llvm/test/Analysis/MemorySSA/nondeterminism.ll b/llvm/test/Analysis/MemorySSA/nondeterminism.ll
index 230c6e61fb33e..b1e3e55d363c9 100644
--- a/llvm/test/Analysis/MemorySSA/nondeterminism.ll
+++ b/llvm/test/Analysis/MemorySSA/nondeterminism.ll
@@ -90,22 +90,22 @@ bb2.split:                                        ; preds = %bb2.bb2.split_crit_
 
 bb4:                                              ; preds = %bb2.split, %bb6
   %i.4.01 = phi i16 [ 0, %bb2.split ]
-  %_tmp16 = getelementptr [1 x [1 x %rec9]], [1 x [1 x %rec9]]* @a, i16 0, i16 %h.3.0, i16 %i.4.01, i32 0
-  %_tmp17 = load i16, i16* %_tmp16, align 1
+  %_tmp16 = getelementptr [1 x [1 x %rec9]], ptr @a, i16 0, i16 %h.3.0, i16 %i.4.01, i32 0
+  %_tmp17 = load i16, ptr %_tmp16, align 1
   br label %g.exit4.critedge
 
 bb1.i:                                            ; preds = %bb4
   br label %g.exit4
 
 g.exit4.critedge:                                 ; preds = %bb4
-  %_tmp28.c = getelementptr [1 x [1 x %rec9]], [1 x [1 x %rec9]]* @a, i16 0, i16 %h.3.0, i16 %i.4.01, i32 1
-  %_tmp29.c = load i32, i32* %_tmp28.c, align 1
+  %_tmp28.c = getelementptr [1 x [1 x %rec9]], ptr @a, i16 0, i16 %h.3.0, i16 %i.4.01, i32 1
+  %_tmp29.c = load i32, ptr %_tmp28.c, align 1
   %_tmp30.c = trunc i32 %_tmp29.c to i16
   br label %g.exit4
 
 g.exit4:                                          ; preds = %g.exit4.critedge, %bb1.i
   %i.4.02 = phi i16 [ %i.4.01, %g.exit4.critedge ], [ %i.4.01, %bb1.i ]
-  %_tmp41 = getelementptr [1 x [1 x %rec9]], [1 x [1 x %rec9]]* @a, i16 0, i16 %h.3.0, i16 %i.4.02, i32 2
+  %_tmp41 = getelementptr [1 x [1 x %rec9]], ptr @a, i16 0, i16 %h.3.0, i16 %i.4.02, i32 2
   br label %bb6
 
 bb5:                                              ; preds = %g.exit4

diff  --git a/llvm/test/Analysis/MemorySSA/optimize-use.ll b/llvm/test/Analysis/MemorySSA/optimize-use.ll
index e1b529670f304..9db457081dd4d 100644
--- a/llvm/test/Analysis/MemorySSA/optimize-use.ll
+++ b/llvm/test/Analysis/MemorySSA/optimize-use.ll
@@ -5,42 +5,40 @@
 define i32 @main() {
 entry:
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:   %call = call noalias i8* @_Znwm(i64 4)
-  %call = call noalias i8* @_Znwm(i64 4)
-  %0 = bitcast i8* %call to i32*
+; CHECK-NEXT:   %call = call noalias ptr @_Znwm(i64 4)
+  %call = call noalias ptr @_Znwm(i64 4)
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT:   %call1 = call noalias i8* @_Znwm(i64 4)
-  %call1 = call noalias i8* @_Znwm(i64 4)
-  %1 = bitcast i8* %call1 to i32*
+; CHECK-NEXT:   %call1 = call noalias ptr @_Znwm(i64 4)
+  %call1 = call noalias ptr @_Znwm(i64 4)
 ; CHECK: 3 = MemoryDef(2)
-; CHECK-NEXT:   store i32 5, i32* %0, align 4
-  store i32 5, i32* %0, align 4
+; CHECK-NEXT:   store i32 5, ptr %call, align 4
+  store i32 5, ptr %call, align 4
 ; CHECK: 4 = MemoryDef(3)
-; CHECK-NEXT:   store i32 7, i32* %1, align 4
-  store i32 7, i32* %1, align 4
+; CHECK-NEXT:   store i32 7, ptr %call1, align 4
+  store i32 7, ptr %call1, align 4
 ; NOLIMIT: MemoryUse(3)
-; NOLIMIT-NEXT:   %2 = load i32, i32* %0, align 4
+; NOLIMIT-NEXT:   %0 = load i32, ptr %call, align 4
 ; LIMIT: MemoryUse(4)
-; LIMIT-NEXT:   %2 = load i32, i32* %0, align 4
-  %2 = load i32, i32* %0, align 4
+; LIMIT-NEXT:   %0 = load i32, ptr %call, align 4
+  %0 = load i32, ptr %call, align 4
 ; NOLIMIT: MemoryUse(4)
-; NOLIMIT-NEXT:   %3 = load i32, i32* %1, align 4
+; NOLIMIT-NEXT:   %1 = load i32, ptr %call1, align 4
 ; LIMIT: MemoryUse(4)
-; LIMIT-NEXT:   %3 = load i32, i32* %1, align 4
-  %3 = load i32, i32* %1, align 4
+; LIMIT-NEXT:   %1 = load i32, ptr %call1, align 4
+  %1 = load i32, ptr %call1, align 4
 ; NOLIMIT: MemoryUse(3)
-; NOLIMIT-NEXT:   %4 = load i32, i32* %0, align 4
+; NOLIMIT-NEXT:   %2 = load i32, ptr %call, align 4
 ; LIMIT: MemoryUse(4)
-; LIMIT-NEXT:   %4 = load i32, i32* %0, align 4
-  %4 = load i32, i32* %0, align 4
+; LIMIT-NEXT:   %2 = load i32, ptr %call, align 4
+  %2 = load i32, ptr %call, align 4
 ; NOLIMIT: MemoryUse(4)
-; NOLIMIT-NEXT:   %5 = load i32, i32* %1, align 4
+; NOLIMIT-NEXT:   %3 = load i32, ptr %call1, align 4
 ; LIMIT: MemoryUse(4)
-; LIMIT-NEXT:   %5 = load i32, i32* %1, align 4
-  %5 = load i32, i32* %1, align 4
-  %add = add nsw i32 %3, %5
+; LIMIT-NEXT:   %3 = load i32, ptr %call1, align 4
+  %3 = load i32, ptr %call1, align 4
+  %add = add nsw i32 %1, %3
   ret i32 %add
 }
 
 
-declare noalias i8* @_Znwm(i64)
+declare noalias ptr @_Znwm(i64)

diff  --git a/llvm/test/Analysis/MemorySSA/phi-translation.ll b/llvm/test/Analysis/MemorySSA/phi-translation.ll
index 7d5486b7e0396..46a49d4965737 100644
--- a/llvm/test/Analysis/MemorySSA/phi-translation.ll
+++ b/llvm/test/Analysis/MemorySSA/phi-translation.ll
@@ -4,28 +4,28 @@
 ; %ptr can't alias %local, so we should be able to optimize the use of %local to
 ; point to the store to %local.
 ; CHECK-LABEL: define void @check
-define void @check(i8* %ptr, i1 %bool) {
+define void @check(ptr %ptr, i1 %bool) {
 entry:
   %local = alloca i8, align 1
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: store i8 0, i8* %local, align 1
-  store i8 0, i8* %local, align 1
+; CHECK-NEXT: store i8 0, ptr %local, align 1
+  store i8 0, ptr %local, align 1
   br i1 %bool, label %if.then, label %if.end
 
 if.then:
-  %p2 = getelementptr inbounds i8, i8* %ptr, i32 1
+  %p2 = getelementptr inbounds i8, ptr %ptr, i32 1
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: store i8 0, i8* %p2, align 1
-  store i8 0, i8* %p2, align 1
+; CHECK-NEXT: store i8 0, ptr %p2, align 1
+  store i8 0, ptr %p2, align 1
   br label %if.end
 
 if.end:
 ; CHECK: 3 = MemoryPhi({entry,1},{if.then,2})
 ; NOLIMIT: MemoryUse(1)
-; NOLIMIT-NEXT: load i8, i8* %local, align 1
+; NOLIMIT-NEXT: load i8, ptr %local, align 1
 ; LIMIT: MemoryUse(3)
-; LIMIT-NEXT: load i8, i8* %local, align 1
-  load i8, i8* %local, align 1
+; LIMIT-NEXT: load i8, ptr %local, align 1
+  load i8, ptr %local, align 1
   ret void
 }
 
@@ -36,28 +36,28 @@ entry:
   %local2 = alloca i8, align 1
 
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: store i8 0, i8* %local
-  store i8 0, i8* %local
+; CHECK-NEXT: store i8 0, ptr %local
+  store i8 0, ptr %local
   br i1 %val1, label %if.then, label %phi.3
 
 if.then:
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: store i8 2, i8* %local2
-  store i8 2, i8* %local2
+; CHECK-NEXT: store i8 2, ptr %local2
+  store i8 2, ptr %local2
   br i1 %val2, label %phi.2, label %phi.3
 
 phi.3:
 ; CHECK: 7 = MemoryPhi({entry,1},{if.then,2})
 ; CHECK: 3 = MemoryDef(7)
-; CHECK-NEXT: store i8 3, i8* %local2
-  store i8 3, i8* %local2
+; CHECK-NEXT: store i8 3, ptr %local2
+  store i8 3, ptr %local2
   br i1 %val3, label %phi.2, label %phi.1
 
 phi.2:
 ; CHECK: 5 = MemoryPhi({if.then,2},{phi.3,3})
 ; CHECK: 4 = MemoryDef(5)
-; CHECK-NEXT: store i8 4, i8* %local2
-  store i8 4, i8* %local2
+; CHECK-NEXT: store i8 4, ptr %local2
+  store i8 4, ptr %local2
   br label %phi.1
 
 phi.1:
@@ -65,97 +65,97 @@ phi.1:
 ; they're visited in.
 ; CHECK: 6 = MemoryPhi({phi.2,4},{phi.3,3})
 ; NOLIMIT: MemoryUse(1)
-; NOLIMIT-NEXT: load i8, i8* %local
+; NOLIMIT-NEXT: load i8, ptr %local
 ; LIMIT: MemoryUse(6)
-; LIMIT-NEXT: load i8, i8* %local
-  load i8, i8* %local
+; LIMIT-NEXT: load i8, ptr %local
+  load i8, ptr %local
   ret void
 }
 
 ; CHECK-LABEL: define void @cross_phi
-define void @cross_phi(i8* noalias %p1, i8* noalias %p2) {
+define void @cross_phi(ptr noalias %p1, ptr noalias %p2) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: store i8 0, i8* %p1
-  store i8 0, i8* %p1
+; CHECK-NEXT: store i8 0, ptr %p1
+  store i8 0, ptr %p1
 ; NOLIMIT: MemoryUse(1)
-; NOLIMIT-NEXT: load i8, i8* %p1
+; NOLIMIT-NEXT: load i8, ptr %p1
 ; LIMIT: MemoryUse(1)
-; LIMIT-NEXT: load i8, i8* %p1
-  load i8, i8* %p1
+; LIMIT-NEXT: load i8, ptr %p1
+  load i8, ptr %p1
   br i1 undef, label %a, label %b
 
 a:
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: store i8 0, i8* %p2
-  store i8 0, i8* %p2
+; CHECK-NEXT: store i8 0, ptr %p2
+  store i8 0, ptr %p2
   br i1 undef, label %c, label %d
 
 b:
 ; CHECK: 3 = MemoryDef(1)
-; CHECK-NEXT: store i8 1, i8* %p2
-  store i8 1, i8* %p2
+; CHECK-NEXT: store i8 1, ptr %p2
+  store i8 1, ptr %p2
   br i1 undef, label %c, label %d
 
 c:
 ; CHECK: 6 = MemoryPhi({a,2},{b,3})
 ; CHECK: 4 = MemoryDef(6)
-; CHECK-NEXT: store i8 2, i8* %p2
-  store i8 2, i8* %p2
+; CHECK-NEXT: store i8 2, ptr %p2
+  store i8 2, ptr %p2
   br label %e
 
 d:
 ; CHECK: 7 = MemoryPhi({a,2},{b,3})
 ; CHECK: 5 = MemoryDef(7)
-; CHECK-NEXT: store i8 3, i8* %p2
-  store i8 3, i8* %p2
+; CHECK-NEXT: store i8 3, ptr %p2
+  store i8 3, ptr %p2
   br label %e
 
 e:
 ; 8 = MemoryPhi({c,4},{d,5})
 ; NOLIMIT: MemoryUse(1)
-; NOLIMIT-NEXT: load i8, i8* %p1
+; NOLIMIT-NEXT: load i8, ptr %p1
 ; LIMIT: MemoryUse(8)
-; LIMIT-NEXT: load i8, i8* %p1
-  load i8, i8* %p1
+; LIMIT-NEXT: load i8, ptr %p1
+  load i8, ptr %p1
   ret void
 }
 
 ; CHECK-LABEL: define void @looped
-define void @looped(i8* noalias %p1, i8* noalias %p2) {
+define void @looped(ptr noalias %p1, ptr noalias %p2) {
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: store i8 0, i8* %p1
-  store i8 0, i8* %p1
+; CHECK-NEXT: store i8 0, ptr %p1
+  store i8 0, ptr %p1
   br label %loop.1
 
 loop.1:
 ; CHECK: 6 = MemoryPhi({%0,1},{loop.3,4})
 ; CHECK: 2 = MemoryDef(6)
-; CHECK-NEXT: store i8 0, i8* %p2
-  store i8 0, i8* %p2
+; CHECK-NEXT: store i8 0, ptr %p2
+  store i8 0, ptr %p2
   br i1 undef, label %loop.2, label %loop.3
 
 loop.2:
 ; CHECK: 5 = MemoryPhi({loop.1,2},{loop.3,4})
 ; CHECK: 3 = MemoryDef(5)
-; CHECK-NEXT: store i8 1, i8* %p2
-  store i8 1, i8* %p2
+; CHECK-NEXT: store i8 1, ptr %p2
+  store i8 1, ptr %p2
   br label %loop.3
 
 loop.3:
 ; CHECK: 7 = MemoryPhi({loop.1,2},{loop.2,3})
 ; CHECK: 4 = MemoryDef(7)
-; CHECK-NEXT: store i8 2, i8* %p2
-  store i8 2, i8* %p2
+; CHECK-NEXT: store i8 2, ptr %p2
+  store i8 2, ptr %p2
 ; NOLIMIT: MemoryUse(1)
-; NOLIMIT-NEXT: load i8, i8* %p1
+; NOLIMIT-NEXT: load i8, ptr %p1
 ; LIMIT: MemoryUse(4)
-; LIMIT-NEXT: load i8, i8* %p1
-  load i8, i8* %p1
+; LIMIT-NEXT: load i8, ptr %p1
+  load i8, ptr %p1
   br i1 undef, label %loop.2, label %loop.1
 }
 
 ; CHECK-LABEL: define void @looped_visitedonlyonce
-define void @looped_visitedonlyonce(i8* noalias %p1, i8* noalias %p2) {
+define void @looped_visitedonlyonce(ptr noalias %p1, ptr noalias %p2) {
   br label %while.cond
 
 while.cond:
@@ -165,38 +165,38 @@ while.cond:
 
 if.then:
 ; CHECK: 1 = MemoryDef(5)
-; CHECK-NEXT: store i8 0, i8* %p1
-  store i8 0, i8* %p1
+; CHECK-NEXT: store i8 0, ptr %p1
+  store i8 0, ptr %p1
   br i1 undef, label %if.end, label %if.then2
 
 if.then2:
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: store i8 1, i8* %p2
-  store i8 1, i8* %p2
+; CHECK-NEXT: store i8 1, ptr %p2
+  store i8 1, ptr %p2
   br label %if.end
 
 if.end:
 ; CHECK: 4 = MemoryPhi({while.cond,5},{if.then,1},{if.then2,2})
 ; CHECK: MemoryUse(4)
-; CHECK-NEXT: load i8, i8* %p1
-  load i8, i8* %p1
+; CHECK-NEXT: load i8, ptr %p1
+  load i8, ptr %p1
 ; CHECK: 3 = MemoryDef(4)
-; CHECK-NEXT: store i8 2, i8* %p2
-  store i8 2, i8* %p2
+; CHECK-NEXT: store i8 2, ptr %p2
+  store i8 2, ptr %p2
 ; NOLIMIT: MemoryUse(4)
-; NOLIMIT-NEXT: load i8, i8* %p1
+; NOLIMIT-NEXT: load i8, ptr %p1
 ; LIMIT: MemoryUse(3)
-; LIMIT-NEXT: load i8, i8* %p1
-  load i8, i8* %p1
+; LIMIT-NEXT: load i8, ptr %p1
+  load i8, ptr %p1
   br label %while.cond
 }
 
 ; CHECK-LABEL: define i32 @use_not_optimized_due_to_backedge
-define i32 @use_not_optimized_due_to_backedge(i32* nocapture %m_i_strides, i32* nocapture readonly %eval_left_dims) {
+define i32 @use_not_optimized_due_to_backedge(ptr nocapture %m_i_strides, ptr nocapture readonly %eval_left_dims) {
 entry:
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: store i32 1, i32* %m_i_strides, align 4
-  store i32 1, i32* %m_i_strides, align 4
+; CHECK-NEXT: store i32 1, ptr %m_i_strides, align 4
+  store i32 1, ptr %m_i_strides, align 4
   br label %for.body
 
 for.cond.cleanup:                                 ; preds = %for.inc
@@ -209,22 +209,22 @@ for.body:                                         ; preds = %entry, %for.inc
   %m_i_size.022 = phi i32 [ 1, %entry ], [ %m_i_size.1, %for.inc ]
   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
   %cmp1 = icmp eq i64 %indvars.iv, 0
-  %arrayidx2 = getelementptr inbounds i32, i32* %m_i_strides, i64 %indvars.iv
+  %arrayidx2 = getelementptr inbounds i32, ptr %m_i_strides, i64 %indvars.iv
 ; CHECK: MemoryUse(4)
-; CHECK-NEXT: %0 = load i32, i32* %arrayidx2, align 4
-  %0 = load i32, i32* %arrayidx2, align 4
-  %arrayidx4 = getelementptr inbounds i32, i32* %eval_left_dims, i64 %indvars.iv
+; CHECK-NEXT: %0 = load i32, ptr %arrayidx2, align 4
+  %0 = load i32, ptr %arrayidx2, align 4
+  %arrayidx4 = getelementptr inbounds i32, ptr %eval_left_dims, i64 %indvars.iv
 ; CHECK: MemoryUse(4)
-; CHECK-NEXT: %1 = load i32, i32* %arrayidx4, align 4
-  %1 = load i32, i32* %arrayidx4, align 4
+; CHECK-NEXT: %1 = load i32, ptr %arrayidx4, align 4
+  %1 = load i32, ptr %arrayidx4, align 4
   %mul = mul nsw i32 %1, %0
   br i1 %cmp1, label %if.then, label %for.inc
 
 if.then:                                          ; preds = %for.body
-  %arrayidx7 = getelementptr inbounds i32, i32* %m_i_strides, i64 %indvars.iv.next
+  %arrayidx7 = getelementptr inbounds i32, ptr %m_i_strides, i64 %indvars.iv.next
 ; CHECK: 2 = MemoryDef(4)
-; CHECK-NEXT: store i32 %mul, i32* %arrayidx7, align 4
-  store i32 %mul, i32* %arrayidx7, align 4
+; CHECK-NEXT: store i32 %mul, ptr %arrayidx7, align 4
+  store i32 %mul, ptr %arrayidx7, align 4
   br label %for.inc
 
 for.inc:                                          ; preds = %for.body, %if.then
@@ -240,25 +240,23 @@ for.inc:                                          ; preds = %for.body, %if.then
 %BigStruct = type { i8, i8, i8, i8, i8, i8, i8, %ArrayType, %ArrayType}
 
 ; CHECK-LABEL: define void @use_not_optimized_due_to_backedge_unknown
-define void @use_not_optimized_due_to_backedge_unknown(%BigStruct* %this) {
+define void @use_not_optimized_due_to_backedge_unknown(ptr %this) {
 entry:
   %eval_left_dims = alloca %StructOverArrayType, align 8
-  %tmp0 = bitcast %StructOverArrayType* %eval_left_dims to i8*
   %eval_right_dims = alloca %StructOverArrayType, align 8
-  %tmp1 = bitcast %StructOverArrayType* %eval_right_dims to i8*
   %lhs_strides = alloca %ArrayType, align 8
   %rhs_strides = alloca %ArrayType, align 8
   br label %for.body.preheader
 
 for.body.preheader:                               ; preds = %entry
-  %arrayidx.i527 = getelementptr inbounds %BigStruct, %BigStruct* %this, i64 0, i32 7, i32 0, i64 0
+  %arrayidx.i527 = getelementptr inbounds %BigStruct, ptr %this, i64 0, i32 7, i32 0, i64 0
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: store i64 1, i64* %arrayidx.i527, align 8
-  store i64 1, i64* %arrayidx.i527, align 8
-  %arrayidx.i528 = getelementptr inbounds %BigStruct, %BigStruct* %this, i64 0, i32 8, i32 0, i64 0
+; CHECK-NEXT: store i64 1, ptr %arrayidx.i527, align 8
+  store i64 1, ptr %arrayidx.i527, align 8
+  %arrayidx.i528 = getelementptr inbounds %BigStruct, ptr %this, i64 0, i32 8, i32 0, i64 0
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: store i64 1, i64* %arrayidx.i528, align 8
-  store i64 1, i64* %arrayidx.i528, align 8
+; CHECK-NEXT: store i64 1, ptr %arrayidx.i528, align 8
+  store i64 1, ptr %arrayidx.i528, align 8
   br label %for.main.body
 
 for.main.body:               ; preds = %if.end220.if.then185_crit_edge, %for.body.preheader
@@ -267,18 +265,18 @@ for.main.body:               ; preds = %if.end220.if.then185_crit_edge, %for.bod
   %nocontract_idx.0656 = phi i64 [ 0, %for.body.preheader ], [ 1, %if.end220.if.then185_crit_edge ]
   %add199 = add nuw nsw i64 %nocontract_idx.0656, 1
   %cmp200 = icmp eq i64 %nocontract_idx.0656, 0
-  %arrayidx.i559 = getelementptr inbounds %BigStruct, %BigStruct* %this, i64 0, i32 7, i32 0, i64 %nocontract_idx.0656
+  %arrayidx.i559 = getelementptr inbounds %BigStruct, ptr %this, i64 0, i32 7, i32 0, i64 %nocontract_idx.0656
 ; CHECK: MemoryUse(4)
-; CHECK-NEXT: %tmp21 = load i64, i64* %arrayidx.i559, align 8
-  %tmp21 = load i64, i64* %arrayidx.i559, align 8
+; CHECK-NEXT: %tmp21 = load i64, ptr %arrayidx.i559, align 8
+  %tmp21 = load i64, ptr %arrayidx.i559, align 8
   %mul206 = mul nsw i64 %tmp21, %tmp21
   br i1 %cmp200, label %if.end220.if.then185_crit_edge, label %the.end
 
 if.end220.if.then185_crit_edge:                   ; preds = %for.main.body
-  %arrayidx.i571 = getelementptr inbounds %BigStruct, %BigStruct* %this, i64 0, i32 7, i32 0, i64 %add199
+  %arrayidx.i571 = getelementptr inbounds %BigStruct, ptr %this, i64 0, i32 7, i32 0, i64 %add199
 ; CHECK: 3 = MemoryDef(4)
-; CHECK-NEXT: store i64 %mul206, i64* %arrayidx.i571, align 8
-  store i64 %mul206, i64* %arrayidx.i571, align 8
+; CHECK-NEXT: store i64 %mul206, ptr %arrayidx.i571, align 8
+  store i64 %mul206, ptr %arrayidx.i571, align 8
   br label %for.main.body
 
 the.end:                            ; preds = %for.main.body
@@ -289,74 +287,71 @@ the.end:                            ; preds = %for.main.body
 
 @c = local_unnamed_addr global [2 x i16] zeroinitializer, align 2
 
-define i32 @dont_merge_noalias_simple(i32* noalias %ptr) {
+define i32 @dont_merge_noalias_simple(ptr noalias %ptr) {
 ; CHECK-LABEL: define i32 @dont_merge_noalias_simple
 ; CHECK-LABEL: entry:
 ; CHECK:       ; 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:  store i16 1, i16* %s1.ptr, align 2
+; CHECK-NEXT:  store i16 1, ptr @c, align 2
 
 ; CHECK-LABEL: %for.body
 ; NOLIMIT:     ; MemoryUse(1)
 ; LIMIT:       ; MemoryUse(4)
-; CHECK-NEXT:    %lv = load i16, i16* %arrayidx, align 2
+; CHECK-NEXT:    %lv = load i16, ptr %arrayidx, align 2
 
 entry:
-  %s1.ptr = getelementptr inbounds [2 x i16], [2 x i16]* @c, i64 0, i64 0
-  store i16 1, i16* %s1.ptr, align 2
+  store i16 1, ptr @c, align 2
   br label %for.body
 
 for.body:                                         ; preds = %for.body, %entry
   %storemerge2 = phi i32 [ 1, %entry ], [ %dec, %for.body ]
   %idxprom1 = zext i32 %storemerge2 to i64
-  %arrayidx = getelementptr inbounds [2 x i16], [2 x i16]* @c, i64 0, i64 %idxprom1
-  %lv = load i16, i16* %arrayidx, align 2
+  %arrayidx = getelementptr inbounds [2 x i16], ptr @c, i64 0, i64 %idxprom1
+  %lv = load i16, ptr %arrayidx, align 2
   %conv = sext i16 %lv to i32
-  store i32 %conv, i32* %ptr, align 4
+  store i32 %conv, ptr %ptr, align 4
   %dec = add nsw i32 %storemerge2, -1
   %cmp = icmp sgt i32 %storemerge2, 0
   br i1 %cmp, label %for.body, label %for.end
 
 for.end:                                          ; preds = %for.body
-  %s2.ptr = getelementptr inbounds [2 x i16], [2 x i16]* @c, i64 0, i64 0
-  store i16 0, i16* %s2.ptr, align 2
+  store i16 0, ptr @c, align 2
   ret i32 0
 }
 
 
-define i32 @dont_merge_noalias_complex(i32* noalias %ptr, i32* noalias %another) {
+define i32 @dont_merge_noalias_complex(ptr noalias %ptr, ptr noalias %another) {
 ; CHECK-LABEL: define i32 @dont_merge_noalias_complex
 ; CHECK-LABEL: entry:
 ; CHECK:       ; 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:  store i16 1, i16* %s1.ptr, align 2
+; CHECK-NEXT:  store i16 1, ptr @c, align 2
 
 ; CHECK-LABEL: %for.body
 ; NOLIMIT:     ; MemoryUse(1)
 ; LIMIT:       ; MemoryUse(7)
-; CHECK-NEXT:    %lv = load i16, i16* %arrayidx, align 2
+; CHECK-NEXT:    %lv = load i16, ptr %arrayidx, align 2
 
 entry:
-  %s1.ptr = getelementptr inbounds [2 x i16], [2 x i16]* @c, i64 0, i64 0
-  store i16 1, i16* %s1.ptr, align 2
+  store i16 1, ptr @c, align 2
   br label %for.body
 
 for.body:                                         ; preds = %for.body, %entry
   %storemerge2 = phi i32 [ 1, %entry ], [ %dec, %merge.body ]
   %idxprom1 = zext i32 %storemerge2 to i64
-  %arrayidx = getelementptr inbounds [2 x i16], [2 x i16]* @c, i64 0, i64 %idxprom1
-  %lv = load i16, i16* %arrayidx, align 2
+  %arrayidx = getelementptr inbounds [2 x i16], ptr @c, i64 0, i64 %idxprom1
+  %lv = load i16, ptr %arrayidx, align 2
   %conv = sext i16 %lv to i32
-  store i32 %conv, i32* %ptr, align 4
+  store i32 %conv, ptr %ptr, align 4
   %dec = add nsw i32 %storemerge2, -1
 
   %cmpif = icmp sgt i32 %storemerge2, 1
   br i1 %cmpif, label %if.body, label %else.body
 
 if.body:
-  store i32 %conv, i32* %another, align 4
+  store i32 %conv, ptr %another, align 4
   br label %merge.body
 
 else.body:
-  store i32 %conv, i32* %another, align 4
+  store i32 %conv, ptr %another, align 4
   br label %merge.body
 
 merge.body:
@@ -364,16 +359,15 @@ merge.body:
   br i1 %cmp, label %for.body, label %for.end
 
 for.end:                                          ; preds = %for.body
-  %s2.ptr = getelementptr inbounds [2 x i16], [2 x i16]* @c, i64 0, i64 0
-  store i16 0, i16* %s2.ptr, align 2
+  store i16 0, ptr @c, align 2
   ret i32 0
 }
 
 declare i1 @should_exit(i32) readnone
-declare void @init([32 x i32]*)
+declare void @init(ptr)
 
 ; Test case for PR47498.
-; %l.1 may read the result of `store i32 10, i32* %p.1` in %storebb, because
+; %l.1 may read the result of `store i32 10, ptr %p.1` in %storebb, because
 ; after %storebb has been executed, %loop.1.header might be executed again.
 ; Make sure %l.1's defining access is the MemoryPhi in the block.
 define void @dont_merge_noalias_complex_2(i32 %arg, i32 %arg1)  {
@@ -381,33 +375,33 @@ define void @dont_merge_noalias_complex_2(i32 %arg, i32 %arg1)  {
 
 ; CHECK-LABEL: entry:
 ; CHECK:       ; 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:  call void @init([32 x i32]* %tmp)
+; CHECK-NEXT:  call void @init(ptr %tmp)
 
 ; CHECK-LABEL: loop.1.header:
 ; CHECK-NEXT:  ; 4 = MemoryPhi({entry,1},{loop.1.latch,3})
 ; CHECK:       ; MemoryUse(4)
-; CHECK-NEXT:  %l.1 = load i32, i32* %p.1, align 4
+; CHECK-NEXT:  %l.1 = load i32, ptr %p.1, align 4
 
 ; CHECK-LABEL: loop.1.latch:
 ; CHECK-NEXT:  ; 3 = MemoryPhi({loop.1.header,4},{storebb,2})
 
 ; CHECK-LABEL: storebb:
 ; CHECK-NEXT:  %iv.add2 = add nuw nsw i64 %iv, 2
-; CHECK-NEXT:  %p.2 = getelementptr inbounds [32 x i32], [32 x i32]* %tmp, i64 0, i64 %iv.add2
+; CHECK-NEXT:  %p.2 = getelementptr inbounds [32 x i32], ptr %tmp, i64 0, i64 %iv.add2
 ; CHECK-NEXT:  ; MemoryUse(4)
-; CHECK-NEXT:  %l.2 = load i32, i32* %p.2, align 4
+; CHECK-NEXT:  %l.2 = load i32, ptr %p.2, align 4
 ; CHECK-NEXT:  ; 2 = MemoryDef(4)
-; CHECK-NEXT:  store i32 10, i32* %p.1, align 4
+; CHECK-NEXT:  store i32 10, ptr %p.1, align 4
 entry:
   %tmp = alloca [32 x i32], align 16
-  call void @init([32 x i32]* %tmp)
+  call void @init(ptr %tmp)
   br label %loop.1.header
 
 loop.1.header:
   %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.1.latch ]
   %iv.next = add nuw nsw i64 %iv, 1
-  %p.1 = getelementptr inbounds [32 x i32], [32 x i32]* %tmp, i64 0, i64 %iv.next
-  %l.1 = load i32, i32* %p.1, align 4
+  %p.1 = getelementptr inbounds [32 x i32], ptr %tmp, i64 0, i64 %iv.next
+  %l.1 = load i32, ptr %p.1, align 4
   %tmp244 = icmp ult i64 %iv, 10
   br i1 %tmp244, label %loop.1.latch, label %storebb
 
@@ -417,9 +411,9 @@ loop.1.latch:
 
 storebb:
   %iv.add2 = add nuw nsw i64 %iv, 2
-  %p.2 = getelementptr inbounds [32 x i32], [32 x i32]* %tmp, i64 0, i64 %iv.add2
-  %l.2 = load i32, i32* %p.2, align 4
-  store i32 10, i32* %p.1, align 4
+  %p.2 = getelementptr inbounds [32 x i32], ptr %tmp, i64 0, i64 %iv.add2
+  %l.2 = load i32, ptr %p.2, align 4
+  store i32 10, ptr %p.1, align 4
   br label %loop.1.latch
 
 exit:
@@ -430,38 +424,37 @@ define i32 @phi_with_constant_values(i1 %cmp) {
 ; CHECK-LABEL: define i32 @phi_with_constant_values
 ; CHECK-LABEL: lhs:
 ; CHECK:       ; 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:  store i16 1, i16* %s1.ptr, align 2
+; CHECK-NEXT:  store i16 1, ptr @c, align 2
 
 ; CHECK-LABEL: rhs:
 ; CHECK:       ; 2 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:  store i16 1, i16* %s2.ptr, align 2
+; CHECK-NEXT:  store i16 1, ptr %s2.ptr, align 2
 
 ; CHECK-LABEL: merge:
 ; CHECK:       ; 3 = MemoryPhi({lhs,1},{rhs,2})
 ; CHECK-NEXT   %storemerge2 = phi i32 [ 2, %lhs ], [ 3, %rhs ]
 ; LIMIT:       ; MemoryUse(3)
-; LIMIT-NEXT:  %lv = load i16, i16* %arrayidx, align 2
+; LIMIT-NEXT:  %lv = load i16, ptr %arrayidx, align 2
 ; NOLIMIT:     ; MemoryUse(liveOnEntry)
-; NOLIMIT-NEXT: %lv = load i16, i16* %arrayidx, align 2
+; NOLIMIT-NEXT: %lv = load i16, ptr %arrayidx, align 2
 
 entry:
   br i1 %cmp, label %lhs, label %rhs
 
 lhs:
-  %s1.ptr = getelementptr inbounds [2 x i16], [2 x i16]* @c, i64 0, i64 0
-  store i16 1, i16* %s1.ptr, align 2
+  store i16 1, ptr @c, align 2
   br label %merge
 
 rhs:
-  %s2.ptr = getelementptr inbounds [2 x i16], [2 x i16]* @c, i64 0, i64 1
-  store i16 1, i16* %s2.ptr, align 2
+  %s2.ptr = getelementptr inbounds [2 x i16], ptr @c, i64 0, i64 1
+  store i16 1, ptr %s2.ptr, align 2
   br label %merge
 
 merge:                                         ; preds = %for.body, %entry
   %storemerge2 = phi i32 [ 2, %lhs ], [ 3, %rhs ]
   %idxprom1 = zext i32 %storemerge2 to i64
-  %arrayidx = getelementptr inbounds [2 x i16], [2 x i16]* @c, i64 0, i64 %idxprom1
-  %lv = load i16, i16* %arrayidx, align 2
+  %arrayidx = getelementptr inbounds [2 x i16], ptr @c, i64 0, i64 %idxprom1
+  %lv = load i16, ptr %arrayidx, align 2
   br label %end
 
 end:                                          ; preds = %for.body
@@ -472,8 +465,7 @@ end:                                          ; preds = %for.body
 define void @use_clobbered_by_def_in_loop() {
 entry:
   %nodeStack = alloca [12 x i32], align 4
-  %0 = bitcast [12 x i32]* %nodeStack to i8*
-  call void @llvm.lifetime.start.p0i8(i64 48, i8* nonnull %0)
+  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %nodeStack)
   br i1 false, label %cleanup, label %while.cond
 
 ; CHECK-LABEL: while.cond:
@@ -486,14 +478,14 @@ while.cond:                                       ; preds = %entry, %while.cond.
 
 ; CHECK-LABEL: land.rhs:
 ; CHECK-NEXT: %sub = add nsw i32 %depth.1, -1
-; CHECK-NEXT: %arrayidx = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i32 %sub
+; CHECK-NEXT: %arrayidx = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i32 %sub
 ; CHECK-NEXT: ; MemoryUse([[NO6]])
-; CHECK-NEXT: %1 = load i32, i32* %arrayidx, align 4
+; CHECK-NEXT: %0 = load i32, ptr %arrayidx, align 4
 
 land.rhs:                                         ; preds = %while.cond
   %sub = add nsw i32 %depth.1, -1
-  %arrayidx = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i32 %sub
-  %1 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i32 %sub
+  %0 = load i32, ptr %arrayidx, align 4
   br i1 true, label %while.body, label %while.end
 
 while.body:                                       ; preds = %land.rhs
@@ -504,18 +496,18 @@ while.cond.backedge:                              ; preds = %while.body, %while.
   br label %while.cond
 
 while.end:                                        ; preds = %while.cond, %land.rhs
-  %arrayidx10 = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i32 %depth.1
-  store i32 %depth.1, i32* %arrayidx10, align 4
+  %arrayidx10 = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i32 %depth.1
+  store i32 %depth.1, ptr %arrayidx10, align 4
   %inc = add nsw i32 %depth.1, 1
   br i1 true, label %cleanup, label %while.cond.backedge
 
 cleanup:                                          ; preds = %while.body, %while.end, %entry
-  call void @llvm.lifetime.end.p0i8(i64 48, i8* nonnull %0)
+  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %nodeStack)
   ret void
 }
 
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
 
 define void @another_loop_clobber_inc() {
 ; CHECK-LABEL: void @another_loop_clobber_inc
@@ -524,12 +516,12 @@ define void @another_loop_clobber_inc() {
 
 ; CHECK-LABEL: cond.read:
 ; CHECK:       ; MemoryUse(4)
-; CHECK-NEXT:  %use = load i32, i32* %ptr.1, align 4
+; CHECK-NEXT:  %use = load i32, ptr %ptr.1, align 4
 ; CHECK-NEXT:  ; 2 = MemoryDef(4)
 ; CHECK-NEXT:  %c.2 = call i1 @cond(i32 %use)
-; CHECK-NEXT:  %ptr.10 = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i32 %inc
+; CHECK-NEXT:  %ptr.10 = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i32 %inc
 ; CHECK-NEXT:  ; 3 = MemoryDef(2)
-; CHECK-NEXT:  store i32 10, i32* %ptr.2, align 4
+; CHECK-NEXT:  store i32 10, ptr %ptr.2, align 4
 
 entry:
   %nodeStack = alloca [12 x i32], align 4
@@ -544,12 +536,12 @@ loop.header:                                       ; preds = %entry, %while.cond
   br i1 %cmp, label %cond.read, label %cleanup
 
 cond.read:                                        ; preds = %while.cond
-  %ptr.1 = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i32 %depth.1
-  %ptr.2 = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i32 %inc2
-  %use = load i32, i32* %ptr.1, align 4
+  %ptr.1 = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i32 %depth.1
+  %ptr.2 = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i32 %inc2
+  %use = load i32, ptr %ptr.1, align 4
   %c.2 = call i1 @cond(i32 %use)
-  %ptr.10 = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i32 %inc
-  store i32 10, i32* %ptr.2, align 4
+  %ptr.10 = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i32 %inc
+  store i32 10, ptr %ptr.2, align 4
   br i1 %c.2, label %loop.header, label %cleanup
 
 cleanup:
@@ -563,12 +555,12 @@ define void @another_loop_clobber_dec() {
 
 ; CHECK-LABEL: cond.read:
 ; CHECK:       ; MemoryUse(4)
-; CHECK-NEXT:  %use = load i32, i32* %ptr.1, align 4
+; CHECK-NEXT:  %use = load i32, ptr %ptr.1, align 4
 ; CHECK-NEXT:  ; 2 = MemoryDef(4)
 ; CHECK-NEXT:  %c.2 = call i1 @cond(i32 %use)
-; CHECK-NEXT:  %ptr.10 = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i64 %sub
+; CHECK-NEXT:  %ptr.10 = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i64 %sub
 ; CHECK-NEXT:  ; 3 = MemoryDef(2)
-; CHECK-NEXT:  store i32 10, i32* %ptr.2, align 4
+; CHECK-NEXT:  store i32 10, ptr %ptr.2, align 4
 
 entry:
   %nodeStack = alloca [12 x i32], align 4
@@ -583,12 +575,12 @@ loop.header:                                       ; preds = %entry, %while.cond
   br i1 %cmp, label %cond.read, label %cleanup
 
 cond.read:                                        ; preds = %while.cond
-  %ptr.1 = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i64 %depth.1
-  %ptr.2 = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i64 %sub2
-  %use = load i32, i32* %ptr.1, align 4
+  %ptr.1 = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i64 %depth.1
+  %ptr.2 = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i64 %sub2
+  %use = load i32, ptr %ptr.1, align 4
   %c.2 = call i1 @cond(i32 %use)
-  %ptr.10 = getelementptr inbounds [12 x i32], [12 x i32]* %nodeStack, i32 0, i64 %sub
-  store i32 10, i32* %ptr.2, align 4
+  %ptr.10 = getelementptr inbounds [12 x i32], ptr %nodeStack, i32 0, i64 %sub
+  store i32 10, ptr %ptr.2, align 4
   br i1 %c.2, label %loop.header, label %cleanup
 
 cleanup:

diff  --git a/llvm/test/Analysis/MemorySSA/pr28880.ll b/llvm/test/Analysis/MemorySSA/pr28880.ll
index b7349655faf9e..57cdab7920404 100644
--- a/llvm/test/Analysis/MemorySSA/pr28880.ll
+++ b/llvm/test/Analysis/MemorySSA/pr28880.ll
@@ -16,12 +16,12 @@ bb1:                                              ; preds = %bb
 ; These accesses should not conflict.
 ; CHECK:  1 = MemoryDef(liveOnEntry)
 ; 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:   store double undef, double* @global, align 8
-  store double undef, double* @global, align 8
+; CHECK-NEXT:   store double undef, ptr @global, align 8
+  store double undef, ptr @global, align 8
 ; CHECK:  MemoryUse(liveOnEntry)
 ; MemoryUse(liveOnEntry)
-; CHECK-NEXT:   %tmp = load double, double* @global.1, align 8
-  %tmp = load double, double* @global.1, align 8
+; CHECK-NEXT:   %tmp = load double, ptr @global.1, align 8
+  %tmp = load double, ptr @global.1, align 8
   unreachable
 
 bb2:                                              ; preds = %bb
@@ -34,12 +34,12 @@ bb4:                                              ; preds = %bb3
 ; These accesses should conflict.
 ; CHECK:  2 = MemoryDef(liveOnEntry)
 ; 2 = MemoryDef(liveOnEntry)
-; CHECK-NEXT:   store double 0.000000e+00, double* @global.1, align 8
-  store double 0.000000e+00, double* @global.1, align 8
+; CHECK-NEXT:   store double 0.000000e+00, ptr @global.1, align 8
+  store double 0.000000e+00, ptr @global.1, align 8
 ; CHECK:  MemoryUse(2)
 ; MemoryUse(2)
-; CHECK-NEXT:   %tmp5 = load double, double* @global.1, align 8
-  %tmp5 = load double, double* @global.1, align 8
+; CHECK-NEXT:   %tmp5 = load double, ptr @global.1, align 8
+  %tmp5 = load double, ptr @global.1, align 8
   unreachable
 
 bb6:                                              ; preds = %bb3

diff  --git a/llvm/test/Analysis/MemorySSA/pr36883.ll b/llvm/test/Analysis/MemorySSA/pr36883.ll
index cfbcc4cdf1207..329026beb2895 100644
--- a/llvm/test/Analysis/MemorySSA/pr36883.ll
+++ b/llvm/test/Analysis/MemorySSA/pr36883.ll
@@ -5,20 +5,20 @@
 target triple = "armv7-dcg-linux-gnueabi"
 
 ; CHECK-LABEL: define <8 x i16> @vpx_idct32_32_neon
-define <8 x i16> @vpx_idct32_32_neon(i8* %p, <8 x i16> %v) {
+define <8 x i16> @vpx_idct32_32_neon(ptr %p, <8 x i16> %v) {
 entry:
 ; CHECK: MemoryUse(liveOnEntry)
-  %load1 = call <8 x i16> @llvm.arm.neon.vld1.v8i16.p0i8(i8* %p, i32 2) #4 ; load CSE replacement
+  %load1 = call <8 x i16> @llvm.arm.neon.vld1.v8i16.p0(ptr %p, i32 2) #4 ; load CSE replacement
 
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-  call void @llvm.arm.neon.vst1.p0i8.v8i16(i8* %p, <8 x i16> %v, i32 2) #4 ; clobber
+  call void @llvm.arm.neon.vst1.p0.v8i16(ptr %p, <8 x i16> %v, i32 2) #4 ; clobber
 
-  %p_next = getelementptr inbounds i8, i8* %p, i32 16
+  %p_next = getelementptr inbounds i8, ptr %p, i32 16
 ; CHECK: MemoryUse(liveOnEntry)
-  %load2 = call <8 x i16> @llvm.arm.neon.vld1.v8i16.p0i8(i8* %p_next, i32 2) #4 ; non-aliasing load needed to trigger bug
+  %load2 = call <8 x i16> @llvm.arm.neon.vld1.v8i16.p0(ptr %p_next, i32 2) #4 ; non-aliasing load needed to trigger bug
 
 ; CHECK: MemoryUse(1)
-  %load3 = call <8 x i16> @llvm.arm.neon.vld1.v8i16.p0i8(i8* %p, i32 2) #4 ; load CSE removed
+  %load3 = call <8 x i16> @llvm.arm.neon.vld1.v8i16.p0(ptr %p, i32 2) #4 ; load CSE removed
 
   %add = add <8 x i16> %load1, %load2
   %ret = add <8 x i16> %add, %load3
@@ -26,10 +26,10 @@ entry:
 }
 
 ; Function Attrs: argmemonly nounwind readonly
-declare <8 x i16> @llvm.arm.neon.vld1.v8i16.p0i8(i8*, i32) #2
+declare <8 x i16> @llvm.arm.neon.vld1.v8i16.p0(ptr, i32) #2
 
 ; Function Attrs: argmemonly nounwind
-declare void @llvm.arm.neon.vst1.p0i8.v8i16(i8*, <8 x i16>, i32) #1
+declare void @llvm.arm.neon.vst1.p0.v8i16(ptr, <8 x i16>, i32) #1
 
 attributes #1 = { argmemonly nounwind }
 attributes #2 = { argmemonly nounwind readonly }

diff  --git a/llvm/test/Analysis/MemorySSA/pr39197.ll b/llvm/test/Analysis/MemorySSA/pr39197.ll
index 068d4f6fc438f..2741509fdbf4e 100644
--- a/llvm/test/Analysis/MemorySSA/pr39197.ll
+++ b/llvm/test/Analysis/MemorySSA/pr39197.ll
@@ -16,40 +16,40 @@ define dso_local void @main() #0 {
 }
 
 ; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
 
 ; Function Attrs: nounwind
 define dso_local void @func_1() #0 {
-  %1 = alloca i32*, align 8
+  %1 = alloca ptr, align 8
   %2 = call signext i32 @func_2()
   %3 = icmp ne i32 %2, 0
   br i1 %3, label %4, label %9
 
 ; <label>:4:                                      ; preds = %0
-  %5 = load i16, i16* getelementptr inbounds ([5 x i16], [5 x i16]* @g_1042, i64 0, i64 0), align 2, !tbaa !1
+  %5 = load i16, ptr @g_1042, align 2, !tbaa !1
   %6 = zext i16 %5 to i64
-  %7 = load i64, i64* @1, align 8, !tbaa !5
+  %7 = load i64, ptr @1, align 8, !tbaa !5
   %8 = and i64 %7, %6
-  store i64 %8, i64* @1, align 8, !tbaa !5
-  call void @llvm.lifetime.end.p0i8(i64 4, i8* undef) #2
+  store i64 %8, ptr @1, align 8, !tbaa !5
+  call void @llvm.lifetime.end.p0(i64 4, ptr undef) #2
   unreachable
 
 ; <label>:9:                                      ; preds = %0
-  store i32* @0, i32** %1, align 8, !tbaa !7
+  store ptr @0, ptr %1, align 8, !tbaa !7
   br label %10
 
 ; <label>:10:                                     ; preds = %23, %9
-  %11 = load i64, i64* @1, align 8, !tbaa !5
+  %11 = load i64, ptr @1, align 8, !tbaa !5
   %12 = icmp eq i64 %11, 65535
   br i1 %12, label %13, label %14
 
 ; <label>:13:                                     ; preds = %10
-  store i32* null, i32** %1, align 8, !tbaa !7
+  store ptr null, ptr %1, align 8, !tbaa !7
   br label %14
 
 ; <label>:14:                                     ; preds = %13, %10
-  %15 = load i32*, i32** %1, align 8, !tbaa !7
-  %16 = load i32, i32* %15, align 4, !tbaa !9
+  %15 = load ptr, ptr %1, align 8, !tbaa !7
+  %16 = load i32, ptr %15, align 4, !tbaa !9
   %17 = trunc i32 %16 to i16
   %18 = call signext i16 @safe_sub_func_int16_t_s_s(i16 signext %17)
   %19 = sext i16 %18 to i32
@@ -57,7 +57,7 @@ define dso_local void @func_1() #0 {
   br i1 %20, label %23, label %21
 
 ; <label>:21:                                     ; preds = %14
-  %22 = load volatile i8, i8* null, align 1, !tbaa !11
+  %22 = load volatile i8, ptr null, align 1, !tbaa !11
   br label %23
 
 ; <label>:23:                                     ; preds = %21, %14
@@ -105,8 +105,8 @@ define dso_local void @safe_div_func_int32_t_s_s() #0 {
 ; Function Attrs: nounwind
 define dso_local signext i16 @safe_sub_func_int16_t_s_s(i16 signext) #0 {
   %2 = alloca i16, align 2
-  store i16 %0, i16* %2, align 2, !tbaa !1
-  %3 = load i16, i16* %2, align 2, !tbaa !1
+  store i16 %0, ptr %2, align 2, !tbaa !1
+  %3 = load i16, ptr %2, align 2, !tbaa !1
   %4 = sext i16 %3 to i32
   %5 = sub nsw i32 %4, 0
   %6 = trunc i32 %5 to i16

diff  --git a/llvm/test/Analysis/MemorySSA/pr40037.ll b/llvm/test/Analysis/MemorySSA/pr40037.ll
index 91dcb79541b31..6962eef4c3f10 100644
--- a/llvm/test/Analysis/MemorySSA/pr40037.ll
+++ b/llvm/test/Analysis/MemorySSA/pr40037.ll
@@ -19,7 +19,7 @@ bb7:                                              ; preds = %bb7.lr.ph, %bb7
   %tmp6 = icmp slt i8 94, 6
   br i1 %tmp6, label %bb7, label %bb3.bb9.preheader_crit_edge
 bb9:                                              ; preds = %bb21
-  store i16 %tmp27, i16* undef, align 2
+  store i16 %tmp27, ptr undef, align 2
   %tmp12 = icmp eq i16 %tmp27, 1
   br i1 %tmp12, label %bb28, label %bb13
 bb13:                                             ; preds = %bb9.preheader, %bb9

diff  --git a/llvm/test/Analysis/MemorySSA/pr40038.ll b/llvm/test/Analysis/MemorySSA/pr40038.ll
index 52a655f1420b0..efdcbe543c5d2 100644
--- a/llvm/test/Analysis/MemorySSA/pr40038.ll
+++ b/llvm/test/Analysis/MemorySSA/pr40038.ll
@@ -27,39 +27,39 @@ bb:
 define dso_local void @func_2() #0 {
 bb:
   %tmp = alloca i32, align 4
-  store i32 0, i32* @g_80, align 4, !tbaa !1
+  store i32 0, ptr @g_80, align 4, !tbaa !1
   br label %bb1
 
 bb1:                                              ; preds = %bb15, %bb
-  %tmp2 = load i32, i32* @g_80, align 4, !tbaa !1
+  %tmp2 = load i32, ptr @g_80, align 4, !tbaa !1
   %tmp3 = icmp sle i32 %tmp2, 6
   br i1 %tmp3, label %bb4, label %bb18
 
 bb4:                                              ; preds = %bb1
-  %tmp5 = load i32, i32* @g_1683, align 4, !tbaa !1
+  %tmp5 = load i32, ptr @g_1683, align 4, !tbaa !1
   %tmp6 = sext i32 %tmp5 to i64
-  %tmp7 = getelementptr inbounds [7 x i8], [7 x i8]* @0, i64 0, i64 %tmp6
-  %tmp8 = load i8, i8* %tmp7, align 1, !tbaa !5
+  %tmp7 = getelementptr inbounds [7 x i8], ptr @0, i64 0, i64 %tmp6
+  %tmp8 = load i8, ptr %tmp7, align 1, !tbaa !5
   %tmp9 = icmp ne i8 %tmp8, 0
   br i1 %tmp9, label %bb10, label %bb11
 
 bb10:                                             ; preds = %bb4
-  store i32 82, i32* %tmp, align 4
+  store i32 82, ptr %tmp, align 4
   br label %bb12
 
 bb11:                                             ; preds = %bb4
-  store i32 0, i32* %tmp, align 4
+  store i32 0, ptr %tmp, align 4
   br label %bb12
 
 bb12:                                             ; preds = %bb11, %bb10
-  %tmp13 = load i32, i32* %tmp, align 4
+  %tmp13 = load i32, ptr %tmp, align 4
   %tmp14 = icmp ult i32 %tmp13, 1
   br i1 %tmp14, label %bb15, label %bb18
 
 bb15:                                             ; preds = %bb12
-  %tmp16 = load i32, i32* @g_80, align 4, !tbaa !1
+  %tmp16 = load i32, ptr @g_80, align 4, !tbaa !1
   %tmp17 = add nsw i32 %tmp16, 1
-  store i32 %tmp17, i32* @g_80, align 4, !tbaa !1
+  store i32 %tmp17, ptr @g_80, align 4, !tbaa !1
   br label %bb1
 
 bb18:                                             ; preds = %bb12, %bb1

diff  --git a/llvm/test/Analysis/MemorySSA/pr40509.ll b/llvm/test/Analysis/MemorySSA/pr40509.ll
index 55a2ad88be54b..be927c8c605a2 100644
--- a/llvm/test/Analysis/MemorySSA/pr40509.ll
+++ b/llvm/test/Analysis/MemorySSA/pr40509.ll
@@ -20,14 +20,14 @@ target triple = "s390x-ibm-linux"
 declare dso_local void @safe_lshift_func_int16_t_s_s()
 declare dso_local i8 @safe_div_func_int8_t_s_s()
 
-define dso_local void @func_47(%0* %arg) {
+define dso_local void @func_47(ptr %arg) {
 bb:
   %tmp = alloca i32, align 4
   br label %bb1
 
 bb1:                                              ; preds = %bb12, %bb
-  %tmp2 = getelementptr inbounds %0, %0* %arg, i32 0, i32 3
-  store i16 undef, i16* %tmp2, align 1
+  %tmp2 = getelementptr inbounds %0, ptr %arg, i32 0, i32 3
+  store i16 undef, ptr %tmp2, align 1
   %tmp3 = call signext i8 @safe_div_func_int8_t_s_s()
   %tmp7 = icmp ne i8 %tmp3, 0
   br i1 %tmp7, label %bb8, label %bb10
@@ -38,13 +38,13 @@ bb8:                                              ; preds = %bb1
 
 bb10:                                             ; preds = %bb10, %bb1
   call void @safe_lshift_func_int16_t_s_s()
-  %tmp11 = getelementptr inbounds %0, %0* %arg, i32 0, i32 3
-  store i16 0, i16* %tmp11, align 1
-  store i8 0, i8* getelementptr inbounds (%0, %0* bitcast (<{ i64, i8, i64, i8, i8 }>* @g_101 to %0*), i32 0, i32 1), align 2
+  %tmp11 = getelementptr inbounds %0, ptr %arg, i32 0, i32 3
+  store i16 0, ptr %tmp11, align 1
+  store i8 0, ptr getelementptr inbounds (%0, ptr @g_101, i32 0, i32 1), align 2
   br label %bb10
 
 bb12:                                             ; preds = %bb8
-  store i16 0, i16* @g_54, align 2
+  store i16 0, ptr @g_54, align 2
   br label %bb1
 
 bb13:                                             ; preds = %bb8

diff  --git a/llvm/test/Analysis/MemorySSA/pr40749.ll b/llvm/test/Analysis/MemorySSA/pr40749.ll
index 461129eabb7c5..0d8b0240bbba7 100644
--- a/llvm/test/Analysis/MemorySSA/pr40749.ll
+++ b/llvm/test/Analysis/MemorySSA/pr40749.ll
@@ -12,7 +12,7 @@ target triple = "systemz-unknown"
 define internal fastcc void @foo1() unnamed_addr{
 ; CHECK-LABEL: @foo1()
 entry:
-  %.pre.pre = load i32, i32* @g_3, align 4
+  %.pre.pre = load i32, ptr @g_3, align 4
   br label %loop1
 
 loop1:
@@ -23,11 +23,11 @@ preheader:
   %indvars.iv = phi i64 [ 0, %loop1 ], [ %indvars.iv.next, %loop6 ]
   %phi18 = phi i32 [ %tmp0, %loop1 ], [ 0, %loop6 ]
   %phi87 = phi i32 [ 0, %loop1 ], [ %tmp7, %loop6 ]
-  %tmp1 = getelementptr inbounds [8 x i16], [8 x i16]* @g_82, i64 0, i64 %indvars.iv
-  %tmp2 = load i16, i16* %tmp1, align 2
+  %tmp1 = getelementptr inbounds [8 x i16], ptr @g_82, i64 0, i64 %indvars.iv
+  %tmp2 = load i16, ptr %tmp1, align 2
   %tmp3 = trunc i16 %tmp2 to i8
-  store i8 %tmp3, i8* @g_57, align 2
-  store i32 8, i32* @g_107, align 4
+  store i8 %tmp3, ptr @g_57, align 2
+  store i32 8, ptr @g_107, align 4
   %tmp4 = icmp eq i32 %.pre.pre, 0
   %spec.select = select i1 %tmp4, i32 %phi18, i32 14
   %tmp5 = trunc i64 %indvars.iv to i32
@@ -45,7 +45,7 @@ loop6:
 loop9:
   %phi8.lcssa = phi i32 [ %tmp5, %preheader ], [ %tmp7, %loop6 ]
   %tmp10 = trunc i32 %phi8.lcssa to i8
-  %tmp11 = tail call i16* @func_101(i16* getelementptr inbounds ([8 x i16], [8 x i16]* @g_82, i64 0, i64 6), i16* undef, i8 zeroext %tmp10)
+  %tmp11 = tail call ptr @func_101(ptr getelementptr inbounds ([8 x i16], ptr @g_82, i64 0, i64 6), ptr undef, i8 zeroext %tmp10)
   unreachable
 
 loopexit:
@@ -54,5 +54,5 @@ loopexit:
 
 }
 
-declare dso_local i16* @func_101(i16*, i16*, i8) local_unnamed_addr
+declare dso_local ptr @func_101(ptr, ptr, i8) local_unnamed_addr
 

diff  --git a/llvm/test/Analysis/MemorySSA/pr40749_2.ll b/llvm/test/Analysis/MemorySSA/pr40749_2.ll
index 3ebeb54963efc..666c9dce1c87f 100644
--- a/llvm/test/Analysis/MemorySSA/pr40749_2.ll
+++ b/llvm/test/Analysis/MemorySSA/pr40749_2.ll
@@ -13,16 +13,16 @@ bb:
   br label %bb10
 
 bb10:                                             ; preds = %bb81.loopexit, %bb
-  %tmp17 = load i16, i16* @g_92, align 2
+  %tmp17 = load i16, ptr @g_92, align 2
   %tmp18 = add i16 %tmp17, 1
-  store i16 %tmp18, i16* @g_92, align 2
+  store i16 %tmp18, ptr @g_92, align 2
   br label %bb19
 
 bb19:                                             ; preds = %bb42, %bb10
   br label %bb24.preheader
 
 bb24.preheader:                                   ; preds = %bb75, %bb19
-  store i32 0, i32* @g_993, align 4
+  store i32 0, ptr @g_993, align 4
   br i1 %tmp6.i, label %bb24.preheader.split.us, label %bb24.preheader.split
 
 bb24.preheader.split.us:                          ; preds = %bb24.preheader

diff  --git a/llvm/test/Analysis/MemorySSA/pr40754.ll b/llvm/test/Analysis/MemorySSA/pr40754.ll
index ce8956bfd1b17..1740588e034de 100644
--- a/llvm/test/Analysis/MemorySSA/pr40754.ll
+++ b/llvm/test/Analysis/MemorySSA/pr40754.ll
@@ -22,15 +22,15 @@ label2:                                      ; preds = %.critedge, %label1
 
 label3:                                      ; preds = %label5, %label2
   %storemerge = phi i32 [ 0, %label2 ], [ %tmp6, %label5 ]
-  store i32 %storemerge, i32* @g_185, align 4
+  store i32 %storemerge, ptr @g_185, align 4
   %tmp4 = icmp ult i32 %storemerge, 2
   br i1 %tmp4, label %label5, label %.thread.loopexit
 
 label5:                                      ; preds = %label3
   %tmp6 = add i32 %storemerge, 1
   %tmp7 = zext i32 %tmp6 to i64
-  %tmp8 = getelementptr [8 x [4 x [6 x i32]]], [8 x [4 x [6 x i32]]]* @g_120, i64 0, i64 undef, i64 %tmp7, i64 undef
-  %tmp9 = load i32, i32* %tmp8, align 4
+  %tmp8 = getelementptr [8 x [4 x [6 x i32]]], ptr @g_120, i64 0, i64 undef, i64 %tmp7, i64 undef
+  %tmp9 = load i32, ptr %tmp8, align 4
   %tmp10 = icmp eq i32 %tmp9, 0
   br i1 %tmp10, label %label3, label %label11
 
@@ -40,7 +40,7 @@ label11:                                     ; preds = %label5
   br i1 %tmp12, label %.critedge, label %.thread.loopexit3
 
 .critedge:                                        ; preds = %label11
-  store i16 0, i16* @g_329, align 2
+  store i16 0, ptr @g_329, align 2
   br label %label2
 
 .thread.loopexit:                                 ; preds = %label3

diff  --git a/llvm/test/Analysis/MemorySSA/pr41254.ll b/llvm/test/Analysis/MemorySSA/pr41254.ll
index debb18dc07790..064e5529ab82b 100644
--- a/llvm/test/Analysis/MemorySSA/pr41254.ll
+++ b/llvm/test/Analysis/MemorySSA/pr41254.ll
@@ -15,9 +15,9 @@ bb7:                                              ; preds = %bb
   br label %bb8
 
 bb8:                                              ; preds = %bb80, %bb7
-  %tmp10 = load i32, i32* getelementptr inbounds ({ i32, i16, i32, i8, i8, i32, i32 }, { i32, i16, i32, i8, i8, i32, i32 }* @g_328, i64 0, i32 5), align 4
+  %tmp10 = load i32, ptr getelementptr inbounds ({ i32, i16, i32, i8, i8, i32, i32 }, ptr @g_328, i64 0, i32 5), align 4
   %0 = or i32 %tmp10, 9
-  store i32 %0, i32* getelementptr inbounds ({ i32, i16, i32, i8, i8, i32, i32 }, { i32, i16, i32, i8, i8, i32, i32 }* @g_328, i64 0, i32 5), align 4
+  store i32 %0, ptr getelementptr inbounds ({ i32, i16, i32, i8, i8, i32, i32 }, ptr @g_328, i64 0, i32 5), align 4
   br label %bb41.preheader.preheader
 
 bb41.preheader.preheader:                         ; preds = %bb80.thread, %bb8

diff  --git a/llvm/test/Analysis/MemorySSA/pr41640.ll b/llvm/test/Analysis/MemorySSA/pr41640.ll
index 3f7947e83f784..6c407a518edcd 100644
--- a/llvm/test/Analysis/MemorySSA/pr41640.ll
+++ b/llvm/test/Analysis/MemorySSA/pr41640.ll
@@ -4,7 +4,7 @@ target triple = "s390x-ibm-linux"
 
 @g_248 = external dso_local local_unnamed_addr global i32, align 4
 @g_976 = external dso_local global i64, align 8
- at g_1087 = external dso_local global i32**, align 8
+ at g_1087 = external dso_local global ptr, align 8
 
 ; CHECK-LABEL: @f1()
 ; CHECK: 5 = MemoryPhi(
@@ -45,7 +45,7 @@ label2:                                  ; preds = %._crit_edge5.i.us, %thread-p
   br label %.lr.ph8.i.us
 
 .lr.ph8.i.us:                                     ; preds = %.lr.ph8.i.us, %.lr.ph8.i.us.preheader
-  %tmp3 = load volatile i64, i64* @g_976, align 8
+  %tmp3 = load volatile i64, ptr @g_976, align 8
   br i1 undef, label %.lr.ph8.i.us, label %._crit_edge9.i.us
 
 ._crit_edge9.i.us:                                ; preds = %.lr.ph8.i.us
@@ -85,16 +85,16 @@ label6:                                      ; preds = %label6, %.lr.ph.i
   br label %.critedge1.i
 
 .critedge1.i:                                     ; preds = %._crit_edge5.i, %thread-pre-split.i
-  %tmp7 = load i32, i32* @g_248, align 4
+  %tmp7 = load i32, ptr @g_248, align 4
   %tmp8 = xor i32 %tmp7, 55987
-  store i32 %tmp8, i32* @g_248, align 4
+  store i32 %tmp8, ptr @g_248, align 4
   br i1 undef, label %thread-pre-split.i, label %f9.exit.loopexit
 
 f9.exit.loopexit:                                 ; preds = %.critedge1.i
   br label %f9.exit
 
 f9.exit:                                          ; preds = %f9.exit.loopexit, %.critedge1.i.us, %label4
-  %tmp9 = load volatile i32**, i32*** @g_1087, align 8
+  %tmp9 = load volatile ptr, ptr @g_1087, align 8
   ret void
 }
 

diff  --git a/llvm/test/Analysis/MemorySSA/pr41853.ll b/llvm/test/Analysis/MemorySSA/pr41853.ll
index d28b2c155aad7..5cfe4e431b00d 100644
--- a/llvm/test/Analysis/MemorySSA/pr41853.ll
+++ b/llvm/test/Analysis/MemorySSA/pr41853.ll
@@ -7,7 +7,7 @@ define void @func() {
   br i1 undef, label %bb5, label %bb3
 
 bb5:                                              ; preds = %bb5, %0
-  store i16 undef, i16* undef
+  store i16 undef, ptr undef
   br i1 undef, label %bb5, label %bb3
 
 bb3:                                              ; preds = %bb5, %0

diff  --git a/llvm/test/Analysis/MemorySSA/pr42294.ll b/llvm/test/Analysis/MemorySSA/pr42294.ll
index dc77b6238caf0..6bc06cd377c25 100644
--- a/llvm/test/Analysis/MemorySSA/pr42294.ll
+++ b/llvm/test/Analysis/MemorySSA/pr42294.ll
@@ -2,7 +2,7 @@
 ; RUN: opt -loop-rotate -licm %s -disable-output -debug-only=licm 2>&1 | FileCheck %s -check-prefix=LICM
 ; RUN: opt -loop-rotate -licm %s -S  | FileCheck %s
 
-; LICM-NOT: LICM sinking instruction:   %.pre = load i8, i8* %arrayidx.phi.trans.insert
+; LICM-NOT: LICM sinking instruction:   %.pre = load i8, ptr %arrayidx.phi.trans.insert
 
 ; CHECK-LABEL: @fn1
 ; CHECK-LABEL: entry:
@@ -28,19 +28,19 @@ entry:
 for.body:                                         ; preds = %for.body.for.body_crit_edge, %entry
   %0 = phi i64 [ 0, %entry ], [ %phitmp, %for.body.for.body_crit_edge ]
   %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body.for.body_crit_edge ]
-  %arrayidx = getelementptr inbounds [9 x i8], [9 x i8]* %g, i64 0, i64 %indvars.iv
-  store i8 2, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [9 x i8], ptr %g, i64 0, i64 %indvars.iv
+  store i8 2, ptr %arrayidx, align 1
   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
   br i1 undef, label %for.end18, label %for.body.for.body_crit_edge
 
 for.body.for.body_crit_edge:                      ; preds = %for.body
-  %arrayidx.phi.trans.insert = getelementptr inbounds [9 x i8], [9 x i8]* %g, i64 0, i64 %indvars.iv.next
-  %.pre = load i8, i8* %arrayidx.phi.trans.insert, align 1
+  %arrayidx.phi.trans.insert = getelementptr inbounds [9 x i8], ptr %g, i64 0, i64 %indvars.iv.next
+  %.pre = load i8, ptr %arrayidx.phi.trans.insert, align 1
   %phitmp = zext i8 %.pre to i64
   br label %for.body
 
 for.end18:                                        ; preds = %for.body
-  store i64 %0, i64* undef, align 8
+  store i64 %0, ptr undef, align 8
   ret void
 }
 

diff  --git a/llvm/test/Analysis/MemorySSA/pr42940.ll b/llvm/test/Analysis/MemorySSA/pr42940.ll
index fab8c48a2b456..3c988f976ed25 100644
--- a/llvm/test/Analysis/MemorySSA/pr42940.ll
+++ b/llvm/test/Analysis/MemorySSA/pr42940.ll
@@ -9,7 +9,7 @@ target triple = "s390x-ibm-linux"
 ; CHECK-LABEL: @f1()
 define void @f1() {
 entry:
-  store i16 undef, i16* @g_77, align 2
+  store i16 undef, ptr @g_77, align 2
   br label %loop_pre
 
 unreachablelabel: ; No predecessors
@@ -19,11 +19,11 @@ loop_pre:
   br label %for.cond.header
 
 for.cond.header:
-  store i32 0, i32* undef, align 4
+  store i32 0, ptr undef, align 4
   br i1 undef, label %for.body, label %for.end
 
 for.body:
-  %tmp1 = load volatile i16, i16* undef, align 2
+  %tmp1 = load volatile i16, ptr undef, align 2
   br label %for.end
 
 for.end:
@@ -44,7 +44,7 @@ for.header.first:
   br label %for.body.first
 
 for.body.first:
-  store i32 0, i32* @g_159, align 4
+  store i32 0, ptr @g_159, align 4
   br i1 undef, label %for.body.first, label %for.end.first
 
 for.end.first:
@@ -60,7 +60,7 @@ for.pre:
   br label %for.header.second
 
 for.header.second:
-  store i32 undef, i32* undef, align 4
+  store i32 undef, ptr undef, align 4
   br label %for.header.second
 }
 
@@ -73,7 +73,7 @@ entry:
   br label %for.preheader
 
 for.preheader:
-  store volatile i8 undef, i8* @g_271, align 2
+  store volatile i8 undef, ptr @g_271, align 2
   br i1 undef, label %for.preheader, label %for.end
 
 for.end:
@@ -86,11 +86,11 @@ lbl_1058.i:
   br label %for.cond3.preheader.i
 
 for.cond3.preheader.i:
-  %tmp1 = load i16, i16* getelementptr inbounds ([9 x i16], [9 x i16]* @g_427, i64 0, i64 2), align 2
+  %tmp1 = load i16, ptr getelementptr inbounds ([9 x i16], ptr @g_427, i64 0, i64 2), align 2
   %conv620.i129 = zext i16 %tmp1 to i32
   %cmp621.i130 = icmp ugt i32 undef, %conv620.i129
   %conv622.i131 = zext i1 %cmp621.i130 to i32
-  store i32 %conv622.i131, i32* undef, align 4
+  store i32 %conv622.i131, ptr undef, align 4
   br i1 undef, label %func.exit, label %for.cond3.preheader.i
 
 func.exit:
@@ -107,25 +107,25 @@ entry:
   br label %for.cond8.preheader
 
 for.cond8.preheader:
-  store i32 0, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @g_6, i64 0, i64 2), align 4
+  store i32 0, ptr getelementptr inbounds ([3 x i32], ptr @g_6, i64 0, i64 2), align 4
   br i1 undef, label %if.end, label %for.cond8.preheader
 
 if.end:
   br i1 undef, label %cleanup1270, label %for.cond504.preheader
 
 for.cond504.preheader:
-  store i64 undef, i64* @g_244, align 8
+  store i64 undef, ptr @g_244, align 8
   br label %cleanup1270
 
 for.cond559.preheader:
-  store i64 undef, i64* @g_1164, align 8
+  store i64 undef, ptr @g_1164, align 8
   br i1 undef, label %for.cond559.preheader, label %cleanup1270
 
 cleanup1270:
   ret void
 }
 
- at g_1504 = external dso_local local_unnamed_addr global i16****, align 8
+ at g_1504 = external dso_local local_unnamed_addr global ptr, align 8
 
 define void @f5() {
 bb:
@@ -166,8 +166,8 @@ bb71.thread:                                      ; preds = %bb25
   br label %bb92
 
 bb77:                                             ; preds = %bb12
-  %tmp78 = load i16****, i16***** @g_1504, align 8
-  %tmp79 = load volatile i16***, i16**** %tmp78, align 8
+  %tmp78 = load ptr, ptr @g_1504, align 8
+  %tmp79 = load volatile ptr, ptr %tmp78, align 8
   br i1 undef, label %bb91, label %bb12.1
 
 bb91:                                             ; preds = %bb77.1, %bb77

diff  --git a/llvm/test/Analysis/MemorySSA/pr43044.ll b/llvm/test/Analysis/MemorySSA/pr43044.ll
index cf1a759e0b6d3..3b89b1936605f 100644
--- a/llvm/test/Analysis/MemorySSA/pr43044.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43044.ll
@@ -4,7 +4,7 @@
 target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
 target triple = "s390x-ibm-linux"
 
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
 
 ; CHECK-LABEL: @func_42()
 define void @func_42() {
@@ -20,8 +20,8 @@ for.cond1050:                                     ; preds = %for.cond1050.loopex
   br i1 %cmp1051, label %for.cond1055.preheader, label %cleanup1400.loopexit1
 
 for.cond1055.preheader:                           ; preds = %for.cond1050
-  store i64 0, i64* null, align 8
-  %0 = load i64, i64* null, align 8
+  store i64 0, ptr null, align 8
+  %0 = load i64, ptr null, align 8
   %tobool1383 = icmp eq i64 %0, 0
   br i1 %tobool1383, label %for.cond1055.preheader.cleanup1400.loopexit.split_crit_edge, label %for.cond1055.preheader.for.cond1055.preheader.split_crit_edge
 
@@ -47,6 +47,6 @@ cleanup1400.loopexit1:                            ; preds = %for.cond1050
   br label %cleanup1400
 
 cleanup1400:                                      ; preds = %cleanup1400.loopexit1, %cleanup1400.loopexit.split
-  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull undef)
+  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull undef)
   unreachable
 }

diff  --git a/llvm/test/Analysis/MemorySSA/pr43317.ll b/llvm/test/Analysis/MemorySSA/pr43317.ll
index eaf3bc9808fce..a95079e8828b4 100644
--- a/llvm/test/Analysis/MemorySSA/pr43317.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43317.ll
@@ -10,7 +10,7 @@
 ; CHECK-NOT: 7 = MemoryPhi(
 define dso_local void @main() {
 entry:
-  store i32 undef, i32* @v_335, align 1
+  store i32 undef, ptr @v_335, align 1
   br i1 undef, label %gate, label %exit
 
 nopredentry1:                                     ; No predecessors!
@@ -26,10 +26,10 @@ preinfiniteloop:                                  ; preds = %gate, %nopredentry1
   br label %infiniteloop
 
 infiniteloop:                                     ; preds = %infiniteloop, %preinfiniteloop
-  store i16 undef, i16* @v_295, align 1
+  store i16 undef, ptr @v_295, align 1
   br label %infiniteloop
 
 exit:                                             ; preds = %gate, %entry
-  store i64 undef, i64* @v_274, align 1
+  store i64 undef, ptr @v_274, align 1
   ret void
 }

diff  --git a/llvm/test/Analysis/MemorySSA/pr43320.ll b/llvm/test/Analysis/MemorySSA/pr43320.ll
index 0527469c1da7d..cc523428e5ce9 100644
--- a/llvm/test/Analysis/MemorySSA/pr43320.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43320.ll
@@ -10,9 +10,9 @@ entry:
   br label %g
 
 g:                                                ; preds = %cleanup, %entry
-  %0 = load i32, i32* null, align 4
+  %0 = load i32, ptr null, align 4
   %and = and i32 %0, undef
-  store i32 %and, i32* null, align 4
+  store i32 %and, ptr null, align 4
   br i1 undef, label %if.end8, label %if.then
 
 if.then:                                          ; preds = %g

diff  --git a/llvm/test/Analysis/MemorySSA/pr43426.ll b/llvm/test/Analysis/MemorySSA/pr43426.ll
index 3e0dd5bafc47b..f318489769a1d 100644
--- a/llvm/test/Analysis/MemorySSA/pr43426.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43426.ll
@@ -8,7 +8,7 @@ entry:
   br label %header
 
 header:
-  store i32 1, i32* null, align 4
+  store i32 1, ptr null, align 4
   br i1 true, label %cleanup53, label %body
 
 body:
@@ -24,7 +24,7 @@ deadblock:
   br i1 undef, label %unreachable, label %deadblock
 
 cleanup53:
-  %val = load i32, i32* null, align 4
+  %val = load i32, ptr null, align 4
   %cmpv = icmp eq i32 %val, 0
   br i1 %cmpv, label %cleanup63, label %latch
 

diff  --git a/llvm/test/Analysis/MemorySSA/pr43427.ll b/llvm/test/Analysis/MemorySSA/pr43427.ll
index e7b77a7601818..6b9ac5c5288f1 100644
--- a/llvm/test/Analysis/MemorySSA/pr43427.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43427.ll
@@ -20,7 +20,7 @@
 
 ; CHECK: cleanup:
 ; CHECK-NEXT: MemoryUse([[NO7]])
-; CHECK-NEXT:  %cleanup.dest = load i32, i32* undef, align 1
+; CHECK-NEXT:  %cleanup.dest = load i32, ptr undef, align 1
 
 ; CHECK: lbl1.backedge:
 ; CHECK-NEXT:  [[NO9]] = MemoryPhi({cleanup,[[NO7]]},{if.else,2})
@@ -28,9 +28,9 @@
 
 ; CHECK: cleanup.cont:
 ; CHECK-NEXT: ; [[NO6:.*]] = MemoryDef([[NO7]])
-; CHECK-NEXT:   store i16 undef, i16* %e, align 1
+; CHECK-NEXT:   store i16 undef, ptr %e, align 1
 ; CHECK-NEXT:  3 = MemoryDef([[NO6]])
-; CHECK-NEXT:   call void @llvm.lifetime.end.p0i8(i64 1, i8* null)
+; CHECK-NEXT:   call void @llvm.lifetime.end.p0(i64 1, ptr null)
 
 define void @f() {
 entry:
@@ -38,7 +38,7 @@ entry:
   br label %lbl1
 
 lbl1:                                             ; preds = %if.else, %cleanup, %entry
-  store i16 undef, i16* %e, align 1
+  store i16 undef, ptr %e, align 1
   call void @g()
   br i1 undef, label %for.end, label %if.else
 
@@ -52,12 +52,12 @@ lbl3:                                             ; preds = %lbl2, %for.end
   br i1 undef, label %lbl2, label %cleanup
 
 cleanup:                                          ; preds = %lbl3
-  %cleanup.dest = load i32, i32* undef, align 1
+  %cleanup.dest = load i32, ptr undef, align 1
   %switch = icmp ult i32 %cleanup.dest, 1
   br i1 %switch, label %cleanup.cont, label %lbl1
 
 cleanup.cont:                                     ; preds = %cleanup
-  call void @llvm.lifetime.end.p0i8(i64 1, i8* null)
+  call void @llvm.lifetime.end.p0(i64 1, ptr null)
   ret void
 
 if.else:                                          ; preds = %lbl1
@@ -67,4 +67,4 @@ if.else:                                          ; preds = %lbl1
 declare void @g()
 
 ; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)

diff  --git a/llvm/test/Analysis/MemorySSA/pr43438.ll b/llvm/test/Analysis/MemorySSA/pr43438.ll
index e421048ffcecc..30f6c2f2fadbb 100644
--- a/llvm/test/Analysis/MemorySSA/pr43438.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43438.ll
@@ -6,7 +6,7 @@ target triple = "x86_64-unknown-linux-gnu"
 ; CHECK-NOT: 7 = MemoryPhi(
 @v_67 = external dso_local global i32, align 1
 @v_76 = external dso_local global i16, align 1
- at v_86 = external dso_local global i16 *, align 1
+ at v_86 = external dso_local global ptr, align 1
 
 define dso_local void @main() {
 entry:
@@ -17,7 +17,7 @@ for.cond:                                         ; preds = %for.body, %entry
   br i1 undef, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond
-  store i16 undef, i16* %v_59, align 2
+  store i16 undef, ptr %v_59, align 2
   br label %for.cond
 
 for.end:                                          ; preds = %for.cond
@@ -33,11 +33,11 @@ land.lhs.true87:                                  ; preds = %cond.end82
   br i1 undef, label %if.then88, label %if.else568
 
 if.then88:                                        ; preds = %land.lhs.true87
-  store i16 * @v_76, i16 ** @v_86, align 1
+  store ptr @v_76, ptr @v_86, align 1
   br label %if.end569
 
 if.else568:                                       ; preds = %land.lhs.true87, %cond.end82, %for.end
-  store volatile i32 undef, i32 * @v_67, align 1
+  store volatile i32 undef, ptr @v_67, align 1
   br label %if.end569
 
 if.end569:                                        ; preds = %if.else568, %if.then88
@@ -57,8 +57,8 @@ entry:
   br label %lbl1
 
 lbl1:                                             ; preds = %if.else, %for.end5, %entry
-  store i16 undef, i16* %e, align 1
-  %0 = load i16, i16* %e, align 1
+  store i16 undef, ptr %e, align 1
+  %0 = load i16, ptr %e, align 1
   %call = call i16 @g(i16 %0)
   br i1 undef, label %for.end, label %if.else
 
@@ -87,7 +87,7 @@ if.else:                                          ; preds = %lbl1
   ]
 
 if.end12:                                         ; preds = %cleanup.cont11s, %cleanup.cont
-  call void @llvm.lifetime.end.p0i8(i64 1, i8* undef)
+  call void @llvm.lifetime.end.p0(i64 1, ptr undef)
   ret void
 
 unreachable:                                      ; preds = %if.else, %for.end5
@@ -97,4 +97,4 @@ unreachable:                                      ; preds = %if.else, %for.end5
 declare i16 @g(i16)
 
 ; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)

diff  --git a/llvm/test/Analysis/MemorySSA/pr43493.ll b/llvm/test/Analysis/MemorySSA/pr43493.ll
index 68b0d3e493293..fb622bdd26605 100644
--- a/llvm/test/Analysis/MemorySSA/pr43493.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43493.ll
@@ -13,7 +13,7 @@ for.cond1704:                                     ; preds = %for.cond1704.prehea
   br i1 false, label %for.body1707, label %return.loopexit
 
 for.body1707:                                     ; preds = %for.cond1704
-  store i32 1712, i32* undef, align 1
+  store i32 1712, ptr undef, align 1
   br label %for.cond1704
 
 for.body1102:                                     ; preds = %for.body1102

diff  --git a/llvm/test/Analysis/MemorySSA/pr43540.ll b/llvm/test/Analysis/MemorySSA/pr43540.ll
index a75b6d64be0db..36444b8fa4186 100644
--- a/llvm/test/Analysis/MemorySSA/pr43540.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43540.ll
@@ -6,7 +6,7 @@
 ; CHECK: for.cond:
 ; CHECK-NOT: store
 ; CHECK: for.body:
-; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64
+; CHECK: call void @llvm.memcpy.p0.p0.i64
 ; CHECK: store
 define void @foo() {
 entry:
@@ -18,8 +18,8 @@ for.cond:                                         ; preds = %for.body, %entry
   br i1 %cmp, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* @v_1, i8 * @v_2, i64 1, i1 false)
-  store i8 1, i8 * @v_2, align 1
+  call void @llvm.memcpy.p0.p0.i64(ptr @v_1, ptr @v_2, i64 1, i1 false)
+  store i8 1, ptr @v_2, align 1
   %inc = add nsw i16 %0, 1
   br label %for.cond
 
@@ -28,7 +28,7 @@ for.end:                                          ; preds = %for.cond
 }
 
 ; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8 * noalias nocapture readonly, i64, i1 immarg) #2
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
 
 attributes #2 = { argmemonly nounwind willreturn }
 

diff  --git a/llvm/test/Analysis/MemorySSA/pr43541.ll b/llvm/test/Analysis/MemorySSA/pr43541.ll
index 9cc9b6fe5ff2e..32614123d4d01 100644
--- a/llvm/test/Analysis/MemorySSA/pr43541.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43541.ll
@@ -29,11 +29,11 @@ if.then23:                                        ; preds = %for.body12
   br i1 undef, label %if.then24, label %if.else
 
 if.then24:                                        ; preds = %if.then23
-  %0 = load %struct.job_pool.6.7*, %struct.job_pool.6.7** undef, align 8
+  %0 = load ptr, ptr undef, align 8
   br label %if.end40
 
 if.else:                                          ; preds = %if.then23
-  %1 = load %struct.job_pool.6.7*, %struct.job_pool.6.7** undef, align 8
+  %1 = load ptr, ptr undef, align 8
   br label %if.end40
 
 if.end40:                                         ; preds = %if.else, %if.then24

diff  --git a/llvm/test/Analysis/MemorySSA/pr43569.ll b/llvm/test/Analysis/MemorySSA/pr43569.ll
index 0d7ed52e8035e..02d074ef2aeb9 100644
--- a/llvm/test/Analysis/MemorySSA/pr43569.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43569.ll
@@ -12,29 +12,29 @@ target triple = "x86_64-unknown-linux-gnu"
 ; Function Attrs: nounwind uwtable
 define dso_local void @c() #0 {
 entry:
-  call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_c, i32 0, i32 0), i64 68269137, i32 3, i32 0)
+  call void @llvm.instrprof.increment(ptr @__profn_c, i64 68269137, i32 3, i32 0)
   br label %for.cond
 
 for.cond:                                         ; preds = %for.end, %entry
-  call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_c, i32 0, i32 0), i64 68269137, i32 3, i32 1)
-  store i32 0, i32* @b, align 4
+  call void @llvm.instrprof.increment(ptr @__profn_c, i64 68269137, i32 3, i32 1)
+  store i32 0, ptr @b, align 4
   br label %for.cond1
 
 for.cond1:                                        ; preds = %for.inc, %for.cond
-  %0 = load i32, i32* @b, align 4
-  %1 = load i16, i16* @a, align 2
+  %0 = load i32, ptr @b, align 4
+  %1 = load i16, ptr @a, align 2
   %conv = sext i16 %1 to i32
   %cmp = icmp slt i32 %0, %conv
   br i1 %cmp, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond1
-  call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_c, i32 0, i32 0), i64 68269137, i32 3, i32 2)
+  call void @llvm.instrprof.increment(ptr @__profn_c, i64 68269137, i32 3, i32 2)
   br label %for.inc
 
 for.inc:                                          ; preds = %for.body
-  %2 = load i32, i32* @b, align 4
+  %2 = load i32, ptr @b, align 4
   %inc = add nsw i32 %2, 1
-  store i32 %inc, i32* @b, align 4
+  store i32 %inc, ptr @b, align 4
   br label %for.cond1
 
 for.end:                                          ; preds = %for.cond1
@@ -42,7 +42,7 @@ for.end:                                          ; preds = %for.cond1
 }
 
 ; Function Attrs: nounwind
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #1
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #1
 
 attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
 attributes #1 = { nounwind }

diff  --git a/llvm/test/Analysis/MemorySSA/pr43641.ll b/llvm/test/Analysis/MemorySSA/pr43641.ll
index 5e0dc73a0fd30..4629bc6a47b7a 100644
--- a/llvm/test/Analysis/MemorySSA/pr43641.ll
+++ b/llvm/test/Analysis/MemorySSA/pr43641.ll
@@ -11,7 +11,7 @@ while.body.lr.ph:                                 ; preds = %entry
   br label %while.body
 
 while.body:                                       ; preds = %while.body, %while.body.lr.ph
-  %call = tail call signext i32 bitcast (i32 (...)* @e to i32 ()*)()
+  %call = tail call signext i32 @e()
   %0 = and i1 %tobool1, undef
   br i1 %0, label %while.body, label %while.end
 

diff  --git a/llvm/test/Analysis/MemorySSA/pr44027.ll b/llvm/test/Analysis/MemorySSA/pr44027.ll
index 3c0f9266ca230..6b8b304ca84e9 100644
--- a/llvm/test/Analysis/MemorySSA/pr44027.ll
+++ b/llvm/test/Analysis/MemorySSA/pr44027.ll
@@ -9,19 +9,19 @@ declare i32 @wobble(...)
 declare void @spam() align 2
 
 ; CHECK-LABEL: @f()
-define void @f() personality i8* bitcast (i32 (...)* @wobble to i8*) {
+define void @f() personality ptr @wobble {
 bb:
-  %tmp = alloca i32*, align 8
+  %tmp = alloca ptr, align 8
   invoke void @spam()
           to label %bb16 unwind label %bb23
 
 bb16:                                             ; preds = %bb
-  %tmp17 = load i32*, i32** %tmp, align 8
-  %tmp18 = load i32*, i32** %tmp, align 8
+  %tmp17 = load ptr, ptr %tmp, align 8
+  %tmp18 = load ptr, ptr %tmp, align 8
   unreachable
 
 bb23:                                             ; preds = %bb
-  %tmp24 = landingpad { i8*, i32 }
+  %tmp24 = landingpad { ptr, i32 }
           cleanup
   unreachable
 }

diff  --git a/llvm/test/Analysis/MemorySSA/pr44029.ll b/llvm/test/Analysis/MemorySSA/pr44029.ll
index e3aab4d0cef68..f8dd427b535c7 100644
--- a/llvm/test/Analysis/MemorySSA/pr44029.ll
+++ b/llvm/test/Analysis/MemorySSA/pr44029.ll
@@ -9,7 +9,7 @@ declare i32 @eggs(...)
 declare void @spam()
 
 ; CHECK-LABEL: @f()
-define void @f() personality i8* bitcast (i32 (...)* @eggs to i8*) {
+define void @f() personality ptr @eggs {
 bb:
   invoke void @spam()
           to label %bb2 unwind label %bb4
@@ -19,12 +19,12 @@ bb2:                                              ; preds = %bb
           to label %bb8 unwind label %bb5
 
 bb4:                                              ; preds = %bb
-  %tmp = landingpad { i8*, i32 }
+  %tmp = landingpad { ptr, i32 }
           cleanup
-  resume { i8*, i32 } undef
+  resume { ptr, i32 } undef
 
 bb5:                                              ; preds = %bb2
-  %tmp6 = landingpad { i8*, i32 }
+  %tmp6 = landingpad { ptr, i32 }
           cleanup
   unreachable
 
@@ -47,17 +47,17 @@ bb13:                                             ; preds = %bb12
   br label %bb8
 
 bb20:                                             ; preds = %bb10
-  %tmp21 = landingpad { i8*, i32 }
+  %tmp21 = landingpad { ptr, i32 }
           cleanup
   unreachable
 
 bb22:                                             ; preds = %bb11
-  %tmp23 = landingpad { i8*, i32 }
+  %tmp23 = landingpad { ptr, i32 }
           cleanup
   unreachable
 
 bb24:                                             ; preds = %bb12
-  %tmp25 = landingpad { i8*, i32 }
+  %tmp25 = landingpad { ptr, i32 }
           cleanup
   unreachable
 }

diff  --git a/llvm/test/Analysis/MemorySSA/pr45927.ll b/llvm/test/Analysis/MemorySSA/pr45927.ll
index 941a78f68ccb0..a6a586feabdaa 100644
--- a/llvm/test/Analysis/MemorySSA/pr45927.ll
+++ b/llvm/test/Analysis/MemorySSA/pr45927.ll
@@ -9,7 +9,7 @@
 ; CHECK: entry:
 ; CHECK-NEXT: %res.addr.i = alloca i16
 ; CHECK-NEXT: ; MemoryUse(liveOnEntry)
-; CHECK-NEXT: %c.promoted = load i16, i16* @c
+; CHECK-NEXT: %c.promoted = load i16, ptr @c
 ; CHECK-NEXT: br label %for.cond.i
 
 ; CHECK: for.cond.i:
@@ -21,11 +21,11 @@
 ; CHECK: f.exit.thread.i:
 ; CHECK-NEXT: %inc.i.lcssa = phi i16 [ %inc.i, %for.cond.i ]
 ; CHECK-NEXT: ; [[NO6:.*]] = MemoryDef([[NO5]])
-; CHECK-NEXT: store i16 %inc.i.lcssa, i16* @c, align 1
+; CHECK-NEXT: store i16 %inc.i.lcssa, ptr @c, align 1
 ; CHECK-NEXT: ; [[NO2:.*]] = MemoryDef([[NO6]])
-; CHECK-NEXT: store i16 1, i16* @a, align 1
+; CHECK-NEXT: store i16 1, ptr @a, align 1
 ; CHECK-NEXT: ; MemoryUse([[NO2]])
-; CHECK-NEXT: %tmp2 = load i16, i16* @c, align 1
+; CHECK-NEXT: %tmp2 = load i16, ptr @c, align 1
 ; CHECK-NEXT: br label %g.exit
 
 ; CHECK: f.exit.i
@@ -34,15 +34,15 @@
 ; CHECK: g.exit.loopexit:
 ; CHECK-NEXT: %inc.i.lcssa2 = phi i16 [ %inc.i, %f.exit.i ]
 ; CHECK-NEXT: ; [[NO7:.*]] = MemoryDef([[NO5]])
-; CHECK-NEXT: store i16 %inc.i.lcssa2, i16* @c, align 1
+; CHECK-NEXT: store i16 %inc.i.lcssa2, ptr @c, align 1
 ; CHECK-NEXT: br label %g.exit
 
 ; CHECK: g.exit
 ; CHECK-NEXT: ; [[NO4:.*]] = MemoryPhi({f.exit.thread.i,[[NO2]]},{g.exit.loopexit,[[NO7]]})
 ; CHECK-NEXT: ; MemoryUse([[NO4]])
-; CHECK-NEXT:  %tmp1 = load i16, i16* @c, align 1
+; CHECK-NEXT:  %tmp1 = load i16, ptr @c, align 1
 ; CHECK-NEXT: ; [[NO3:.*]] = MemoryDef([[NO4]])
-; CHECK-NEXT:  store i16 %tmp1, i16* %res.addr.i, align 1
+; CHECK-NEXT:  store i16 %tmp1, ptr %res.addr.i, align 1
 ; CHECK-NEXT:  ret void
 
 define dso_local void @main() {
@@ -51,22 +51,22 @@ entry:
   br label %for.cond.i
 
 for.cond.i:                                       ; preds = %f.exit.i, %entry
-  %tmp0 = load i16, i16* @c, align 1
+  %tmp0 = load i16, ptr @c, align 1
   %inc.i = add nsw i16 %tmp0, 1
-  store i16 %inc.i, i16* @c, align 1
+  store i16 %inc.i, ptr @c, align 1
   br i1 false, label %f.exit.thread.i, label %f.exit.i
 
 f.exit.thread.i:                                  ; preds = %for.cond.i
-  store i16 1, i16* @a, align 1
-  %tmp2 = load i16, i16* @c, align 1
+  store i16 1, ptr @a, align 1
+  %tmp2 = load i16, ptr @c, align 1
   br label %g.exit
 
 f.exit.i:                                         ; preds = %for.cond.i
   br i1 false, label %g.exit, label %for.cond.i
 
 g.exit:                                           ; preds = %f.exit.i, %f.exit.thread.i
-  %tmp1 = load i16, i16* @c, align 1
-  store i16 %tmp1, i16* %res.addr.i, align 1
+  %tmp1 = load i16, ptr @c, align 1
+  store i16 %tmp1, ptr %res.addr.i, align 1
   ret void
 }
 

diff  --git a/llvm/test/Analysis/MemorySSA/pr45976.ll b/llvm/test/Analysis/MemorySSA/pr45976.ll
index 306a46dc2609a..52b27921e6ad3 100644
--- a/llvm/test/Analysis/MemorySSA/pr45976.ll
+++ b/llvm/test/Analysis/MemorySSA/pr45976.ll
@@ -26,7 +26,7 @@ bb49.us.i.us:                                     ; preds = %bb49.us.preheader.i
   br label %bb18.i
 
 bb78.loopexit3.i:                                 ; preds = %bb49.preheader.i
-  store i64 0, i64* @global1, align 8
+  store i64 0, ptr @global1, align 8
   br label %.exit
 
 .exit.loopexit:                                   ; preds = %bb18.i
@@ -39,8 +39,8 @@ bb4.i.us.preheader:                               ; preds = %.exit
   br label %bb4.i.us
 
 bb4.i.us:                                         ; preds = %bb4.i.us, %bb4.i.us.preheader
-  store i32 0, i32* undef, align 4
-  store i32 undef, i32* getelementptr inbounds ([3 x [8 x [8 x { i32, i64, i8, i8, i16, i32 }]]], [3 x [8 x [8 x { i32, i64, i8, i8, i16, i32 }]]]* @global2, i64 0, i64 0, i64 6, i64 6, i32 0), align 8
+  store i32 0, ptr undef, align 4
+  store i32 undef, ptr getelementptr inbounds ([3 x [8 x [8 x { i32, i64, i8, i8, i16, i32 }]]], ptr @global2, i64 0, i64 0, i64 6, i64 6, i32 0), align 8
   br label %bb4.i.us
 
 bb4.i:                                            ; preds = %.exit

diff  --git a/llvm/test/Analysis/MemorySSA/pr46574.ll b/llvm/test/Analysis/MemorySSA/pr46574.ll
index 4e107478ab509..efd71bc5dc069 100644
--- a/llvm/test/Analysis/MemorySSA/pr46574.ll
+++ b/llvm/test/Analysis/MemorySSA/pr46574.ll
@@ -10,16 +10,16 @@ bb:
   br label %bb13
 
 bb13:                                             ; preds = %bb38, %bb31, %bb
-  %i15 = load i32, i32* undef, align 4
+  %i15 = load i32, ptr undef, align 4
   %i16 = trunc i32 %i15 to i8
-  %i18 = load %0*, %0** undef, align 8
-  %i19 = icmp eq %0* %i18, null
+  %i18 = load ptr, ptr undef, align 8
+  %i19 = icmp eq ptr %i18, null
   br i1 %i19, label %bb31, label %safe_mod_func_uint8_t_u_u.exit
 
 bb31:                                             ; preds = %bb13
-  %i25 = load i8, i8* getelementptr inbounds ([4 x [3 x [2 x { i8, i8, i8, i8, i8, i8, i8, i8, i32 }]]], [4 x [3 x [2 x { i8, i8, i8, i8, i8, i8, i8, i8, i32 }]]]* @g_1077, i64 0, i64 2, i64 2, i64 1, i32 6), align 2
+  %i25 = load i8, ptr getelementptr inbounds ([4 x [3 x [2 x { i8, i8, i8, i8, i8, i8, i8, i8, i32 }]]], ptr @g_1077, i64 0, i64 2, i64 2, i64 1, i32 6), align 2
   %i28 = or i8 %i25, %i16
-  store i8 %i28, i8* getelementptr inbounds ([4 x [3 x [2 x { i8, i8, i8, i8, i8, i8, i8, i8, i32 }]]], [4 x [3 x [2 x { i8, i8, i8, i8, i8, i8, i8, i8, i32 }]]]* @g_1077, i64 0, i64 2, i64 2, i64 1, i32 6), align 2
+  store i8 %i28, ptr getelementptr inbounds ([4 x [3 x [2 x { i8, i8, i8, i8, i8, i8, i8, i8, i32 }]]], ptr @g_1077, i64 0, i64 2, i64 2, i64 1, i32 6), align 2
   %i30 = icmp ne i8 %i28, 0
   %i37.not = icmp eq i8 %i16, 0
   %or.cond = or i1 %i37.not, %i30

diff  --git a/llvm/test/Analysis/MemorySSA/pr49859.ll b/llvm/test/Analysis/MemorySSA/pr49859.ll
index 8e955b56554df..9778ca831c26c 100644
--- a/llvm/test/Analysis/MemorySSA/pr49859.ll
+++ b/llvm/test/Analysis/MemorySSA/pr49859.ll
@@ -11,83 +11,83 @@ entry:
   %n = alloca i8, align 1
   %i = alloca i8, align 1
   %cleanup.dest.slot = alloca i32, align 1
-  call  void @llvm.lifetime.start.p0i8(i64 1, i8* %sum) #3
-  store i8 0, i8* %sum, align 1
-  call  void @llvm.lifetime.start.p0i8(i64 1, i8* %n) #3
+  call  void @llvm.lifetime.start.p0(i64 1, ptr %sum) #3
+  store i8 0, ptr %sum, align 1
+  call  void @llvm.lifetime.start.p0(i64 1, ptr %n) #3
   %call = call  i8 @idi(i8 10)
-  store i8 %call, i8* %n, align 1
-  call  void @llvm.lifetime.start.p0i8(i64 1, i8* %i) #3
-  store i8 0, i8* %i, align 1
+  store i8 %call, ptr %n, align 1
+  call  void @llvm.lifetime.start.p0(i64 1, ptr %i) #3
+  store i8 0, ptr %i, align 1
   br label %for.cond
 
 for.cond:                                         ; preds = %for.inc, %entry
-  %0 = load i8, i8* %i, align 1
-  %1 = load i8, i8* %n, align 1
+  %0 = load i8, ptr %i, align 1
+  %1 = load i8, ptr %n, align 1
   %cmp = icmp slt i8 %0, %1
   br i1 %cmp, label %for.body, label %for.cond.cleanup
 
 for.cond.cleanup:                                 ; preds = %for.cond
-  store i32 2, i32* %cleanup.dest.slot, align 1
+  store i32 2, ptr %cleanup.dest.slot, align 1
   br label %final.cleanup
 
 for.body:                                         ; preds = %for.cond
-  %2 = load i8, i8* %i, align 1
+  %2 = load i8, ptr %i, align 1
   %idxprom = sext i8 %2 to i32
-  %arrayidx = getelementptr inbounds [12 x i8], [12 x i8]* @arr, i32 0, i32 %idxprom
-  %3 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [12 x i8], ptr @arr, i32 0, i32 %idxprom
+  %3 = load i8, ptr %arrayidx, align 1
   %cmp1 = icmp eq i8 %3, 3
   br i1 %cmp1, label %if.then, label %if.end
 
 if.then:                                          ; preds = %for.body
-  store i32 2, i32* %cleanup.dest.slot, align 1
+  store i32 2, ptr %cleanup.dest.slot, align 1
   br label %final.cleanup
 
 if.end:                                           ; preds = %for.body
-  %4 = load i8, i8* %i, align 1
+  %4 = load i8, ptr %i, align 1
   %idxprom2 = sext i8 %4 to i32
-  %arrayidx3 = getelementptr inbounds [12 x i8], [12 x i8]* @arr, i32 0, i32 %idxprom2
-  %5 = load i8, i8* %arrayidx3, align 1
-  %6 = load i8, i8* %sum, align 1
+  %arrayidx3 = getelementptr inbounds [12 x i8], ptr @arr, i32 0, i32 %idxprom2
+  %5 = load i8, ptr %arrayidx3, align 1
+  %6 = load i8, ptr %sum, align 1
   %add = add nsw i8 %6, %5
-  store i8 %add, i8* %sum, align 1
+  store i8 %add, ptr %sum, align 1
   br label %for.inc
 
 for.inc:                                          ; preds = %if.end
-  %7 = load i8, i8* %i, align 1
+  %7 = load i8, ptr %i, align 1
   %inc = add nsw i8 %7, 1
-  store i8 %inc, i8* %i, align 1
+  store i8 %inc, ptr %i, align 1
   br label %for.cond
 
 ; CHECK: final.cleanup:
 ; CHECK-NEXT: ; [[NO20:.*]] = MemoryPhi({if.then,[[NO9:.*]]},{for.cond.cleanup,[[NO8:.*]]})
 ; CHECK-NEXT: ; [[NO12:.*]] = MemoryDef([[NO20]])
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 1, i8* %i)
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 1, ptr %i)
 final.cleanup:                                          ; preds = %if.then, %for.cond.cleanup
-  call  void @llvm.lifetime.end.p0i8(i64 1, i8* %i) #3
+  call  void @llvm.lifetime.end.p0(i64 1, ptr %i) #3
   br label %for.end
 
 ; CHECK: for.end:
 ; CHECK-NEXT: ; MemoryUse([[NO12]])
-; CHECK-NEXT:  %3 = load i8, i8* %sum, align 1
+; CHECK-NEXT:  %3 = load i8, ptr %sum, align 1
 for.end:                                          ; preds = %final.cleanup
-  %8 = load i8, i8* %sum, align 1
-  call  void @llvm.lifetime.start.p0i8(i64 1, i8* %res.addr.i)
-  store i8 %8, i8* %res.addr.i, align 1
-  %9 = load i8, i8* %res.addr.i, align 1
+  %8 = load i8, ptr %sum, align 1
+  call  void @llvm.lifetime.start.p0(i64 1, ptr %res.addr.i)
+  store i8 %8, ptr %res.addr.i, align 1
+  %9 = load i8, ptr %res.addr.i, align 1
   call  void @foo(i8 %9) #3
-  call  void @llvm.lifetime.end.p0i8(i64 1, i8* %res.addr.i)
-  call  void @llvm.lifetime.end.p0i8(i64 1, i8* %n) #3
-  call  void @llvm.lifetime.end.p0i8(i64 1, i8* %sum) #3
+  call  void @llvm.lifetime.end.p0(i64 1, ptr %res.addr.i)
+  call  void @llvm.lifetime.end.p0(i64 1, ptr %n) #3
+  call  void @llvm.lifetime.end.p0(i64 1, ptr %sum) #3
   ret void
 }
 
 ; Function Attrs: argmemonly nofree nosync nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)  #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)  #1
 
 declare i8 @idi(i8)
 
 ; Function Attrs: argmemonly nofree nosync nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)  #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)  #1
 
 ; Function Attrs: nounwind
 declare void @foo(i8)

diff  --git a/llvm/test/Analysis/MemorySSA/print-dot-cfg-mssa.ll b/llvm/test/Analysis/MemorySSA/print-dot-cfg-mssa.ll
index f14379d3e1757..6edb9aa2b86f6 100644
--- a/llvm/test/Analysis/MemorySSA/print-dot-cfg-mssa.ll
+++ b/llvm/test/Analysis/MemorySSA/print-dot-cfg-mssa.ll
@@ -20,63 +20,61 @@
 ;  return *q;
 ;}
 
-define signext i32 @f(i32* %p, i32* %q, i32* %r) {
+define signext i32 @f(ptr %p, ptr %q, ptr %r) {
 entry:
   br label %bb1
 
 bb1:
-  %p.addr = alloca i32*, align 8
-  %q.addr = alloca i32*, align 8
-  %r.addr = alloca i32*, align 8
+  %p.addr = alloca ptr, align 8
+  %q.addr = alloca ptr, align 8
+  %r.addr = alloca ptr, align 8
   %i = alloca i32, align 4
-  store i32* %p, i32** %p.addr, align 8
-  store i32* %q, i32** %q.addr, align 8
-  store i32* %r, i32** %r.addr, align 8
-  %0 = bitcast i32* %i to i8*
-  store i32 0, i32* %i, align 4
-  %1 = load i32*, i32** %r.addr, align 8
-  %2 = load i32, i32* %1, align 4
-  %tobool = icmp ne i32 %2, 0
+  store ptr %p, ptr %p.addr, align 8
+  store ptr %q, ptr %q.addr, align 8
+  store ptr %r, ptr %r.addr, align 8
+  store i32 0, ptr %i, align 4
+  %0 = load ptr, ptr %r.addr, align 8
+  %1 = load i32, ptr %0, align 4
+  %tobool = icmp ne i32 %1, 0
   br i1 %tobool, label %if.then, label %if.else
 
 if.then:
-  store i32 1, i32* %i, align 4
+  store i32 1, ptr %i, align 4
   br label %bb2
 
 bb2:
   br label %if.end
 
 if.else:
-  call void bitcast (void (...)* @g to void ()*)()
+  call void @g()
   br label %if.end
 
 if.end:
-  %3 = load i32*, i32** %q.addr, align 8
-  %4 = load i32, i32* %3, align 4
-  %add = add nsw i32 %4, 1
-  %5 = load i32*, i32** %p.addr, align 8
-  store i32 %add, i32* %5, align 4
-  %6 = load i32, i32* %i, align 4
-  %tobool1 = icmp ne i32 %6, 0
+  %2 = load ptr, ptr %q.addr, align 8
+  %3 = load i32, ptr %2, align 4
+  %add = add nsw i32 %3, 1
+  %4 = load ptr, ptr %p.addr, align 8
+  store i32 %add, ptr %4, align 4
+  %5 = load i32, ptr %i, align 4
+  %tobool1 = icmp ne i32 %5, 0
   br i1 %tobool1, label %if.then2, label %if.end3
 
 if.then2:
-  %7 = load i32, i32* %i, align 4
-  %inc = add nsw i32 %7, 1
+  %6 = load i32, ptr %i, align 4
+  %inc = add nsw i32 %6, 1
   br label %bb3
 
 bb3:
-  store i32 %inc, i32* %i, align 4
+  store i32 %inc, ptr %i, align 4
   br label %if.end3
 
 if.end3:
   br label %bb4
 
 bb4:
-  %8 = load i32*, i32** %q.addr, align 8
-  %9 = load i32, i32* %8, align 4
-  %10 = bitcast i32* %i to i8*
-  ret i32 %9
+  %7 = load ptr, ptr %q.addr, align 8
+  %8 = load i32, ptr %7, align 4
+  ret i32 %8
 }
 
 declare void @g(...)

diff  --git a/llvm/test/Analysis/MemorySSA/print-walker.ll b/llvm/test/Analysis/MemorySSA/print-walker.ll
index 39d003ec9fcd2..9762b1c5ba4ed 100644
--- a/llvm/test/Analysis/MemorySSA/print-walker.ll
+++ b/llvm/test/Analysis/MemorySSA/print-walker.ll
@@ -2,34 +2,34 @@
 
 ; CHECK: define void @test
 ; CHECK: 1 = MemoryDef(liveOnEntry)->liveOnEntry - clobbered by liveOnEntry
-; CHECK: store i8 42, i8* %a1
+; CHECK: store i8 42, ptr %a1
 ; CHECK: 2 = MemoryDef(1)->liveOnEntry - clobbered by liveOnEntry
-; CHECK: store i8 42, i8* %a2
+; CHECK: store i8 42, ptr %a2
 ; CHECK: MemoryUse(1) - clobbered by 1 = MemoryDef(liveOnEntry)->liveOnEntry
-; CHECK: %l1 = load i8, i8* %a1
+; CHECK: %l1 = load i8, ptr %a1
 ; CHECK: MemoryUse(2) - clobbered by 2 = MemoryDef(1)->liveOnEntry
-; CHECK: %l2 = load i8, i8* %a2
+; CHECK: %l2 = load i8, ptr %a2
 ; CHECK: 3 = MemoryDef(2)->liveOnEntry - clobbered by liveOnEntry
-; CHECK: store i8 42, i8* %p
+; CHECK: store i8 42, ptr %p
 ; CHECK: 4 = MemoryDef(3)->3 - clobbered by 3 = MemoryDef(2)->liveOnEntry
-; CHECK: store i8 42, i8* %p
+; CHECK: store i8 42, ptr %p
 ; CHECK: MemoryUse(4) - clobbered by 4 = MemoryDef(3)->3
-; CHECK: %p1 = load i8, i8* %p
+; CHECK: %p1 = load i8, ptr %p
 ; CHECK: MemoryUse(4) - clobbered by 4 = MemoryDef(3)->3
-; CHECK: %p2 = load i8, i8* %p
+; CHECK: %p2 = load i8, ptr %p
 
-define void @test(i8* %p) {
+define void @test(ptr %p) {
   %a1 = alloca i8
   %a2 = alloca i8
-  store i8 42, i8* %a1
-  store i8 42, i8* %a2
-  %l1 =  load i8, i8* %a1
-  %l2 =  load i8, i8* %a2
+  store i8 42, ptr %a1
+  store i8 42, ptr %a2
+  %l1 =  load i8, ptr %a1
+  %l2 =  load i8, ptr %a2
 
-  store i8 42, i8* %p
-  store i8 42, i8* %p
-  %p1 =  load i8, i8* %p
-  %p2 =  load i8, i8* %p
+  store i8 42, ptr %p
+  store i8 42, ptr %p
+  %p1 =  load i8, ptr %p
+  %p2 =  load i8, ptr %p
 
   ret void
 }

diff  --git a/llvm/test/Analysis/MemorySSA/ptr-const-mem.ll b/llvm/test/Analysis/MemorySSA/ptr-const-mem.ll
index cff014de27023..5874efb9f9ff9 100644
--- a/llvm/test/Analysis/MemorySSA/ptr-const-mem.ll
+++ b/llvm/test/Analysis/MemorySSA/ptr-const-mem.ll
@@ -4,18 +4,18 @@ target triple = "amdgcn"
 
 @g4 = external unnamed_addr constant i8, align 1
 
-define signext i8 @cmp_constant(i8* %q, i8 %v) local_unnamed_addr {
+define signext i8 @cmp_constant(ptr %q, i8 %v) local_unnamed_addr {
 entry:
 
-  store i8 %v, i8* %q, align 1
+  store i8 %v, ptr %q, align 1
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: store i8 %v, i8* %q, align 1
+; CHECK-NEXT: store i8 %v, ptr %q, align 1
 
-  %0 = load i8, i8* @g4, align 1
+  %0 = load i8, ptr @g4, align 1
 ; Make sure that this load is liveOnEntry just based on the fact that @g4 is
 ; constant memory.
 ; CHECK: MemoryUse(liveOnEntry)
-; CHECK-NEXT: load i8, i8* @g4, align 1
+; CHECK-NEXT: load i8, ptr @g4, align 1
 
   ret i8 %0
 }

diff  --git a/llvm/test/Analysis/MemorySSA/reduce_clobber_limit.ll b/llvm/test/Analysis/MemorySSA/reduce_clobber_limit.ll
index 79c07c1bdfdfb..d2122ede5c8eb 100644
--- a/llvm/test/Analysis/MemorySSA/reduce_clobber_limit.ll
+++ b/llvm/test/Analysis/MemorySSA/reduce_clobber_limit.ll
@@ -37,7 +37,7 @@ while.body:                                       ; preds = %while.cond
   br i1 %call35, label %if.end37, label %if.then36
 
 if.then36:                                        ; preds = %while.body
-  store i32 2, i32* undef, align 4
+  store i32 2, ptr undef, align 4
   br label %cleanup
 
 if.end37:                                         ; preds = %while.body
@@ -84,7 +84,7 @@ while.end:                                        ; preds = %while.cond
   br i1 %call93, label %if.end120, label %if.then94
 
 if.then94:                                        ; preds = %while.end
-  store i32 0, i32* undef, align 4
+  store i32 0, ptr undef, align 4
   call void @blah()
   call void @blah()
   call void @blah()
@@ -117,7 +117,7 @@ for.body:                                         ; preds = %for.cond
   br label %for.cond
 
 if.end120:                                        ; preds = %for.cond, %while.end
-  %val = load i8, i8* %NoFinalize.addr, align 1
+  %val = load i8, ptr %NoFinalize.addr, align 1
   ret void
 }
 

diff  --git a/llvm/test/Analysis/MemorySSA/renamephis.ll b/llvm/test/Analysis/MemorySSA/renamephis.ll
index 576f8e61e67c4..b9e7de2be7b7a 100644
--- a/llvm/test/Analysis/MemorySSA/renamephis.ll
+++ b/llvm/test/Analysis/MemorySSA/renamephis.ll
@@ -3,24 +3,24 @@
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
- at 0 = external global { { [86 x i8]*, i32, i32 }, { i16, i16, [20 x i8] }*, i8, i8 }
+ at 0 = external global { { ptr, i32, i32 }, ptr, i8, i8 }
 
 declare void @g()
 
 ; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #0
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0
 
 ; CHECK-LABEL: @f
 define void @f() align 2 {
 entry:
-  %P = alloca i32*, align 8
+  %P = alloca ptr, align 8
   br label %cond.end.i.i.i.i
 
 cond.end.i.i.i.i:                                 ; preds = %cont20, %entry
   br i1 undef, label %cont20, label %if.end
 
 cont20:                                           ; preds = %cond.end.i.i.i.i, %cond.end.i.i.i.i, %cond.end.i.i.i.i
-  store i32* undef, i32** %P, align 8
+  store ptr undef, ptr %P, align 8
   br label %cond.end.i.i.i.i
 
 if.end:                                           ; preds = %cond.end.i.i.i.i
@@ -41,7 +41,7 @@ block.exit: ; preds = %cond.exit
   unreachable
 
 sw.bb94:                                          ; preds = %cond.exit
-  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull undef)
+  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull undef)
   br label %cleanup
 
 cleanup:                                          ; preds = %sw.bb94, %cond.exit, %cond.exit

diff  --git a/llvm/test/Analysis/MemorySSA/scalable-vec.ll b/llvm/test/Analysis/MemorySSA/scalable-vec.ll
index 2607062ca78ba..9a6e38b925d6a 100644
--- a/llvm/test/Analysis/MemorySSA/scalable-vec.ll
+++ b/llvm/test/Analysis/MemorySSA/scalable-vec.ll
@@ -5,20 +5,19 @@
 ; CHECK: MemoryUse(1)
 define <vscale x 4 x i32> @f(<vscale x 4 x i32> %z) {
   %a = alloca <vscale x 4 x i32>
-  store <vscale x 4 x i32> %z, <vscale x 4 x i32>* %a
-  %zz = load <vscale x 4 x i32>, <vscale x 4 x i32>* %a
+  store <vscale x 4 x i32> %z, ptr %a
+  %zz = load <vscale x 4 x i32>, ptr %a
   ret <vscale x 4 x i32> %zz
 }
 
 ; CHECK-LABEL: define i32 @g(
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK: MemoryUse(1)
-declare i32* @gg(<vscale x 4 x i32>* %a)
-define i32 @g(i32 %z, i32 *%bb) {
+declare ptr @gg(ptr %a)
+define i32 @g(i32 %z, ptr %bb) {
   %a = alloca <vscale x 4 x i32>
-  %aa = getelementptr <vscale x 4 x i32>, <vscale x 4 x i32>* %a, i32 0, i32 0
-  store i32 %z, i32* %aa
-  %bbb = call i32* @gg(<vscale x 4 x i32>* %a) readnone
-  %zz = load i32, i32* %bbb
+  store i32 %z, ptr %a
+  %bbb = call ptr @gg(ptr %a) readnone
+  %zz = load i32, ptr %bbb
   ret i32 %zz
 }

diff  --git a/llvm/test/Analysis/MemorySSA/update-remove-dead-blocks.ll b/llvm/test/Analysis/MemorySSA/update-remove-dead-blocks.ll
index 4f539788def5a..45ab48e1cca85 100644
--- a/llvm/test/Analysis/MemorySSA/update-remove-dead-blocks.ll
+++ b/llvm/test/Analysis/MemorySSA/update-remove-dead-blocks.ll
@@ -14,7 +14,7 @@ target triple = "x86_64-unknown-linux-gnu"
 @a = external global i32, align 4
 @c = external global [1 x i32], align 4
 
-define i32* @test() {
+define ptr @test() {
 ; CHECK-LABEL: @test(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    switch i32 0, label [[ENTRY_SPLIT:%.*]] [
@@ -33,8 +33,8 @@ define i32* @test() {
 ; CHECK-NEXT:    br label [[FOR_BODY3]]
 ; CHECK:       for.body3:
 ; CHECK-NEXT:    [[STOREMERGE_LCSSA:%.*]] = phi i64 [ poison, [[FOR_COND2_2_FOR_BODY3_CRIT_EDGE]] ], [ poison, [[FOR_BODY3SPLIT]] ]
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [1 x i32], [1 x i32]* @c, i64 0, i64 [[STOREMERGE_LCSSA]]
-; CHECK-NEXT:    ret i32* [[ARRAYIDX]]
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [1 x i32], ptr @c, i64 0, i64 [[STOREMERGE_LCSSA]]
+; CHECK-NEXT:    ret ptr [[ARRAYIDX]]
 ;
 entry:                                                ; preds = %entry
   br label %for.cond
@@ -44,8 +44,8 @@ for.cond:                                         ; preds = %cleanup, %entry
   br label %for.cond2.1
 
 for.body3:                                        ; preds = %for.cond2.2, %for.cond2.1
-  %arrayidx = getelementptr inbounds [1 x i32], [1 x i32]* @c, i64 0, i64 %storemerge
-  ret i32* %arrayidx
+  %arrayidx = getelementptr inbounds [1 x i32], ptr @c, i64 0, i64 %storemerge
+  ret ptr %arrayidx
 
 cleanup:                                          ; preds = %for.end5, %if.then
   %inc7 = add nsw i64 %storemerge, 1
@@ -58,7 +58,7 @@ for.inc.1:                                        ; preds = %for.end.1
   br i1 false, label %for.body.2, label %cleanup
 
 for.body.2:                                       ; preds = %for.inc.1
-  store i32 0, i32* @a, align 4
+  store i32 0, ptr @a, align 4
   br label %for.cond2.2
 
 for.cond2.2:                                      ; preds = %for.body.2

diff  --git a/llvm/test/Analysis/MemorySSA/update_unroll.ll b/llvm/test/Analysis/MemorySSA/update_unroll.ll
index b65ea507965f0..46a7283eaf103 100644
--- a/llvm/test/Analysis/MemorySSA/update_unroll.ll
+++ b/llvm/test/Analysis/MemorySSA/update_unroll.ll
@@ -33,7 +33,7 @@ while.body82:                                     ; preds = %if.end61
   br i1 undef, label %return.loopexit, label %if.else99
 
 if.else99:                                        ; preds = %while.body82
-  store i32 0, i32* inttoptr (i64 44 to i32*), align 4
+  store i32 0, ptr inttoptr (i64 44 to ptr), align 4
   br label %while.cond80.while.cond.loopexit_crit_edge
 
 return.loopexit:                                  ; preds = %while.body82

diff  --git a/llvm/test/Analysis/MemorySSA/volatile-clobber.ll b/llvm/test/Analysis/MemorySSA/volatile-clobber.ll
index 01b27178e88a4..6380f244705d3 100644
--- a/llvm/test/Analysis/MemorySSA/volatile-clobber.ll
+++ b/llvm/test/Analysis/MemorySSA/volatile-clobber.ll
@@ -7,86 +7,86 @@ define i32 @foo() {
   %1 = alloca i32, align 4
 ; CHECK: 1 = MemoryDef(liveOnEntry)
 ; CHECK-NEXT: store volatile i32 4
-  store volatile i32 4, i32* %1, align 4
+  store volatile i32 4, ptr %1, align 4
 ; CHECK: 2 = MemoryDef(1)
 ; CHECK-NEXT: store volatile i32 8
-  store volatile i32 8, i32* %1, align 4
+  store volatile i32 8, ptr %1, align 4
 ; CHECK: 3 = MemoryDef(2)
 ; CHECK-NEXT: %2 = load volatile i32
-  %2 = load volatile i32, i32* %1, align 4
+  %2 = load volatile i32, ptr %1, align 4
 ; CHECK: 4 = MemoryDef(3)
 ; CHECK-NEXT: %3 = load volatile i32
-  %3 = load volatile i32, i32* %1, align 4
+  %3 = load volatile i32, ptr %1, align 4
   %4 = add i32 %3, %2
   ret i32 %4
 }
 
 ; Ensuring we allow hoisting nonvolatile loads around volatile loads.
 ; CHECK-LABEL: define void @volatile_only
-define void @volatile_only(i32* %arg1, i32* %arg2) {
+define void @volatile_only(ptr %arg1, ptr %arg2) {
   ; Trivially NoAlias/MustAlias
   %a = alloca i32
   %b = alloca i32
 
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: load volatile i32, i32* %a
-  load volatile i32, i32* %a
+; CHECK-NEXT: load volatile i32, ptr %a
+  load volatile i32, ptr %a
 ; CHECK: MemoryUse(liveOnEntry)
-; CHECK-NEXT: load i32, i32* %b
-  load i32, i32* %b
+; CHECK-NEXT: load i32, ptr %b
+  load i32, ptr %b
 ; CHECK: MemoryUse(liveOnEntry)
-; CHECK-NEXT: load i32, i32* %a
-  load i32, i32* %a
+; CHECK-NEXT: load i32, ptr %a
+  load i32, ptr %a
 
   ; MayAlias
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: load volatile i32, i32* %arg1
-  load volatile i32, i32* %arg1
+; CHECK-NEXT: load volatile i32, ptr %arg1
+  load volatile i32, ptr %arg1
 ; CHECK: MemoryUse(liveOnEntry)
-; CHECK-NEXT: load i32, i32* %arg2
-  load i32, i32* %arg2
+; CHECK-NEXT: load i32, ptr %arg2
+  load i32, ptr %arg2
 
   ret void
 }
 
 ; Ensuring that volatile atomic operations work properly.
 ; CHECK-LABEL: define void @volatile_atomics
-define void @volatile_atomics(i32* %arg1, i32* %arg2) {
+define void @volatile_atomics(ptr %arg1, ptr %arg2) {
   %a = alloca i32
   %b = alloca i32
 
  ; Trivially NoAlias/MustAlias
 
 ; CHECK: 1 = MemoryDef(liveOnEntry)
-; CHECK-NEXT: load atomic volatile i32, i32* %a acquire, align 4
-  load atomic volatile i32, i32* %a acquire, align 4
+; CHECK-NEXT: load atomic volatile i32, ptr %a acquire, align 4
+  load atomic volatile i32, ptr %a acquire, align 4
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: load i32, i32* %b
-  load i32, i32* %b
+; CHECK-NEXT: load i32, ptr %b
+  load i32, ptr %b
 
 ; CHECK: 2 = MemoryDef(1)
-; CHECK-NEXT: load atomic volatile i32, i32* %a monotonic, align 4
-  load atomic volatile i32, i32* %a monotonic, align 4
+; CHECK-NEXT: load atomic volatile i32, ptr %a monotonic, align 4
+  load atomic volatile i32, ptr %a monotonic, align 4
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: load i32, i32* %b
-  load i32, i32* %b
+; CHECK-NEXT: load i32, ptr %b
+  load i32, ptr %b
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: load atomic i32, i32* %b unordered, align 4
-  load atomic i32, i32* %b unordered, align 4
+; CHECK-NEXT: load atomic i32, ptr %b unordered, align 4
+  load atomic i32, ptr %b unordered, align 4
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: load atomic i32, i32* %a unordered, align 4
-  load atomic i32, i32* %a unordered, align 4
+; CHECK-NEXT: load atomic i32, ptr %a unordered, align 4
+  load atomic i32, ptr %a unordered, align 4
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: load i32, i32* %a
-  load i32, i32* %a
+; CHECK-NEXT: load i32, ptr %a
+  load i32, ptr %a
 
   ; MayAlias
 ; CHECK: 3 = MemoryDef(2)
-; CHECK-NEXT: load atomic volatile i32, i32* %arg1 monotonic, align 4
-  load atomic volatile i32, i32* %arg1 monotonic, align 4
+; CHECK-NEXT: load atomic volatile i32, ptr %arg1 monotonic, align 4
+  load atomic volatile i32, ptr %arg1 monotonic, align 4
 ; CHECK: MemoryUse(1)
-; CHECK-NEXT: load i32, i32* %arg2
-  load i32, i32* %arg2
+; CHECK-NEXT: load i32, ptr %arg2
+  load i32, ptr %arg2
 
   ret void
 }


        


More information about the llvm-commits mailing list