[llvm] 0991da3 - [SCCP] Convert tests to opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 09:13:40 PDT 2022


Author: Nikita Popov
Date: 2022-11-01T17:13:31+01:00
New Revision: 0991da36906bdb29b8f1030d5123bafb58fee79e

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

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

Conversion was performed using
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34
plus manual (but uninteresting) fixup.

Added: 
    

Modified: 
    llvm/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll
    llvm/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll
    llvm/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll
    llvm/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll
    llvm/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll
    llvm/test/Transforms/SCCP/2006-12-04-PackedType.ll
    llvm/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll
    llvm/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll
    llvm/test/Transforms/SCCP/2009-09-24-byval-ptr.ll
    llvm/test/Transforms/SCCP/PR26044.ll
    llvm/test/Transforms/SCCP/PR43857.ll
    llvm/test/Transforms/SCCP/apint-array.ll
    llvm/test/Transforms/SCCP/apint-bigarray.ll
    llvm/test/Transforms/SCCP/apint-bigint2.ll
    llvm/test/Transforms/SCCP/apint-ipsccp3.ll
    llvm/test/Transforms/SCCP/apint-ipsccp4.ll
    llvm/test/Transforms/SCCP/apint-load.ll
    llvm/test/Transforms/SCCP/apint-select.ll
    llvm/test/Transforms/SCCP/arg-count-mismatch.ll
    llvm/test/Transforms/SCCP/arg-type-mismatch.ll
    llvm/test/Transforms/SCCP/assume.ll
    llvm/test/Transforms/SCCP/atomic-load-store.ll
    llvm/test/Transforms/SCCP/atomic.ll
    llvm/test/Transforms/SCCP/binaryops-constexprs.ll
    llvm/test/Transforms/SCCP/clang-arc-rv.ll
    llvm/test/Transforms/SCCP/conditions-iter-order.ll
    llvm/test/Transforms/SCCP/conditions-ranges.ll
    llvm/test/Transforms/SCCP/crash.ll
    llvm/test/Transforms/SCCP/dangling-block-address.ll
    llvm/test/Transforms/SCCP/definite-initializer.ll
    llvm/test/Transforms/SCCP/global-alias-constprop.ll
    llvm/test/Transforms/SCCP/global.ll
    llvm/test/Transforms/SCCP/indirectbr.ll
    llvm/test/Transforms/SCCP/int-phis.ll
    llvm/test/Transforms/SCCP/intrinsics.ll
    llvm/test/Transforms/SCCP/ip-add-range-to-call.ll
    llvm/test/Transforms/SCCP/ip-ranges-casts.ll
    llvm/test/Transforms/SCCP/ip-ranges-select.ll
    llvm/test/Transforms/SCCP/ipsccp-addr-taken.ll
    llvm/test/Transforms/SCCP/ipsccp-basic.ll
    llvm/test/Transforms/SCCP/ipsccp-clear-returned.ll
    llvm/test/Transforms/SCCP/ipsccp-cycles.ll
    llvm/test/Transforms/SCCP/ipsccp-predinfo-order.ll
    llvm/test/Transforms/SCCP/ipsccp-range-crashes.ll
    llvm/test/Transforms/SCCP/ipsccp-ssa-copy-nested-conds.ll
    llvm/test/Transforms/SCCP/ipscp-drop-argmemonly.ll
    llvm/test/Transforms/SCCP/landingpad.ll
    llvm/test/Transforms/SCCP/latticeval-invalidate.ll
    llvm/test/Transforms/SCCP/load-store-range.ll
    llvm/test/Transforms/SCCP/loadtest2.ll
    llvm/test/Transforms/SCCP/metadata.ll
    llvm/test/Transforms/SCCP/multiple_callbacks.ll
    llvm/test/Transforms/SCCP/musttail-call.ll
    llvm/test/Transforms/SCCP/openmp_parallel_for.ll
    llvm/test/Transforms/SCCP/pr35357.ll
    llvm/test/Transforms/SCCP/pr45185-range-predinfo.ll
    llvm/test/Transforms/SCCP/pr49582-iterator-invalidation.ll
    llvm/test/Transforms/SCCP/pthreads.ll
    llvm/test/Transforms/SCCP/replace-dereferenceable-ptr-with-undereferenceable.ll
    llvm/test/Transforms/SCCP/report-changed.ll
    llvm/test/Transforms/SCCP/resolvedundefsin-tracked-fn.ll
    llvm/test/Transforms/SCCP/return-argument.ll
    llvm/test/Transforms/SCCP/return-constant.ll
    llvm/test/Transforms/SCCP/retvalue-undef.ll
    llvm/test/Transforms/SCCP/switch.ll
    llvm/test/Transforms/SCCP/thread_local_acs.ll
    llvm/test/Transforms/SCCP/ub-shift.ll
    llvm/test/Transforms/SCCP/ubsan_overflow.ll
    llvm/test/Transforms/SCCP/undef-resolve.ll
    llvm/test/Transforms/SCCP/vector-bitcast.ll
    llvm/test/Transforms/SCCP/widening.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll b/llvm/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll
index 50a5321bb8a1..74ee6dfc9e3d 100644
--- a/llvm/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll
+++ b/llvm/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll
@@ -1,9 +1,9 @@
 ; RUN: opt < %s -passes=sccp -S | not grep %X
 
- at G = external global [40 x i32]		; <[40 x i32]*> [#uses=1]
+ at G = external global [40 x i32]		; <ptr> [#uses=1]
 
-define i32* @test() {
-	%X = getelementptr [40 x i32], [40 x i32]* @G, i64 0, i64 0		; <i32*> [#uses=1]
-	ret i32* %X
+define ptr @test() {
+	%X = getelementptr [40 x i32], ptr @G, i64 0, i64 0		; <ptr> [#uses=1]
+	ret ptr %X
 }
 

diff  --git a/llvm/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll b/llvm/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll
index 760f460c3bb5..57c57e1af7a2 100644
--- a/llvm/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll
+++ b/llvm/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll
@@ -1,9 +1,9 @@
 ; RUN: opt < %s -sccp -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | \
 ; RUN:   not grep then:
 
-define void @cprop_test11(i32* %data.1) {
+define void @cprop_test11(ptr %data.1) {
 entry:
-	%tmp.1 = load i32, i32* %data.1		; <i32> [#uses=3]
+	%tmp.1 = load i32, ptr %data.1		; <i32> [#uses=3]
 	%tmp.41 = icmp sgt i32 %tmp.1, 1		; <i1> [#uses=1]
 	br i1 %tmp.41, label %no_exit, label %loopexit
 no_exit:		; preds = %endif, %then, %entry
@@ -22,9 +22,9 @@ endif:		; preds = %no_exit
 loopexit:		; preds = %endif, %then, %entry
 	%j.1 = phi i32 [ 1, %entry ], [ %j.0, %endif ], [ %i.0, %then ]		; <i32> [#uses=1]
 	%i.1 = phi i32 [ 1, %entry ], [ %inc, %endif ], [ %inc1, %then ]		; <i32> [#uses=1]
-	%tmp.17 = getelementptr i32, i32* %data.1, i64 1		; <i32*> [#uses=1]
-	store i32 %j.1, i32* %tmp.17
-	%tmp.23 = getelementptr i32, i32* %data.1, i64 2		; <i32*> [#uses=1]
-	store i32 %i.1, i32* %tmp.23
+	%tmp.17 = getelementptr i32, ptr %data.1, i64 1		; <ptr> [#uses=1]
+	store i32 %j.1, ptr %tmp.17
+	%tmp.23 = getelementptr i32, ptr %data.1, i64 2		; <ptr> [#uses=1]
+	store i32 %i.1, ptr %tmp.23
 	ret void
 }

diff  --git a/llvm/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll b/llvm/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll
index 7b5df4f6bc19..a42f7501241e 100644
--- a/llvm/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll
+++ b/llvm/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll
@@ -3,7 +3,7 @@
 
 declare void @foo()
 
-define i32 @test(i1 %cond) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i32 @test(i1 %cond) personality ptr @__gxx_personality_v0 {
 Entry:
 	br i1 %cond, label %Inv, label %Cont
 Inv:		; preds = %Entry
@@ -12,8 +12,8 @@ Inv:		; preds = %Entry
 Ok:		; preds = %Inv
 	br label %Cont
 LPad:
-        %val = landingpad { i8*, i32 }
-                 catch i8* null
+        %val = landingpad { ptr, i32 }
+                 catch ptr null
         br label %Cont
 Cont:		; preds = %Ok, %Inv, %Entry
 	%X = phi i32 [ 0, %Entry ], [ 1, %Ok ], [ 0, %LPad ]		; <i32> [#uses=1]

diff  --git a/llvm/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll b/llvm/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll
index cc50a6a9f5b3..34c4fdc34368 100644
--- a/llvm/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll
+++ b/llvm/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll
@@ -2,14 +2,14 @@
 
 declare i32 @foo()
 
-define void @caller() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @caller() personality ptr @__gxx_personality_v0 {
 	br i1 true, label %T, label %F
 F:		; preds = %0
 	%X = invoke i32 @foo( )
 			to label %T unwind label %LP		; <i32> [#uses=0]
 LP:
-        %val = landingpad { i8*, i32 }
-                 catch i8* null
+        %val = landingpad { ptr, i32 }
+                 catch ptr null
         br label %T
 T:
 	ret void

diff  --git a/llvm/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll b/llvm/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll
index 18861a259847..3e2cfe1ce25f 100644
--- a/llvm/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll
+++ b/llvm/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll
@@ -2,9 +2,9 @@
 ; END.
 target datalayout = "E-p:32:32"
 target triple = "powerpc-unknown-linux-gnu"
-	%struct.pat_list = type { i32, %struct.pat_list* }
- at JUMP = external global i32		; <i32*> [#uses=1]
- at old_D_pat = external global [16 x i8]		; <[16 x i8]*> [#uses=0]
+	%struct.pat_list = type { i32, ptr }
+ at JUMP = external global i32		; <ptr> [#uses=1]
+ at old_D_pat = external global [16 x i8]		; <ptr> [#uses=0]
 
 define void @asearch1(i32 %D) {
 entry:
@@ -37,7 +37,7 @@ cond_next50:		; preds = %entry
 	%tmp52 = icmp sgt i32 %D, 0		; <i1> [#uses=1]
 	br i1 %tmp52, label %cond_true53, label %cond_next71
 cond_true53:		; preds = %cond_next50
-	%tmp54 = load i32, i32* @JUMP		; <i32> [#uses=1]
+	%tmp54 = load i32, ptr @JUMP		; <i32> [#uses=1]
 	%tmp55 = icmp eq i32 %tmp54, 1		; <i1> [#uses=1]
 	br i1 %tmp55, label %cond_true56, label %cond_next63
 cond_true56:		; preds = %cond_true53
@@ -67,9 +67,9 @@ bb217:		; preds = %cond_true260
 	ret void
 cond_next252:		; preds = %cond_next208, %entry
 	%D.0.0 = phi i32 [ 0, %entry ], [ %tmp229, %cond_next208 ]		; <i32> [#uses=1]
-	%tmp254 = getelementptr i8*, i8** null, i32 1		; <i8**> [#uses=1]
-	%tmp256 = load i8*, i8** %tmp254		; <i8*> [#uses=1]
-	%tmp258 = load i8, i8* %tmp256		; <i8> [#uses=1]
+	%tmp254 = getelementptr ptr, ptr null, i32 1		; <ptr> [#uses=1]
+	%tmp256 = load ptr, ptr %tmp254		; <ptr> [#uses=1]
+	%tmp258 = load i8, ptr %tmp256		; <i8> [#uses=1]
 	%tmp259 = icmp eq i8 %tmp258, 45		; <i1> [#uses=1]
 	br i1 %tmp259, label %cond_true260, label %bb263
 cond_true260:		; preds = %cond_next252

diff  --git a/llvm/test/Transforms/SCCP/2006-12-04-PackedType.ll b/llvm/test/Transforms/SCCP/2006-12-04-PackedType.ll
index 40f634846b97..53b31c531fcf 100644
--- a/llvm/test/Transforms/SCCP/2006-12-04-PackedType.ll
+++ b/llvm/test/Transforms/SCCP/2006-12-04-PackedType.ll
@@ -10,21 +10,21 @@ target triple = "powerpc-unknown-linux-gnu"
 	%struct.GLDArrayRange = type { i8, i8, i8, i8 }
 	%struct.GLDBlendMode = type { i16, i16, i16, i16, %struct.GLTColor4, i16, i16, i8, i8, i8, i8 }
 	%struct.GLDBufferRec = type opaque
-	%struct.GLDBufferstate = type { %struct.GLTDimensions, %struct.GLTDimensions, %struct.GLTFixedColor4, %struct.GLTFixedColor4, i8, i8, i8, i8, [2 x %struct.GLSBuffer], [4 x %struct.GLSBuffer], %struct.GLSBuffer, %struct.GLSBuffer, %struct.GLSBuffer, [4 x %struct.GLSBuffer*], %struct.GLSBuffer*, %struct.GLSBuffer*, %struct.GLSBuffer*, i8, i8 }
+	%struct.GLDBufferstate = type { %struct.GLTDimensions, %struct.GLTDimensions, %struct.GLTFixedColor4, %struct.GLTFixedColor4, i8, i8, i8, i8, [2 x %struct.GLSBuffer], [4 x %struct.GLSBuffer], %struct.GLSBuffer, %struct.GLSBuffer, %struct.GLSBuffer, [4 x ptr], ptr, ptr, ptr, i8, i8 }
 	%struct.GLDClearColor = type { double, %struct.GLTColor4, %struct.GLTColor4, float, i32 }
 	%struct.GLDClipPlane = type { i32, [6 x %struct.GLTColor4] }
 	%struct.GLDColorBuffer = type { i16, i16, [4 x i16] }
-	%struct.GLDColorMatrix = type { [16 x float]*, %struct.GLDImagingColorScale }
-	%struct.GLDContextRec = type { float, float, float, float, float, float, float, float, %struct.GLTColor4, %struct.GLTColor4, %struct.GLVMFPContext, %struct.GLDTextureMachine, %struct.GLGProcessor, %struct._GLVMConstants*, void (%struct.GLDContextRec*, i32, i32, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, i32)*, %struct._GLVMFunction*, void (%struct.GLDContextRec*, %struct.GLDVertex*)*, void (%struct.GLDContextRec*, %struct.GLDVertex*, %struct.GLDVertex*)*, void (%struct.GLDContextRec*, %struct.GLDVertex*, %struct.GLDVertex*, %struct.GLDVertex*)*, %struct._GLVMFunction*, %struct._GLVMFunction*, %struct._GLVMFunction*, i32, i32, i32, float, float, float, i32, %struct.GLSDrawable, %struct.GLDFramebufferAttachment, %struct.GLDFormat, %struct.GLDBufferstate, %struct.GLDSharedRec*, %struct.GLDState*, %struct.GLDPluginState*, %struct.GLTDimensions, %struct.GLTColor4*, %struct.GLTColor4*, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, %struct.GLDPipelineProgramRec*, %struct.GLDStateProgramRec, %struct.GLVMTextures, { [4 x i8*], i8*, i8* }, [64 x float], %struct.GLDStippleData, i16, i8, i8, i32, %struct.GLDFramebufferRec*, i8, %struct.GLDQueryRec*, %struct.GLDQueryRec* }
-	%struct.GLDConvolution = type { %struct.GLTColor4, %struct.GLDImagingColorScale, i16, i16, float*, i32, i32 }
+	%struct.GLDColorMatrix = type { ptr, %struct.GLDImagingColorScale }
+	%struct.GLDContextRec = type { float, float, float, float, float, float, float, float, %struct.GLTColor4, %struct.GLTColor4, %struct.GLVMFPContext, %struct.GLDTextureMachine, %struct.GLGProcessor, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, float, float, float, i32, %struct.GLSDrawable, %struct.GLDFramebufferAttachment, %struct.GLDFormat, %struct.GLDBufferstate, ptr, ptr, ptr, %struct.GLTDimensions, ptr, ptr, ptr, ptr, ptr, ptr, %struct.GLDStateProgramRec, %struct.GLVMTextures, { [4 x ptr], ptr, ptr }, [64 x float], %struct.GLDStippleData, i16, i8, i8, i32, ptr, i8, ptr, ptr }
+	%struct.GLDConvolution = type { %struct.GLTColor4, %struct.GLDImagingColorScale, i16, i16, ptr, i32, i32 }
 	%struct.GLDDepthTest = type { i16, i16, i8, i8, i8, i8, double, double }
 	%struct.GLDFogMode = type { %struct.GLTColor4, float, float, float, float, float, i16, i16, i16, i8, i8 }
 	%struct.GLDFormat = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i32, i32, i32 }
 	%struct.GLDFramebufferAttachment = type { i32, i32, i32, i32, i32, i32 }
 	%struct.GLDFramebufferData = type { [6 x %struct.GLDFramebufferAttachment], [4 x i16], i16, i16, i16, i16, i32 }
-	%struct.GLDFramebufferRec = type { %struct.GLDFramebufferData*, %struct.GLDPluginFramebufferData*, %struct.GLDPixelFormat }
+	%struct.GLDFramebufferRec = type { ptr, ptr, %struct.GLDPixelFormat }
 	%struct.GLDHintMode = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
-	%struct.GLDHistogram = type { %struct.GLTFixedColor4*, i32, i16, i8, i8 }
+	%struct.GLDHistogram = type { ptr, i32, i16, i8, i8 }
 	%struct.GLDImagingColorScale = type { { float, float }, { float, float }, { float, float }, { float, float } }
 	%struct.GLDImagingSubset = type { %struct.GLDConvolution, %struct.GLDConvolution, %struct.GLDConvolution, %struct.GLDColorMatrix, %struct.GLDMinmax, %struct.GLDHistogram, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, i32 }
 	%struct.GLDLight = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, float, float, float, float, %struct.GLTCoord3, float, float, float, float, float }
@@ -34,27 +34,27 @@ target triple = "powerpc-unknown-linux-gnu"
 	%struct.GLDLogicOp = type { i16, i8, i8 }
 	%struct.GLDMaskMode = type { i32, [3 x i32], i8, i8, i8, i8, i8, i8, i8, i8 }
 	%struct.GLDMaterial = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, float, float, float, float, [8 x %struct.GLDLightProduct], %struct.GLTColor4, [6 x i32], [2 x i32] }
-	%struct.GLDMinmax = type { %struct.GLDMinmaxTable*, i16, i8, i8 }
+	%struct.GLDMinmax = type { ptr, i16, i8, i8 }
 	%struct.GLDMinmaxTable = type { %struct.GLTColor4, %struct.GLTColor4 }
-	%struct.GLDMipmaplevel = type { [4 x i32], [4 x float], [4 x i32], [4 x i32], [4 x float], [4 x i32], [3 x i32], i32, float*, float*, float*, i32, i32, i8*, i16, i16, i16, i16 }
+	%struct.GLDMipmaplevel = type { [4 x i32], [4 x float], [4 x i32], [4 x i32], [4 x float], [4 x i32], [3 x i32], i32, ptr, ptr, ptr, i32, i32, ptr, i16, i16, i16, i16 }
 	%struct.GLDMultisample = type { float, i8, i8, i8, i8, i8, i8, i8, i8 }
-	%struct.GLDPipelineProgramData = type { i16, i16, i32, %struct._PPStreamToken*, i64, %struct.GLDShaderSourceData*, %struct.GLTColor4*, i32 }
-	%struct.GLDPipelineProgramRec = type { %struct.GLDPipelineProgramData*, %struct._PPStreamToken*, %struct._PPStreamToken*, %struct._GLVMFunction*, i32, i32, i32 }
-	%struct.GLDPipelineProgramState = type { i8, i8, i8, i8, %struct.GLTColor4* }
+	%struct.GLDPipelineProgramData = type { i16, i16, i32, ptr, i64, ptr, ptr, i32 }
+	%struct.GLDPipelineProgramRec = type { ptr, ptr, ptr, ptr, i32, i32, i32 }
+	%struct.GLDPipelineProgramState = type { i8, i8, i8, i8, ptr }
 	%struct.GLDPixelFormat = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
-	%struct.GLDPixelMap = type { i32*, float*, float*, float*, float*, float*, float*, float*, float*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
+	%struct.GLDPixelMap = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
 	%struct.GLDPixelMode = type { float, float, %struct.GLDPixelStore, %struct.GLDPixelTransfer, %struct.GLDPixelMap, %struct.GLDImagingSubset, i32, i32 }
 	%struct.GLDPixelPack = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8 }
 	%struct.GLDPixelStore = type { %struct.GLDPixelPack, %struct.GLDPixelPack }
 	%struct.GLDPixelTransfer = type { float, float, float, float, float, float, float, float, float, float, i32, i32, float, float, float, float, float, float, float, float, float, float, float, float }
-	%struct.GLDPluginFramebufferData = type { [6 x %struct.GLDTextureRec*], i32, i32 }
-	%struct.GLDPluginProgramData = type { [3 x %struct.GLDPipelineProgramRec*], %struct.GLDBufferRec**, i32 }
-	%struct.GLDPluginState = type { [16 x [5 x %struct.GLDTextureRec*]], [3 x %struct.GLDTextureRec*], [16 x %struct.GLDTextureRec*], [3 x %struct.GLDPipelineProgramRec*], %struct.GLDProgramRec*, %struct.GLDVertexArrayRec*, [16 x %struct.GLDBufferRec*], %struct.GLDFramebufferRec*, %struct.GLDFramebufferRec* }
+	%struct.GLDPluginFramebufferData = type { [6 x ptr], i32, i32 }
+	%struct.GLDPluginProgramData = type { [3 x ptr], ptr, i32 }
+	%struct.GLDPluginState = type { [16 x [5 x ptr]], [3 x ptr], [16 x ptr], [3 x ptr], ptr, ptr, [16 x ptr], ptr, ptr }
 	%struct.GLDPointMode = type { float, float, float, float, %struct.GLTCoord3, float, i8, i8, i8, i8, i16, i16, i32, i16, i16 }
 	%struct.GLDPolygonMode = type { [128 x i8], float, float, i16, i16, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8 }
 	%struct.GLDProgramData = type { i32, [16 x i32], i32, i32, i32, i32 }
-	%struct.GLDProgramRec = type { %struct.GLDProgramData*, %struct.GLDPluginProgramData*, i32 }
-	%struct.GLDQueryRec = type { i32, i32, %struct.GLDQueryRec* }
+	%struct.GLDProgramRec = type { ptr, ptr, i32 }
+	%struct.GLDQueryRec = type { i32, i32, ptr }
 	%struct.GLDRect = type { i32, i32, i32, i32, i32, i32 }
 	%struct.GLDRegisterCombiners = type { i8, i8, i8, i8, i32, [2 x %struct.GLTColor4], [8 x %struct.GLDRegisterCombinersPerStageState], %struct.GLDRegisterCombinersFinalStageState }
 	%struct.GLDRegisterCombinersFinalStageState = type { i8, i8, i8, i8, [7 x %struct.GLDRegisterCombinersPerVariableState] }
@@ -62,55 +62,55 @@ target triple = "powerpc-unknown-linux-gnu"
 	%struct.GLDRegisterCombinersPerStageState = type { [2 x %struct.GLDRegisterCombinersPerPortionState], [2 x %struct.GLTColor4] }
 	%struct.GLDRegisterCombinersPerVariableState = type { i16, i16, i16, i16 }
 	%struct.GLDScissorTest = type { %struct.GLTFixedColor4, i8, i8, i8, i8 }
-	%struct.GLDShaderSourceData = type { i32, i32, i8*, i32*, i32, i32, i8*, i32*, i8* }
+	%struct.GLDShaderSourceData = type { i32, i32, ptr, ptr, i32, i32, ptr, ptr, ptr }
 	%struct.GLDSharedRec = type opaque
-	%struct.GLDState = type { i16, i16, i32, i32, i32, [256 x %struct.GLTColor4], [128 x %struct.GLTColor4], %struct.GLDViewport, %struct.GLDTransform, %struct.GLDLightModel, i32*, i32, i32, i32, %struct.GLDAlphaTest, %struct.GLDBlendMode, %struct.GLDClearColor, %struct.GLDColorBuffer, %struct.GLDDepthTest, %struct.GLDArrayRange, %struct.GLDFogMode, %struct.GLDHintMode, %struct.GLDLineMode, %struct.GLDLogicOp, %struct.GLDMaskMode, %struct.GLDPixelMode, %struct.GLDPointMode, %struct.GLDPolygonMode, %struct.GLDScissorTest, i32, %struct.GLDStencilTest, [16 x %struct.GLDTextureMode], %struct.GLDArrayRange, [8 x %struct.GLDTextureCoordGen], %struct.GLDClipPlane, %struct.GLDMultisample, %struct.GLDRegisterCombiners, %struct.GLDArrayRange, %struct.GLDArrayRange, [3 x %struct.GLDPipelineProgramState], %struct.GLDTransformFeedback }
-	%struct.GLDStateProgramRec = type { %struct.GLDPipelineProgramData*, %struct.GLDPipelineProgramRec* }
+	%struct.GLDState = type { i16, i16, i32, i32, i32, [256 x %struct.GLTColor4], [128 x %struct.GLTColor4], %struct.GLDViewport, %struct.GLDTransform, %struct.GLDLightModel, ptr, i32, i32, i32, %struct.GLDAlphaTest, %struct.GLDBlendMode, %struct.GLDClearColor, %struct.GLDColorBuffer, %struct.GLDDepthTest, %struct.GLDArrayRange, %struct.GLDFogMode, %struct.GLDHintMode, %struct.GLDLineMode, %struct.GLDLogicOp, %struct.GLDMaskMode, %struct.GLDPixelMode, %struct.GLDPointMode, %struct.GLDPolygonMode, %struct.GLDScissorTest, i32, %struct.GLDStencilTest, [16 x %struct.GLDTextureMode], %struct.GLDArrayRange, [8 x %struct.GLDTextureCoordGen], %struct.GLDClipPlane, %struct.GLDMultisample, %struct.GLDRegisterCombiners, %struct.GLDArrayRange, %struct.GLDArrayRange, [3 x %struct.GLDPipelineProgramState], %struct.GLDTransformFeedback }
+	%struct.GLDStateProgramRec = type { ptr, ptr }
 	%struct.GLDStencilTest = type { [3 x { i32, i32, i16, i16, i16, i16 }], i32, [4 x i8] }
 	%struct.GLDStippleData = type { i32, i16, i16, [32 x [32 x i8]] }
 	%struct.GLDTextureCoordGen = type { { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, i8, i8, i8, i8 }
 	%struct.GLDTextureGeomState = type { i16, i16, i16, i16, i16, i8, i8, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, [6 x i16], [6 x i16] }
-	%struct.GLDTextureLevel = type { i32, i32, i16, i16, i16, i8, i8, i16, i16, i16, i16, i8* }
-	%struct.GLDTextureMachine = type { [8 x %struct.GLDTextureRec*], %struct.GLDTextureRec*, i8, i8, i8, i8 }
+	%struct.GLDTextureLevel = type { i32, i32, i16, i16, i16, i8, i8, i16, i16, i16, i16, ptr }
+	%struct.GLDTextureMachine = type { [8 x ptr], ptr, i8, i8, i8, i8 }
 	%struct.GLDTextureMode = type { %struct.GLTColor4, i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, float, float, float, i16, i16, i16, i16, i16, i16, [4 x i16], i8, i8, i8, i8, [3 x float], [4 x float], float, float }
-	%struct.GLDTextureParamState = type { i16, i16, i16, i16, i16, i16, %struct.GLTColor4, float, float, float, float, i16, i16, i16, i16, float, i16, i8, i8, i32, i8* }
-	%struct.GLDTextureRec = type { %struct.GLDTextureState*, i32, [2 x float], float, i32, float, float, float, float, float, float, %struct.GLDMipmaplevel*, %struct.GLDMipmaplevel*, i32, i32, i32, i32, i32, i32, %struct.GLDTextureParamState, i32, [2 x %struct._PPStreamToken] }
-	%struct.GLDTextureState = type { i16, i16, i16, float, i32, i16, %struct.GLISWRSurface*, i8, i8, i8, i8, %struct.GLDTextureParamState, %struct.GLDTextureGeomState, %struct.GLDTextureLevel, [6 x [15 x %struct.GLDTextureLevel]] }
+	%struct.GLDTextureParamState = type { i16, i16, i16, i16, i16, i16, %struct.GLTColor4, float, float, float, float, i16, i16, i16, i16, float, i16, i8, i8, i32, ptr }
+	%struct.GLDTextureRec = type { ptr, i32, [2 x float], float, i32, float, float, float, float, float, float, ptr, ptr, i32, i32, i32, i32, i32, i32, %struct.GLDTextureParamState, i32, [2 x %struct._PPStreamToken] }
+	%struct.GLDTextureState = type { i16, i16, i16, float, i32, i16, ptr, i8, i8, i8, i8, %struct.GLDTextureParamState, %struct.GLDTextureGeomState, %struct.GLDTextureLevel, [6 x [15 x %struct.GLDTextureLevel]] }
 	%struct.GLDTransform = type { [24 x [16 x float]], [24 x [16 x float]], [16 x float], float, float, float, float, i32, float, i16, i16, i8, i8, i8, i8 }
 	%struct.GLDTransformFeedback = type { i8, i8, i8, [16 x i32], [16 x i32] }
-	%struct.GLDVertex = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, %struct.GLTColor4, float, float, float, i8, i8, i8, i8, [4 x float], [2 x %struct.GLDMaterial*], i32, i32, [8 x %struct.GLTColor4] }
+	%struct.GLDVertex = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, %struct.GLTColor4, float, float, float, i8, i8, i8, i8, [4 x float], [2 x ptr], i32, i32, [8 x %struct.GLTColor4] }
 	%struct.GLDVertexArrayRec = type opaque
 	%struct.GLDViewport = type { float, float, float, float, float, float, float, float, double, double, i32, i32, i32, i32, float, float, float, float }
-	%struct.GLGColorTable = type { i32, i32, i32, i8* }
-	%struct.GLGOperation = type { i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, %struct.GLGColorTable, %struct.GLGColorTable, %struct.GLGColorTable }
-	%struct.GLGProcessor = type { void (%struct.GLDPixelMode*, %struct.GLGOperation*, %struct._GLGFunctionKey*)*, %struct._GLVMFunction*, %struct._GLGFunctionKey* }
-	%struct.GLISWRSurface = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i8*, [4 x i8*], i32 }
+	%struct.GLGColorTable = type { i32, i32, i32, ptr }
+	%struct.GLGOperation = type { ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, %struct.GLGColorTable, %struct.GLGColorTable, %struct.GLGColorTable }
+	%struct.GLGProcessor = type { ptr, ptr, ptr }
+	%struct.GLISWRSurface = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, [4 x ptr], i32 }
 	%struct.GLIWindow = type { i32, i32, i32 }
-	%struct.GLSBuffer = type { i8* }
-	%struct.GLSDrawable = type { %struct.GLSWindowRec* }
-	%struct.GLSWindowRec = type { %struct.GLTDimensions, %struct.GLTDimensions, i32, i32, %struct.GLSDrawable, [2 x i8*], i8*, i8*, i8*, [4 x i8*], i32, i32, i32, i32, [4 x i32], i16, i16, i16, %struct.GLIWindow, i32, i32, i8*, i8* }
+	%struct.GLSBuffer = type { ptr }
+	%struct.GLSDrawable = type { ptr }
+	%struct.GLSWindowRec = type { %struct.GLTDimensions, %struct.GLTDimensions, i32, i32, %struct.GLSDrawable, [2 x ptr], ptr, ptr, ptr, [4 x ptr], i32, i32, i32, i32, [4 x i32], i16, i16, i16, %struct.GLIWindow, i32, i32, ptr, ptr }
 	%struct.GLTColor4 = type { float, float, float, float }
 	%struct.GLTCoord3 = type { float, float, float }
 	%struct.GLTDimensions = type { i32, i32 }
 	%struct.GLTFixedColor4 = type { i32, i32, i32, i32 }
 	%struct.GLVMFPContext = type { float, i32, i32, i32 }
 	%struct.GLVMFragmentAttribRec = type { <4 x float>, <4 x float>, <4 x float>, <4 x float>, [8 x <4 x float>] }
-	%struct.GLVMTextures = type { [8 x %struct.GLDTextureRec*] }
+	%struct.GLVMTextures = type { [8 x ptr] }
 	%struct._GLGFunctionKey = type opaque
 	%struct._GLVMConstants = type opaque
 	%struct._GLVMFunction = type opaque
 	%struct._PPStreamToken = type { { i16, i8, i8, i32 } }
 
-define void @gldLLVMVecPointRender(%struct.GLDContextRec* %ctx) {
+define void @gldLLVMVecPointRender(ptr %ctx) {
 entry:
-	%tmp.uip = getelementptr %struct.GLDContextRec, %struct.GLDContextRec* %ctx, i32 0, i32 22		; <i32*> [#uses=1]
-	%tmp = load i32, i32* %tmp.uip		; <i32> [#uses=3]
+	%tmp.uip = getelementptr %struct.GLDContextRec, ptr %ctx, i32 0, i32 22		; <ptr> [#uses=1]
+	%tmp = load i32, ptr %tmp.uip		; <i32> [#uses=3]
 	%tmp91 = lshr i32 %tmp, 5		; <i32> [#uses=1]
 	%tmp92 = trunc i32 %tmp91 to i1		; <i1> [#uses=1]
 	br i1 %tmp92, label %cond_true93, label %cond_next116
 cond_true93:		; preds = %entry
-	%tmp.upgrd.1 = getelementptr %struct.GLDContextRec, %struct.GLDContextRec* %ctx, i32 0, i32 31, i32 14		; <i32*> [#uses=1]
-	%tmp95 = load i32, i32* %tmp.upgrd.1		; <i32> [#uses=1]
+	%tmp.upgrd.1 = getelementptr %struct.GLDContextRec, ptr %ctx, i32 0, i32 31, i32 14		; <ptr> [#uses=1]
+	%tmp95 = load i32, ptr %tmp.upgrd.1		; <i32> [#uses=1]
 	%tmp95.upgrd.2 = sitofp i32 %tmp95 to float		; <float> [#uses=1]
 	%tmp108 = fmul float undef, %tmp95.upgrd.2		; <float> [#uses=1]
 	br label %cond_next116

diff  --git a/llvm/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll b/llvm/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll
index cc2a71ea1f0a..afa306dcc7fd 100644
--- a/llvm/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll
+++ b/llvm/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll
@@ -1,7 +1,7 @@
 ; RUN: opt < %s -passes=sccp -disable-output
 ; PR1431
 
-define void @_ada_bench() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @_ada_bench() personality ptr @__gxx_personality_v0 {
 entry:
 	br label %cond_next
 cond_next:		; preds = %cond_next, %entry
@@ -31,9 +31,9 @@ bb149:		; preds = %bb114
 bb177:		; preds = %bb149
 	unreachable
 cleanup:		; preds = %bb149, %bb114, %bb67
-        %val = landingpad { i8*, i32 }
+        %val = landingpad { ptr, i32 }
                  cleanup
-	resume { i8*, i32 } %val
+	resume { ptr, i32 } %val
 }
 
 declare double @sin(double)

diff  --git a/llvm/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll b/llvm/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll
index 2cc9e3edc52e..6ca5faabdd0f 100644
--- a/llvm/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll
+++ b/llvm/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll
@@ -2,12 +2,12 @@
 ; RUN: opt < %s -passes=ipsccp -S | grep "ret i32 undef"
 ; PR3325
 
-define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i32 @main() personality ptr @__gxx_personality_v0 {
 	%tmp1 = invoke i32 @f()
 			to label %UnifiedReturnBlock unwind label %lpad
 
 lpad:
-        %val = landingpad { i8*, i32 }
+        %val = landingpad { ptr, i32 }
                  cleanup
 	unreachable
 
@@ -19,7 +19,7 @@ define internal i32 @f() {
        ret i32 42
 }
 
-declare i8* @__cxa_begin_catch(i8*) nounwind
+declare ptr @__cxa_begin_catch(ptr) nounwind
 
 declare void @__cxa_end_catch()
 

diff  --git a/llvm/test/Transforms/SCCP/2009-09-24-byval-ptr.ll b/llvm/test/Transforms/SCCP/2009-09-24-byval-ptr.ll
index 7995dfaf6dd0..c2a3c12ec7da 100644
--- a/llvm/test/Transforms/SCCP/2009-09-24-byval-ptr.ll
+++ b/llvm/test/Transforms/SCCP/2009-09-24-byval-ptr.ll
@@ -5,43 +5,43 @@
 ; PR5038
 
 %struct.MYstr = type { i8, i32 }
- at mystr = internal global %struct.MYstr zeroinitializer ; <%struct.MYstr*> [#uses=3]
-define internal void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind {
+ at mystr = internal global %struct.MYstr zeroinitializer ; <ptr> [#uses=3]
+define internal void @vfu1(ptr byval(%struct.MYstr) align 4 %u) nounwind {
 ; CHECK-LABEL: @vfu1(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* [[U:%.*]], i32 0, i32 1
-; CHECK-NEXT:    store i32 99, i32* [[TMP0]], align 4
-; CHECK-NEXT:    [[TMP1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0
-; CHECK-NEXT:    store i8 97, i8* [[TMP1]], align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], ptr [[U:%.*]], i32 0, i32 1
+; CHECK-NEXT:    store i32 99, ptr [[TMP0]], align 4
+; CHECK-NEXT:    [[TMP1:%.*]] = getelementptr [[STRUCT_MYSTR]], ptr [[U]], i32 0, i32 0
+; CHECK-NEXT:    store i8 97, ptr [[TMP1]], align 4
 ; CHECK-NEXT:    br label [[RETURN:%.*]]
 ; CHECK:       return:
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1]
-  store i32 99, i32* %0, align 4
-  %1 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1]
-  store i8 97, i8* %1, align 4
+  %0 = getelementptr %struct.MYstr, ptr %u, i32 0, i32 1 ; <ptr> [#uses=1]
+  store i32 99, ptr %0, align 4
+  %1 = getelementptr %struct.MYstr, ptr %u, i32 0, i32 0 ; <ptr> [#uses=1]
+  store i8 97, ptr %1, align 4
   br label %return
 
 return:                                           ; preds = %entry
   ret void
 }
 
-define internal i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly {
+define internal i32 @vfu2(ptr byval(%struct.MYstr) align 4 %u) nounwind readonly {
 ; CHECK-LABEL: @vfu2(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* getelementptr inbounds ([[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1), align 4
-; CHECK-NEXT:    [[TMP1:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0), align 1
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr getelementptr inbounds ([[STRUCT_MYSTR:%.*]], ptr @mystr, i32 0, i32 1), align 4
+; CHECK-NEXT:    [[TMP1:%.*]] = load i8, ptr @mystr, align 1
 ; CHECK-NEXT:    [[TMP2:%.*]] = zext i8 [[TMP1]] to i32
 ; CHECK-NEXT:    [[TMP3:%.*]] = add i32 [[TMP2]], [[TMP0]]
 ; CHECK-NEXT:    ret i32 [[TMP3]]
 ;
 entry:
-  %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1]
-  %1 = load i32, i32* %0
-  %2 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1]
-  %3 = load i8, i8* %2
+  %0 = getelementptr %struct.MYstr, ptr %u, i32 0, i32 1 ; <ptr> [#uses=1]
+  %1 = load i32, ptr %0
+  %2 = getelementptr %struct.MYstr, ptr %u, i32 0, i32 0 ; <ptr> [#uses=1]
+  %3 = load i8, ptr %2
   %4 = zext i8 %3 to i32
   %5 = add i32 %4, %1
   ret i32 %5
@@ -50,13 +50,13 @@ entry:
 define i32 @unions() nounwind {
 ; CHECK-LABEL: @unions(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    call void @vfu1(%struct.MYstr* byval([[STRUCT_MYSTR:%.*]]) align 4 @mystr) #[[ATTR0:[0-9]+]]
-; CHECK-NEXT:    [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* byval([[STRUCT_MYSTR]]) align 4 @mystr) #[[ATTR0]]
+; CHECK-NEXT:    call void @vfu1(ptr byval([[STRUCT_MYSTR:%.*]]) align 4 @mystr) #[[ATTR0:[0-9]+]]
+; CHECK-NEXT:    [[RESULT:%.*]] = call i32 @vfu2(ptr byval([[STRUCT_MYSTR]]) align 4 @mystr) #[[ATTR0]]
 ; CHECK-NEXT:    ret i32 [[RESULT]]
 ;
 entry:
-  call void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
-  %result = call i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
+  call void @vfu1(ptr byval(%struct.MYstr) align 4 @mystr) nounwind
+  %result = call i32 @vfu2(ptr byval(%struct.MYstr) align 4 @mystr) nounwind
   ret i32 %result
 }
 

diff  --git a/llvm/test/Transforms/SCCP/PR26044.ll b/llvm/test/Transforms/SCCP/PR26044.ll
index 2a8ac7c3971a..90ac3101d0c2 100644
--- a/llvm/test/Transforms/SCCP/PR26044.ll
+++ b/llvm/test/Transforms/SCCP/PR26044.ll
@@ -3,16 +3,16 @@
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define void @fn2(i32* %P) {
+define void @fn2(ptr %P) {
 ; CHECK-LABEL: define {{[^@]+}}@fn2
-; CHECK-SAME: (i32* [[P:%.*]]) {
+; CHECK-SAME: (ptr [[P:%.*]]) {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[IF_END:%.*]]
 ; CHECK:       for.cond1:
 ; CHECK-NEXT:    unreachable
 ; CHECK:       if.end:
 ; CHECK-NEXT:    [[CALL:%.*]] = call i32 @fn1(i32 undef)
-; CHECK-NEXT:    store i32 [[CALL]], i32* [[P]], align 4
+; CHECK-NEXT:    store i32 [[CALL]], ptr [[P]], align 4
 ; CHECK-NEXT:    br label [[FOR_COND1:%.*]]
 ;
 entry:
@@ -22,10 +22,10 @@ for.cond1:                                        ; preds = %if.end, %for.end
   br i1 undef, label %if.end, label %if.end
 
 if.end:                                           ; preds = %lbl, %for.cond1
-  %e.2 = phi i32* [ undef, %entry ], [ null, %for.cond1 ], [ null, %for.cond1 ]
-  %0 = load i32, i32* %e.2, align 4
+  %e.2 = phi ptr [ undef, %entry ], [ null, %for.cond1 ], [ null, %for.cond1 ]
+  %0 = load i32, ptr %e.2, align 4
   %call = call i32 @fn1(i32 %0)
-  store i32 %call, i32* %P
+  store i32 %call, ptr %P
   br label %for.cond1
 }
 
@@ -43,16 +43,16 @@ entry:
   ret i32 %cond
 }
 
-define void @fn_no_null_opt(i32* %P) #0 {
+define void @fn_no_null_opt(ptr %P) #0 {
 ; CHECK-LABEL: define {{[^@]+}}@fn_no_null_opt
-; CHECK-SAME: (i32* [[P:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: (ptr [[P:%.*]]) #[[ATTR0:[0-9]+]] {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[IF_END:%.*]]
 ; CHECK:       for.cond1:
 ; CHECK-NEXT:    unreachable
 ; CHECK:       if.end:
 ; CHECK-NEXT:    [[CALL:%.*]] = call i32 @fn0(i32 undef)
-; CHECK-NEXT:    store i32 [[CALL]], i32* [[P]], align 4
+; CHECK-NEXT:    store i32 [[CALL]], ptr [[P]], align 4
 ; CHECK-NEXT:    br label [[FOR_COND1:%.*]]
 ;
 entry:
@@ -62,10 +62,10 @@ for.cond1:                                        ; preds = %if.end, %for.end
   br i1 undef, label %if.end, label %if.end
 
 if.end:                                           ; preds = %lbl, %for.cond1
-  %e.2 = phi i32* [ undef, %entry ], [ null, %for.cond1 ], [ null, %for.cond1 ]
-  %0 = load i32, i32* %e.2, align 4
+  %e.2 = phi ptr [ undef, %entry ], [ null, %for.cond1 ], [ null, %for.cond1 ]
+  %0 = load i32, ptr %e.2, align 4
   %call = call i32 @fn0(i32 %0)
-  store i32 %call, i32* %P
+  store i32 %call, ptr %P
   br label %for.cond1
 }
 

diff  --git a/llvm/test/Transforms/SCCP/PR43857.ll b/llvm/test/Transforms/SCCP/PR43857.ll
index 51ad214e7766..70cf4ed772d7 100644
--- a/llvm/test/Transforms/SCCP/PR43857.ll
+++ b/llvm/test/Transforms/SCCP/PR43857.ll
@@ -4,7 +4,7 @@
 %struct.wobble = type { i32 }
 %struct.zot = type { %struct.wobble, %struct.wobble, %struct.wobble }
 
-declare dso_local fastcc float @bar(%struct.wobble* noalias, <8 x i32>) unnamed_addr
+declare dso_local fastcc float @bar(ptr noalias, <8 x i32>) unnamed_addr
 
 define %struct.zot @widget(<8 x i32> %arg) local_unnamed_addr {
 ; CHECK-LABEL: @widget(

diff  --git a/llvm/test/Transforms/SCCP/apint-array.ll b/llvm/test/Transforms/SCCP/apint-array.ll
index 4aa87b74bbeb..dc7d80ccecd6 100644
--- a/llvm/test/Transforms/SCCP/apint-array.ll
+++ b/llvm/test/Transforms/SCCP/apint-array.ll
@@ -6,16 +6,16 @@
 define i101 @array()
 {
 Head:
-   %A = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 1
+   %A = getelementptr [6 x i101], ptr @Y, i32 0, i32 1
 
-   %B = load i101, i101* %A
+   %B = load i101, ptr %A
    %C = icmp sge i101 %B, 1
    br i1 %C, label %True, label %False
 True:
    %D = and i101 %B, 1
    %E = trunc i101 %D to i32
-   %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 %E
-   %G = load i101, i101* %F
+   %F = getelementptr [6 x i101], ptr @Y, i32 0, i32 %E
+   %G = load i101, ptr %F
    br label %False
 False:
    %H = phi i101 [%G, %True], [-1, %Head]

diff  --git a/llvm/test/Transforms/SCCP/apint-bigarray.ll b/llvm/test/Transforms/SCCP/apint-bigarray.ll
index de4379bf3b5e..1d8c50efb539 100644
--- a/llvm/test/Transforms/SCCP/apint-bigarray.ll
+++ b/llvm/test/Transforms/SCCP/apint-bigarray.ll
@@ -2,22 +2,22 @@
 
 @G =  global [1000000 x i10000] zeroinitializer
 
-define internal i10000* @test(i10000 %Arg) {
-	%X = getelementptr [1000000 x i10000], [1000000 x i10000]* @G, i32 0, i32 999
-        store i10000 %Arg, i10000* %X
-	ret i10000* %X
+define internal ptr @test(i10000 %Arg) {
+	%X = getelementptr [1000000 x i10000], ptr @G, i32 0, i32 999
+        store i10000 %Arg, ptr %X
+	ret ptr %X
 }
 
 define i10000 @caller()
 {
-        %Y = call i10000* @test(i10000 -1)
-        %Z = load i10000, i10000* %Y
+        %Y = call ptr @test(i10000 -1)
+        %Z = load i10000, ptr %Y
         ret i10000 %Z 
 }
 
 define i10000 @caller2()
 {
-        %Y = call i10000* @test(i10000 1)
-        %Z = load i10000, i10000* %Y
+        %Y = call ptr @test(i10000 1)
+        %Z = load i10000, ptr %Y
         ret i10000 %Z 
 }

diff  --git a/llvm/test/Transforms/SCCP/apint-bigint2.ll b/llvm/test/Transforms/SCCP/apint-bigint2.ll
index b8b5f80d5067..79c0cfcf7da8 100644
--- a/llvm/test/Transforms/SCCP/apint-bigint2.ll
+++ b/llvm/test/Transforms/SCCP/apint-bigint2.ll
@@ -8,13 +8,13 @@ define i101 @array() {
 ; CHECK-LABEL: @array(
 ; CHECK-NEXT:    ret i101 123456789000000
 ;
-  %A = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 1
-  %B = load i101, i101* %A
+  %A = getelementptr [6 x i101], ptr @Y, i32 0, i32 1
+  %B = load i101, ptr %A
   %D = and i101 %B, 1
   %DD = or i101 %D, 1
   %E = trunc i101 %DD to i32
-  %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 %E
-  %G = load i101, i101* %F
+  %F = getelementptr [6 x i101], ptr @Y, i32 0, i32 %E
+  %G = load i101, ptr %F
 
   ret i101 %G
 }
@@ -23,16 +23,16 @@ define i101 @large_aggregate() {
 ; CHECK-LABEL: @large_aggregate(
 ; CHECK-NEXT:    [[D:%.*]] = and i101 undef, 1
 ; CHECK-NEXT:    [[DD:%.*]] = or i101 [[D]], 1
-; CHECK-NEXT:    [[G:%.*]] = getelementptr i101, i101* getelementptr inbounds ([6 x i101], [6 x i101]* @Y, i32 0, i32 5), i101 [[DD]]
-; CHECK-NEXT:    [[L3:%.*]] = load i101, i101* [[G]], align 4
+; CHECK-NEXT:    [[G:%.*]] = getelementptr i101, ptr getelementptr inbounds ([6 x i101], ptr @Y, i32 0, i32 5), i101 [[DD]]
+; CHECK-NEXT:    [[L3:%.*]] = load i101, ptr [[G]], align 4
 ; CHECK-NEXT:    ret i101 [[L3]]
 ;
-  %B = load i101, i101* undef
+  %B = load i101, ptr undef
   %D = and i101 %B, 1
   %DD = or i101 %D, 1
-  %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 5
-  %G = getelementptr i101, i101* %F, i101 %DD
-  %L3 = load i101, i101* %G
+  %F = getelementptr [6 x i101], ptr @Y, i32 0, i32 5
+  %G = getelementptr i101, ptr %F, i101 %DD
+  %L3 = load i101, ptr %G
   ret i101 %L3
 }
 
@@ -40,26 +40,26 @@ define i101 @large_aggregate_2() {
 ; CHECK-LABEL: @large_aggregate_2(
 ; CHECK-NEXT:    [[D:%.*]] = and i101 undef, 1
 ; CHECK-NEXT:    [[DD:%.*]] = or i101 [[D]], 1
-; CHECK-NEXT:    [[G:%.*]] = getelementptr i101, i101* getelementptr inbounds ([6 x i101], [6 x i101]* @Y, i32 0, i32 5), i101 [[DD]]
-; CHECK-NEXT:    [[L3:%.*]] = load i101, i101* [[G]], align 4
+; CHECK-NEXT:    [[G:%.*]] = getelementptr i101, ptr getelementptr inbounds ([6 x i101], ptr @Y, i32 0, i32 5), i101 [[DD]]
+; CHECK-NEXT:    [[L3:%.*]] = load i101, ptr [[G]], align 4
 ; CHECK-NEXT:    ret i101 [[L3]]
 ;
   %D = and i101 undef, 1
   %DD = or i101 %D, 1
-  %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 5
-  %G = getelementptr i101, i101* %F, i101 %DD
-  %L3 = load i101, i101* %G
+  %F = getelementptr [6 x i101], ptr @Y, i32 0, i32 5
+  %G = getelementptr i101, ptr %F, i101 %DD
+  %L3 = load i101, ptr %G
   ret i101 %L3
 }
 
 define void @index_too_large() {
 ; CHECK-LABEL: @index_too_large(
-; CHECK-NEXT:    store i101* getelementptr ([6 x i101], [6 x i101]* @Y, i101 1537416322793603071, i101 4), i101** undef, align 8
+; CHECK-NEXT:    store ptr getelementptr ([6 x i101], ptr @Y, i101 1537416322793603071, i101 4), ptr undef, align 8
 ; CHECK-NEXT:    ret void
 ;
-  %ptr1 = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 -1
-  %ptr2 = getelementptr i101, i101* %ptr1, i101 9224497936761618431
-  store i101* %ptr2, i101** undef
+  %ptr1 = getelementptr [6 x i101], ptr @Y, i32 0, i32 -1
+  %ptr2 = getelementptr i101, ptr %ptr1, i101 9224497936761618431
+  store ptr %ptr2, ptr undef
   ret void
 }
 
@@ -75,6 +75,6 @@ entry:
   %B5 = or i72 0, 2361183241434822606847
   %i = add nuw nsw i72 %B5, 0
   %i1 = lshr i72 %i, 1
-  %i2 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* bitcast ([16 x i8]* @0 to [4 x [4 x i8]]*), i72 0, i72 0, i72 %i1
+  %i2 = getelementptr inbounds [4 x [4 x i8]], ptr @0, i72 0, i72 0, i72 %i1
   ret void
 }

diff  --git a/llvm/test/Transforms/SCCP/apint-ipsccp3.ll b/llvm/test/Transforms/SCCP/apint-ipsccp3.ll
index c06adc0401d3..cc8a7c33136f 100644
--- a/llvm/test/Transforms/SCCP/apint-ipsccp3.ll
+++ b/llvm/test/Transforms/SCCP/apint-ipsccp3.ll
@@ -6,34 +6,34 @@
 
 define void @foo() {
 ; CHECK-LABEL: @foo(
-; CHECK-NEXT:    [[X:%.*]] = load i66, i66* @G
-; CHECK-NEXT:    store i66 [[X]], i66* @G
+; CHECK-NEXT:    [[X:%.*]] = load i66, ptr @G
+; CHECK-NEXT:    store i66 [[X]], ptr @G
 ; CHECK-NEXT:    ret void
 ;
-  %X = load i66, i66* @G
-  store i66 %X, i66* @G
+  %X = load i66, ptr @G
+  store i66 %X, ptr @G
   ret void
 }
 
 define i66 @bar() {
 ; CHECK-LABEL: @bar(
-; CHECK-NEXT:    [[V:%.*]] = load i66, i66* @G
+; CHECK-NEXT:    [[V:%.*]] = load i66, ptr @G
 ; CHECK-NEXT:    [[C:%.*]] = icmp eq i66 [[V]], 17
 ; CHECK-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
 ; CHECK:       T:
-; CHECK-NEXT:    store i66 17, i66* @G
+; CHECK-NEXT:    store i66 17, ptr @G
 ; CHECK-NEXT:    ret i66 17
 ; CHECK:       F:
-; CHECK-NEXT:    store i66 123, i66* @G
+; CHECK-NEXT:    store i66 123, ptr @G
 ; CHECK-NEXT:    ret i66 0
 ;
-  %V = load i66, i66* @G
+  %V = load i66, ptr @G
   %C = icmp eq i66 %V, 17
   br i1 %C, label %T, label %F
 T:
-  store i66 17, i66* @G
+  store i66 17, ptr @G
   ret i66 %V
 F:
-  store i66 123, i66* @G
+  store i66 123, ptr @G
   ret i66 0
 }

diff  --git a/llvm/test/Transforms/SCCP/apint-ipsccp4.ll b/llvm/test/Transforms/SCCP/apint-ipsccp4.ll
index 1eb0770ecf10..e080c6b01fbf 100644
--- a/llvm/test/Transforms/SCCP/apint-ipsccp4.ll
+++ b/llvm/test/Transforms/SCCP/apint-ipsccp4.ll
@@ -9,14 +9,14 @@
                                      { i212, float } { i212 37, float 2.0 } ]
 
 define internal float @test2() {
-	%A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1
-	%B = load float, float* %A
+	%A = getelementptr [2 x { i212, float}], ptr @Y, i32 0, i32 1, i32 1
+	%B = load float, ptr %A
 	ret float %B
 }
 
 define internal float  @test3() {
-	%A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 0, i32 1
-	%B = load float, float* %A
+	%A = getelementptr [2 x { i212, float}], ptr @Y, i32 0, i32 0, i32 1
+	%B = load float, ptr %A
 	ret float %B
 }
 

diff  --git a/llvm/test/Transforms/SCCP/apint-load.ll b/llvm/test/Transforms/SCCP/apint-load.ll
index c2835880e149..d639f22b7d2e 100644
--- a/llvm/test/Transforms/SCCP/apint-load.ll
+++ b/llvm/test/Transforms/SCCP/apint-load.ll
@@ -7,19 +7,19 @@
 @Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 }, 
                                      { i212, float } { i212 37, float 0x3FF3B2FEC0000000 } ]
 define i212 @test1() {
-	%B = load i212, i212* @X
+	%B = load i212, ptr @X
 	ret i212 %B
 }
 
 define internal float @test2() {
-	%A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1
-	%B = load float, float* %A
+	%A = getelementptr [2 x { i212, float}], ptr @Y, i32 0, i32 1, i32 1
+	%B = load float, ptr %A
 	ret float %B
 }
 
 define internal i212 @test3() {
-	%A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 0, i32 0
-	%B = load i212, i212* %A
+	%A = getelementptr [2 x { i212, float}], ptr @Y, i32 0, i32 0, i32 0
+	%B = load i212, ptr %A
 	ret i212 %B
 }
 

diff  --git a/llvm/test/Transforms/SCCP/apint-select.ll b/llvm/test/Transforms/SCCP/apint-select.ll
index fae261ab2651..de424282d016 100644
--- a/llvm/test/Transforms/SCCP/apint-select.ll
+++ b/llvm/test/Transforms/SCCP/apint-select.ll
@@ -5,13 +5,12 @@
 
 define i712 @test1() {
 ; CHECK-LABEL: @test1(
-; CHECK-NEXT:    [[BB:%.*]] = and i64 ptrtoint (i32* @A to i64), undef
+; CHECK-NEXT:    [[BB:%.*]] = and i64 ptrtoint (ptr @A to i64), undef
 ; CHECK-NEXT:    [[C:%.*]] = icmp sge i64 [[BB]], 0
 ; CHECK-NEXT:    [[X:%.*]] = select i1 [[C]], i712 0, i712 1
 ; CHECK-NEXT:    ret i712 [[X]]
 ;
-  %P = getelementptr i32, i32* @A, i32 0
-  %B = ptrtoint i32* %P to i64
+  %B = ptrtoint ptr @A to i64
   %BB = and i64 %B, undef
   %C = icmp sge i64 %BB, 0
   %X = select i1 %C, i712 0, i712 1

diff  --git a/llvm/test/Transforms/SCCP/arg-count-mismatch.ll b/llvm/test/Transforms/SCCP/arg-count-mismatch.ll
index 46f6dead526e..54bf8d349b83 100644
--- a/llvm/test/Transforms/SCCP/arg-count-mismatch.ll
+++ b/llvm/test/Transforms/SCCP/arg-count-mismatch.ll
@@ -33,10 +33,10 @@
 define dso_local void @foo(i16 %a) {
 ; CHECK-LABEL: define {{[^@]+}}@foo
 ; CHECK-SAME: (i16 [[A:%.*]]) {
-; CHECK-NEXT:    [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]])
+; CHECK-NEXT:    [[CALL:%.*]] = call i16 @bar(i16 [[A]])
 ; CHECK-NEXT:    ret void
 ;
-  %call = call i16 bitcast (i16 (i16, i16) * @bar to i16 (i16) *)(i16 %a)
+  %call = call i16 @bar(i16 %a)
   ret void
 }
 
@@ -65,12 +65,12 @@ define dso_local i16 @vararg_tests(i16 %a) {
 ; CHECK-LABEL: define {{[^@]+}}@vararg_tests
 ; CHECK-SAME: (i16 [[A:%.*]]) {
 ; CHECK-NEXT:    [[CALL1:%.*]] = call i16 (i16, ...) @vararg_prop(i16 7, i16 8, i16 [[A]])
-; CHECK-NEXT:    [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 7)
+; CHECK-NEXT:    [[CALL2:%.*]] = call i16 @vararg_no_prop(i16 7)
 ; CHECK-NEXT:    [[ADD:%.*]] = add i16 7, [[CALL2]]
 ; CHECK-NEXT:    ret i16 [[ADD]]
 ;
   %call1 = call i16 (i16, ...) @vararg_prop(i16 7, i16 8, i16 %a)
-  %call2 = call i16 bitcast (i16 (i16, i16, ...) * @vararg_no_prop to i16 (i16) *) (i16 7)
+  %call2 = call i16 @vararg_no_prop (i16 7)
   %add = add i16 %call1, %call2
   ret i16 %add
 }

diff  --git a/llvm/test/Transforms/SCCP/arg-type-mismatch.ll b/llvm/test/Transforms/SCCP/arg-type-mismatch.ll
index 52dfdfea924c..6361280801bf 100644
--- a/llvm/test/Transforms/SCCP/arg-type-mismatch.ll
+++ b/llvm/test/Transforms/SCCP/arg-type-mismatch.ll
@@ -7,10 +7,10 @@
 define dso_local void @foo(i16 %a) {
 ; CHECK-LABEL: define {{[^@]+}}@foo
 ; CHECK-SAME: (i16 [[A:%.*]]) {
-; CHECK-NEXT:    [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A]], i32 7)
+; CHECK-NEXT:    [[CALL:%.*]] = call i16 @bar(i16 [[A]], i32 7)
 ; CHECK-NEXT:    ret void
 ;
-  %call = call i16 bitcast (i16 (i16, i16) * @bar to i16 (i16, i32) *)(i16 %a, i32 7)
+  %call = call i16 @bar(i16 %a, i32 7)
   ret void
 }
 

diff  --git a/llvm/test/Transforms/SCCP/assume.ll b/llvm/test/Transforms/SCCP/assume.ll
index ffa3c5d5ba2d..8146d58d9a89 100644
--- a/llvm/test/Transforms/SCCP/assume.ll
+++ b/llvm/test/Transforms/SCCP/assume.ll
@@ -47,9 +47,9 @@ define void @basic(i32 %v) {
   ret void
 }
 
-define void @nonnull(i32* %v) {
+define void @nonnull(ptr %v) {
 ; CHECK-LABEL: @nonnull(
-; CHECK-NEXT:    [[A:%.*]] = icmp ne i32* [[V:%.*]], null
+; CHECK-NEXT:    [[A:%.*]] = icmp ne ptr [[V:%.*]], null
 ; CHECK-NEXT:    call void @llvm.assume(i1 [[A]])
 ; CHECK-NEXT:    call void @use(i1 false)
 ; CHECK-NEXT:    call void @use(i1 true)
@@ -57,15 +57,15 @@ define void @nonnull(i32* %v) {
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    ret void
 ;
-  %a = icmp ne i32* %v, null
+  %a = icmp ne ptr %v, null
   call void @llvm.assume(i1 %a)
-  %c1 = icmp eq i32* %v, null
+  %c1 = icmp eq ptr %v, null
   call void @use(i1 %c1)
-  %c2 = icmp ne i32* %v, null
+  %c2 = icmp ne ptr %v, null
   call void @use(i1 %c2)
-  %c3 = icmp eq i32* null, %v
+  %c3 = icmp eq ptr null, %v
   call void @use(i1 %c3)
-  %c4 = icmp ne i32* null, %v
+  %c4 = icmp ne ptr null, %v
   call void @use(i1 %c4)
   ret void
 }

diff  --git a/llvm/test/Transforms/SCCP/atomic-load-store.ll b/llvm/test/Transforms/SCCP/atomic-load-store.ll
index 21d4a9f8b0b9..ff7348260beb 100644
--- a/llvm/test/Transforms/SCCP/atomic-load-store.ll
+++ b/llvm/test/Transforms/SCCP/atomic-load-store.ll
@@ -6,14 +6,14 @@
 @C = internal constant i32 222
 
 define i32 @test1() {
-	%V = load atomic i32, i32* @G seq_cst, align 4
+	%V = load atomic i32, ptr @G seq_cst, align 4
 	%C = icmp eq i32 %V, 17
 	br i1 %C, label %T, label %F
 T:
-	store atomic i32 17, i32* @G seq_cst, align 4
+	store atomic i32 17, ptr @G seq_cst, align 4
 	ret i32 %V
 F:	
-	store atomic i32 123, i32* @G seq_cst, align 4
+	store atomic i32 123, ptr @G seq_cst, align 4
 	ret i32 0
 }
 ; CHECK-LABEL: define i32 @test1(
@@ -21,7 +21,7 @@ F:
 ; CHECK: ret i32 17
 
 define i32 @test2() {
-	%V = load atomic i32, i32* @C seq_cst, align 4
+	%V = load atomic i32, ptr @C seq_cst, align 4
 	ret i32 %V
 }
 

diff  --git a/llvm/test/Transforms/SCCP/atomic.ll b/llvm/test/Transforms/SCCP/atomic.ll
index 109fcf239e34..e1b2d44151db 100644
--- a/llvm/test/Transforms/SCCP/atomic.ll
+++ b/llvm/test/Transforms/SCCP/atomic.ll
@@ -1,9 +1,9 @@
 ; RUN: opt < %s -passes=sccp -S | FileCheck %s
 
-define i1 @test_cmpxchg(i32* %addr, i32 %desired, i32 %new) {
+define i1 @test_cmpxchg(ptr %addr, i32 %desired, i32 %new) {
 ; CHECK-LABEL: @test_cmpxchg
-; CHECK: cmpxchg i32* %addr, i32 %desired, i32 %new seq_cst seq_cst
-  %val = cmpxchg i32* %addr, i32 %desired, i32 %new seq_cst seq_cst
+; CHECK: cmpxchg ptr %addr, i32 %desired, i32 %new seq_cst seq_cst
+  %val = cmpxchg ptr %addr, i32 %desired, i32 %new seq_cst seq_cst
   %res = extractvalue { i32, i1 } %val, 1
   ret i1 %res
 }

diff  --git a/llvm/test/Transforms/SCCP/binaryops-constexprs.ll b/llvm/test/Transforms/SCCP/binaryops-constexprs.ll
index e87b04c2f188..43dacf23effd 100644
--- a/llvm/test/Transforms/SCCP/binaryops-constexprs.ll
+++ b/llvm/test/Transforms/SCCP/binaryops-constexprs.ll
@@ -18,9 +18,9 @@ define void @and_constexpr(i32 %a) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %and.1 = and i32 ptrtoint (i32* inttoptr (i32 0 to i32*) to i32), %a
+  %and.1 = and i32 ptrtoint (ptr inttoptr (i32 0 to ptr) to i32), %a
   call void @use.i32(i32 %and.1)
-  %and.2 = and i32 ptrtoint (i32* inttoptr (i32 20 to i32*) to i32), %a
+  %and.2 = and i32 ptrtoint (ptr inttoptr (i32 20 to ptr) to i32), %a
   call void @use.i32(i32 %and.2)
   %true.1 = icmp ne i32 %and.2, 100
   call void @use.i1(i1 %true.1)
@@ -28,7 +28,7 @@ entry:
   call void @use.i1(i1 %false.1)
   %cond.1 = icmp eq i32 %and.2, 10
   call void @use.i1(i1 %cond.1)
-  %and.3 = and i32 ptrtoint (i32* inttoptr (i32 20 to i32*) to i32), ptrtoint (i32* inttoptr (i32 100 to i32*) to i32)
+  %and.3 = and i32 ptrtoint (ptr inttoptr (i32 20 to ptr) to i32), ptrtoint (ptr inttoptr (i32 100 to ptr) to i32)
   call void @use.i32(i32 %and.3)
   ret void
 }
@@ -50,9 +50,9 @@ define void @add_constexpr(i32 %a) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %add.1 = add i32 ptrtoint (i32* inttoptr (i32 0 to i32*) to i32), %a
+  %add.1 = add i32 ptrtoint (ptr inttoptr (i32 0 to ptr) to i32), %a
   call void @use.i32(i32 %add.1)
-  %add.2 = add i32 ptrtoint (i32* inttoptr (i32 20 to i32*) to i32), %a
+  %add.2 = add i32 ptrtoint (ptr inttoptr (i32 20 to ptr) to i32), %a
   call void @use.i32(i32 %add.2)
   %cond.1 = icmp ne i32 %add.2, 100
   call void @use.i1(i1 %cond.1)
@@ -60,7 +60,7 @@ entry:
   call void @use.i1(i1 %cond.2)
   %cond.3 = icmp eq i32 %add.2, 10
   call void @use.i1(i1 %cond.3)
-  %add.3 = add i32 ptrtoint (i32* inttoptr (i32 20 to i32*) to i32), ptrtoint (i32* inttoptr (i32 100 to i32*) to i32)
+  %add.3 = add i32 ptrtoint (ptr inttoptr (i32 20 to ptr) to i32), ptrtoint (ptr inttoptr (i32 100 to ptr) to i32)
   call void @use.i32(i32 %add.3)
   ret void
 }
@@ -81,9 +81,9 @@ define void @mul_constexpr(i32 %a) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %mul.1 = mul i32 ptrtoint (i32* inttoptr (i32 0 to i32*) to i32), %a
+  %mul.1 = mul i32 ptrtoint (ptr inttoptr (i32 0 to ptr) to i32), %a
   call void @use.i32(i32 %mul.1)
-  %mul.2 = mul i32 ptrtoint (i32* inttoptr (i32 20 to i32*) to i32), %a
+  %mul.2 = mul i32 ptrtoint (ptr inttoptr (i32 20 to ptr) to i32), %a
   call void @use.i32(i32 %mul.2)
   %cond.1 = icmp ne i32 %mul.2, 100
   call void @use.i1(i1 %cond.1)
@@ -91,7 +91,7 @@ entry:
   call void @use.i1(i1 %cond.2)
   %cond.3 = icmp eq i32 %mul.2, 10
   call void @use.i1(i1 %cond.3)
-  %mul.3 = mul i32 ptrtoint (i32* inttoptr (i32 20 to i32*) to i32), ptrtoint (i32* inttoptr (i32 100 to i32*) to i32)
+  %mul.3 = mul i32 ptrtoint (ptr inttoptr (i32 20 to ptr) to i32), ptrtoint (ptr inttoptr (i32 100 to ptr) to i32)
   call void @use.i32(i32 %mul.3)
   ret void
 }
@@ -110,9 +110,9 @@ define void @udiv_constexpr(i32 %a) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %udiv.1 = udiv i32 ptrtoint (i32* inttoptr (i32 0 to i32*) to i32), %a
+  %udiv.1 = udiv i32 ptrtoint (ptr inttoptr (i32 0 to ptr) to i32), %a
   call void @use.i32(i32 %udiv.1)
-  %udiv.2 = udiv i32 ptrtoint (i32* inttoptr (i32 20 to i32*) to i32), %a
+  %udiv.2 = udiv i32 ptrtoint (ptr inttoptr (i32 20 to ptr) to i32), %a
   call void @use.i32(i32 %udiv.2)
   %true.1 = icmp ne i32 %udiv.2, 100
   call void @use.i1(i1 %true.1)
@@ -120,7 +120,7 @@ entry:
   call void @use.i1(i1 %false.1)
   %cond.1 = icmp eq i32 %udiv.2, 10
   call void @use.i1(i1 %cond.1)
-  %udiv.3 = udiv i32 ptrtoint (i32* inttoptr (i32 20 to i32*) to i32), ptrtoint (i32* inttoptr (i32 100 to i32*) to i32)
+  %udiv.3 = udiv i32 ptrtoint (ptr inttoptr (i32 20 to ptr) to i32), ptrtoint (ptr inttoptr (i32 100 to ptr) to i32)
   call void @use.i32(i32 %udiv.3)
   ret void
 }

diff  --git a/llvm/test/Transforms/SCCP/clang-arc-rv.ll b/llvm/test/Transforms/SCCP/clang-arc-rv.ll
index 248ae31c8cf7..7411a8d52bc2 100644
--- a/llvm/test/Transforms/SCCP/clang-arc-rv.ll
+++ b/llvm/test/Transforms/SCCP/clang-arc-rv.ll
@@ -5,23 +5,23 @@
 
 @g0 = global i8 zeroinitializer, align 1
 
-define internal i8* @foo() {
+define internal ptr @foo() {
 ; CHECK-LABEL: @foo(
-; CHECK-NEXT:    ret i8* @g0
+; CHECK-NEXT:    ret ptr @g0
 ;
-  ret i8* @g0
+  ret ptr @g0
 }
 
 define void @test() {
 ; CHECK-LABEL: @test(
-; CHECK-NEXT:    [[R:%.*]] = call i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
-; CHECK-NEXT:    call void (...) @llvm.objc.clang.arc.noop.use(i8* [[R]])
+; CHECK-NEXT:    [[R:%.*]] = call ptr @foo() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
+; CHECK-NEXT:    call void (...) @llvm.objc.clang.arc.noop.use(ptr [[R]])
 ; CHECK-NEXT:    ret void
 ;
-  %r = call i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
-  call void (...) @llvm.objc.clang.arc.noop.use(i8* %r)
+  %r = call ptr @foo() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
+  call void (...) @llvm.objc.clang.arc.noop.use(ptr %r)
   ret void
 }
 
-declare i8* @llvm.objc.unsafeClaimAutoreleasedReturnValue(i8*)
+declare ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue(ptr)
 declare void @llvm.objc.clang.arc.noop.use(...)

diff  --git a/llvm/test/Transforms/SCCP/conditions-iter-order.ll b/llvm/test/Transforms/SCCP/conditions-iter-order.ll
index a9187b76d919..c7f977b8ab83 100644
--- a/llvm/test/Transforms/SCCP/conditions-iter-order.ll
+++ b/llvm/test/Transforms/SCCP/conditions-iter-order.ll
@@ -1,71 +1,67 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt -passes=ipsccp -S %s | FileCheck %s
 
-declare noalias i8* @malloc(i64)
+declare noalias ptr @malloc(i64)
 
 ; Make sure we can eliminate `%tmp17 = icmp ult i32 %tmp10, 3`.
 
 declare void @use(i1)
 
-define internal i32* @spam(i32* %arg) {
+define internal ptr @spam(ptr %arg) {
 ; CHECK-LABEL: @spam(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = call i8* @malloc(i64 10368)
-; CHECK-NEXT:    [[TMP1:%.*]] = bitcast i8* [[TMP]] to i32*
-; CHECK-NEXT:    [[TMP4:%.*]] = getelementptr inbounds i32, i32* [[ARG:%.*]], i32 0
-; CHECK-NEXT:    [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 8
+; CHECK-NEXT:    [[TMP:%.*]] = call ptr @malloc(i64 10368)
+; CHECK-NEXT:    [[TMP5:%.*]] = load i32, ptr [[ARG:%.*]], align 8
 ; CHECK-NEXT:    [[TMP6:%.*]] = add i32 [[TMP5]], 1
-; CHECK-NEXT:    [[TMP7:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i32 1
-; CHECK-NEXT:    [[TMP10:%.*]] = icmp ne i32* [[TMP7]], null
+; CHECK-NEXT:    [[TMP7:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i32 1
+; CHECK-NEXT:    [[TMP10:%.*]] = icmp ne ptr [[TMP7]], null
 ; CHECK-NEXT:    br i1 [[TMP10]], label [[BB17:%.*]], label [[BB13:%.*]]
 ; CHECK:       bb13:
-; CHECK-NEXT:    [[TMP14:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i32 2
-; CHECK-NEXT:    [[TMP15:%.*]] = load i32, i32* [[TMP14]], align 8
+; CHECK-NEXT:    [[TMP14:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i32 2
+; CHECK-NEXT:    [[TMP15:%.*]] = load i32, ptr [[TMP14]], align 8
 ; CHECK-NEXT:    [[TMP16:%.*]] = add i32 [[TMP15]], 1
 ; CHECK-NEXT:    br label [[BB30:%.*]]
 ; CHECK:       bb17:
 ; CHECK-NEXT:    [[TMP18:%.*]] = icmp eq i32 [[TMP6]], [[TMP5]]
-; CHECK-NEXT:    [[TMP19:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i32 3
-; CHECK-NEXT:    [[TMP20:%.*]] = load i32, i32* [[TMP19]], align 8
+; CHECK-NEXT:    [[TMP19:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i32 3
+; CHECK-NEXT:    [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 8
 ; CHECK-NEXT:    br i1 [[TMP18]], label [[BB30]], label [[BB13]]
 ; CHECK:       bb30:
-; CHECK-NEXT:    ret i32* [[TMP1]]
+; CHECK-NEXT:    ret ptr [[TMP]]
 ;
 bb:
-  %tmp = call i8* @malloc(i64 10368)
-  %tmp1 = bitcast i8* %tmp to i32*
-  %tmp4 = getelementptr inbounds i32, i32* %arg, i32 0
-  %tmp5 = load i32, i32* %tmp4, align 8
+  %tmp = call ptr @malloc(i64 10368)
+  %tmp5 = load i32, ptr %arg, align 8
   %tmp6 = add i32 %tmp5, 1
-  %tmp7 = getelementptr inbounds i32, i32* %arg, i32 1
-  %tmp10 = icmp ne i32* %tmp7, null
+  %tmp7 = getelementptr inbounds i32, ptr %arg, i32 1
+  %tmp10 = icmp ne ptr %tmp7, null
   br i1 %tmp10, label %bb17, label %bb13
 
 bb13:
-  %tmp14 = getelementptr inbounds i32, i32* %arg, i32 2
-  %tmp15 = load i32, i32* %tmp14, align 8
+  %tmp14 = getelementptr inbounds i32, ptr %arg, i32 2
+  %tmp15 = load i32, ptr %tmp14, align 8
   %tmp16 = add i32 %tmp15, 1
   br label %bb30
 
 bb17:
   %tmp18 = icmp eq i32 %tmp6, %tmp5
-  %tmp19 = getelementptr inbounds i32, i32* %arg, i32 3
-  %tmp20 = load i32, i32* %tmp19, align 8
+  %tmp19 = getelementptr inbounds i32, ptr %arg, i32 3
+  %tmp20 = load i32, ptr %tmp19, align 8
   br i1 %tmp18, label %bb30, label %bb13
 
 bb30:
-  ret i32* %tmp1
+  ret ptr %tmp
 }
 
-define void @spam.1(i32* %arg) {
+define void @spam.1(ptr %arg) {
 bb:
-  %tmp = alloca i8*, align 8
-  %tmp4 = call i32* @spam(i32* %arg)
+  %tmp = alloca ptr, align 8
+  %tmp4 = call ptr @spam(ptr %arg)
   br label %bb6
 
 bb6:                                              ; preds = %bb5
-  %tmp7 = getelementptr inbounds i32, i32* %tmp4, i32 1
-  %tmp10 = load i32, i32* %tmp7, align 8
+  %tmp7 = getelementptr inbounds i32, ptr %tmp4, i32 1
+  %tmp10 = load i32, ptr %tmp7, align 8
   %tmp11 = icmp ne i32 %tmp10, 0
   br i1 %tmp11, label %bb6, label %bb15
 

diff  --git a/llvm/test/Transforms/SCCP/conditions-ranges.ll b/llvm/test/Transforms/SCCP/conditions-ranges.ll
index 9c63b7c0f39b..3d4b529dbc79 100644
--- a/llvm/test/Transforms/SCCP/conditions-ranges.ll
+++ b/llvm/test/Transforms/SCCP/conditions-ranges.ll
@@ -85,55 +85,55 @@ false: ;%b in [0, 276)
   ret void
 }
 
-define void @f2_ptr(i8* %a, i8* %b) {
+define void @f2_ptr(ptr %a, ptr %b) {
 ; CHECK-LABEL: @f2_ptr(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[BC:%.*]] = icmp eq i8* [[A:%.*]], null
+; CHECK-NEXT:    [[BC:%.*]] = icmp eq ptr [[A:%.*]], null
 ; CHECK-NEXT:    br i1 [[BC]], label [[TRUE:%.*]], label [[FALSE:%.*]]
 ; CHECK:       true:
 ; CHECK-NEXT:    call void @use(i1 false)
 ; CHECK-NEXT:    call void @use(i1 true)
-; CHECK-NEXT:    [[C_1:%.*]] = icmp eq i8* null, [[B:%.*]]
+; CHECK-NEXT:    [[C_1:%.*]] = icmp eq ptr null, [[B:%.*]]
 ; CHECK-NEXT:    call void @use(i1 [[C_1]])
 ; CHECK-NEXT:    ret void
 ; CHECK:       false:
 ; CHECK-NEXT:    call void @use(i1 false)
 ; CHECK-NEXT:    call void @use(i1 true)
-; CHECK-NEXT:    [[C_2:%.*]] = icmp eq i8* [[A]], [[B]]
+; CHECK-NEXT:    [[C_2:%.*]] = icmp eq ptr [[A]], [[B]]
 ; CHECK-NEXT:    call void @use(i1 [[C_2]])
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %bc = icmp eq i8* %a, null
+  %bc = icmp eq ptr %a, null
   br i1 %bc, label %true, label %false
 
 true: ; %a == 0
-  %f.1 = icmp ne i8* %a, null
+  %f.1 = icmp ne ptr %a, null
   call void @use(i1 %f.1)
 
-  %t.1 = icmp eq i8* %a, null
+  %t.1 = icmp eq ptr %a, null
   call void @use(i1 %t.1)
 
-  %c.1 = icmp eq i8* %a, %b
+  %c.1 = icmp eq ptr %a, %b
   call void @use(i1 %c.1)
   ret void
 
 false: ; %a != 0
-  %f.2 = icmp eq i8* %a, null
+  %f.2 = icmp eq ptr %a, null
   call void @use(i1 %f.2)
 
-  %t.2 = icmp ne i8* %a, null
+  %t.2 = icmp ne ptr %a, null
   call void @use(i1 %t.2)
 
-  %c.2 = icmp eq i8* %a, %b
+  %c.2 = icmp eq ptr %a, %b
   call void @use(i1 %c.2)
   ret void
 }
 
-define i8* @f3(i8* %a, i8* %b, i1 %c) {
+define ptr @f3(ptr %a, ptr %b, i1 %c) {
 ; CHECK-LABEL: @f3(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[C_1:%.*]] = icmp eq i8* [[A:%.*]], null
+; CHECK-NEXT:    [[C_1:%.*]] = icmp eq ptr [[A:%.*]], null
 ; CHECK-NEXT:    br i1 [[C_1]], label [[TRUE:%.*]], label [[FALSE:%.*]]
 ; CHECK:       true:
 ; CHECK-NEXT:    br i1 [[C:%.*]], label [[TRUE_2:%.*]], label [[FALSE_2:%.*]]
@@ -142,13 +142,13 @@ define i8* @f3(i8* %a, i8* %b, i1 %c) {
 ; CHECK:       false.2:
 ; CHECK-NEXT:    br label [[EXIT_2]]
 ; CHECK:       exit.2:
-; CHECK-NEXT:    [[P:%.*]] = phi i8* [ null, [[TRUE_2]] ], [ [[B:%.*]], [[FALSE_2]] ]
-; CHECK-NEXT:    ret i8* [[P]]
+; CHECK-NEXT:    [[P:%.*]] = phi ptr [ null, [[TRUE_2]] ], [ [[B:%.*]], [[FALSE_2]] ]
+; CHECK-NEXT:    ret ptr [[P]]
 ; CHECK:       false:
-; CHECK-NEXT:    ret i8* null
+; CHECK-NEXT:    ret ptr null
 ;
 entry:
-  %c.1 = icmp eq i8* %a, null
+  %c.1 = icmp eq ptr %a, null
   br i1 %c.1, label %true, label %false
 
 true:
@@ -161,11 +161,11 @@ false.2:
   br label %exit.2
 
 exit.2:
-  %p = phi i8* [ %a, %true.2 ], [ %b, %false.2 ]
-  ret i8* %p
+  %p = phi ptr [ %a, %true.2 ], [ %b, %false.2 ]
+  ret ptr %p
 
 false:
-  ret i8* null
+  ret ptr null
 }
 
 define i32 @f5(i64 %sz) {
@@ -221,10 +221,10 @@ false:
 }
 
 ; Test with 2 unrelated nested conditions.
-define void @f7_nested_conds(i32* %a, i32 %b) {
+define void @f7_nested_conds(ptr %a, i32 %b) {
 ; CHECK-LABEL: @f7_nested_conds(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[A_V:%.*]] = load i32, i32* [[A:%.*]], align 4
+; CHECK-NEXT:    [[A_V:%.*]] = load i32, ptr [[A:%.*]], align 4
 ; CHECK-NEXT:    [[C_1:%.*]] = icmp ne i32 [[A_V]], 0
 ; CHECK-NEXT:    br i1 [[C_1]], label [[TRUE:%.*]], label [[FALSE:%.*]]
 ; CHECK:       false:
@@ -233,11 +233,11 @@ define void @f7_nested_conds(i32* %a, i32 %b) {
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    ret void
 ; CHECK:       true:
-; CHECK-NEXT:    store i32 [[B:%.*]], i32* [[A]], align 4
+; CHECK-NEXT:    store i32 [[B:%.*]], ptr [[A]], align 4
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %a.v = load i32, i32* %a
+  %a.v = load i32, ptr %a
   %c.1 = icmp ne i32 %a.v, 0
   br i1 %c.1, label %true, label %false
 
@@ -251,7 +251,7 @@ true.2:
   ret void
 
 true:
-  store i32 %b, i32* %a
+  store i32 %b, ptr %a
   ret void
 }
 
@@ -601,7 +601,7 @@ false:
 define void @f13_constexpr1() {
 ; CHECK-LABEL: @f13_constexpr1(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[BC_1:%.*]] = icmp eq i32 add (i32 ptrtoint (i32* @A to i32), i32 10), 55
+; CHECK-NEXT:    [[BC_1:%.*]] = icmp eq i32 add (i32 ptrtoint (ptr @A to i32), i32 10), 55
 ; CHECK-NEXT:    br i1 [[BC_1]], label [[TRUE:%.*]], label [[FALSE:%.*]]
 ; CHECK:       true:
 ; CHECK-NEXT:    call void @use(i1 false)
@@ -611,7 +611,7 @@ define void @f13_constexpr1() {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %a = add i32 ptrtoint (i32* @A to i32), 10
+  %a = add i32 ptrtoint (ptr @A to i32), 10
   %bc.1 = icmp eq i32 %a, 55
   br i1 %bc.1, label %true, label %false
 
@@ -631,17 +631,17 @@ false:
 define void @f14_constexpr2() {
 ; CHECK-LABEL: @f14_constexpr2(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    br i1 icmp eq (i32 ptrtoint (i32* @A to i32), i32 ptrtoint (i32* @B to i32)), label [[TRUE:%.*]], label [[FALSE:%.*]]
+; CHECK-NEXT:    br i1 icmp eq (i32 ptrtoint (ptr @A to i32), i32 ptrtoint (ptr @B to i32)), label [[TRUE:%.*]], label [[FALSE:%.*]]
 ; CHECK:       true:
-; CHECK-NEXT:    call void @use(i1 icmp ne (i32 ptrtoint (i32* @B to i32), i32 ptrtoint (i32* @A to i32)))
-; CHECK-NEXT:    call void @use(i1 icmp eq (i32 ptrtoint (i32* @B to i32), i32 ptrtoint (i32* @A to i32)))
+; CHECK-NEXT:    call void @use(i1 icmp ne (i32 ptrtoint (ptr @B to i32), i32 ptrtoint (ptr @A to i32)))
+; CHECK-NEXT:    call void @use(i1 icmp eq (i32 ptrtoint (ptr @B to i32), i32 ptrtoint (ptr @A to i32)))
 ; CHECK-NEXT:    ret void
 ; CHECK:       false:
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %a = add i32 ptrtoint (i32* @A to i32), 0
-  %b = add i32 ptrtoint (i32* @B to i32), 0
+  %a = add i32 ptrtoint (ptr @A to i32), 0
+  %b = add i32 ptrtoint (ptr @B to i32), 0
   %bc.1 = icmp eq i32 %a, %b
   br i1 %bc.1, label %true, label %false
 

diff  --git a/llvm/test/Transforms/SCCP/crash.ll b/llvm/test/Transforms/SCCP/crash.ll
index 933db0593ae8..8f8ad44db437 100644
--- a/llvm/test/Transforms/SCCP/crash.ll
+++ b/llvm/test/Transforms/SCCP/crash.ll
@@ -29,6 +29,6 @@ define i32 @test2([4 x i32] %A) {
 }
 
 define x86_mmx @test3() {
-  %load = load x86_mmx, x86_mmx* null
+  %load = load x86_mmx, ptr null
   ret x86_mmx %load
 }

diff  --git a/llvm/test/Transforms/SCCP/dangling-block-address.ll b/llvm/test/Transforms/SCCP/dangling-block-address.ll
index e1e3b771cc37..db85eeb4dd97 100644
--- a/llvm/test/Transforms/SCCP/dangling-block-address.ll
+++ b/llvm/test/Transforms/SCCP/dangling-block-address.ll
@@ -7,11 +7,11 @@
 ; address taken, let other passes replace these "dead" blockaddresses with some
 ; other Constant.
 
-; CHECK: @bar.l = internal constant [2 x i8*] [i8* blockaddress(@bar, %lab0), i8* blockaddress(@bar, %end)]
+; CHECK: @bar.l = internal constant [2 x ptr] [ptr blockaddress(@bar, %lab0), ptr blockaddress(@bar, %end)]
 
 
- at code = global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1], align 4 ; <[5 x i32]*> [#uses=0]
- at bar.l = internal constant [2 x i8*] [i8* blockaddress(@bar, %lab0), i8* blockaddress(@bar, %end)] ; <[2 x i8*]*> [#uses=1]
+ at code = global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1], align 4 ; <ptr> [#uses=0]
+ at bar.l = internal constant [2 x ptr] [ptr blockaddress(@bar, %lab0), ptr blockaddress(@bar, %end)] ; <ptr> [#uses=1]
 
 define void @foo(i32 %x) nounwind readnone {
 ; CHECK-LABEL: @foo(
@@ -19,12 +19,12 @@ define void @foo(i32 %x) nounwind readnone {
 ; CHECK-NEXT:    unreachable
 ;
 entry:
-  %b = alloca i32, align 4                        ; <i32*> [#uses=1]
-  store volatile i32 -1, i32* %b
+  %b = alloca i32, align 4                        ; <ptr> [#uses=1]
+  store volatile i32 -1, ptr %b
   ret void
 }
 
-define void @bar(i32* nocapture %pc) nounwind readonly {
+define void @bar(ptr nocapture %pc) nounwind readonly {
 ; CHECK-LABEL: @bar(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    unreachable
@@ -45,11 +45,11 @@ end:                                              ; preds = %indirectgoto
 
 indirectgoto:                                     ; preds = %lab0, %entry
   %indvar = phi i32 [ %indvar.next, %lab0 ], [ 0, %entry ] ; <i32> [#uses=2]
-  %pc.addr.0 = getelementptr i32, i32* %pc, i32 %indvar ; <i32*> [#uses=1]
-  %tmp1.pn = load i32, i32* %pc.addr.0                 ; <i32> [#uses=1]
-  %indirect.goto.dest.in = getelementptr inbounds [2 x i8*], [2 x i8*]* @bar.l, i32 0, i32 %tmp1.pn ; <i8**> [#uses=1]
-  %indirect.goto.dest = load i8*, i8** %indirect.goto.dest.in ; <i8*> [#uses=1]
-  indirectbr i8* %indirect.goto.dest, [label %lab0, label %end]
+  %pc.addr.0 = getelementptr i32, ptr %pc, i32 %indvar ; <ptr> [#uses=1]
+  %tmp1.pn = load i32, ptr %pc.addr.0                 ; <i32> [#uses=1]
+  %indirect.goto.dest.in = getelementptr inbounds [2 x ptr], ptr @bar.l, i32 0, i32 %tmp1.pn ; <ptr> [#uses=1]
+  %indirect.goto.dest = load ptr, ptr %indirect.goto.dest.in ; <ptr> [#uses=1]
+  indirectbr ptr %indirect.goto.dest, [label %lab0, label %end]
 }
 
 define i32 @main() nounwind readnone {
@@ -70,19 +70,19 @@ define i32 @test1() {
 ; CHECK:       redirected:
 ; CHECK-NEXT:    unreachable
 ;
-  %1 = bitcast i8* blockaddress(@test1, %redirected) to i64*
-  call void @set_return_addr(i64* %1)
+  %1 = bitcast ptr blockaddress(@test1, %redirected) to ptr
+  call void @set_return_addr(ptr %1)
   ret i32 0
 
 redirected:
   ret i32 0
 }
 
-define internal void @set_return_addr(i64* %addr) {
+define internal void @set_return_addr(ptr %addr) {
 ; CHECK-LABEL: @set_return_addr(
 ; CHECK-NEXT:    unreachable
 ;
-  %addr.addr = alloca i64*, i32 0, align 8
-  store i64* %addr, i64** %addr.addr, align 8
+  %addr.addr = alloca ptr, i32 0, align 8
+  store ptr %addr, ptr %addr.addr, align 8
   ret void
 }

diff  --git a/llvm/test/Transforms/SCCP/definite-initializer.ll b/llvm/test/Transforms/SCCP/definite-initializer.ll
index c09750c7b4bc..dc22dfa8ec78 100644
--- a/llvm/test/Transforms/SCCP/definite-initializer.ll
+++ b/llvm/test/Transforms/SCCP/definite-initializer.ll
@@ -4,8 +4,8 @@
 ; CHECK-LABEL: @test1(
 define i32 @test1() {
 entry:
-  %load = load i32, i32* @d, align 4
+  %load = load i32, ptr @d, align 4
   ret i32 %load
-; CHECK: %[[load:.*]] = load i32, i32* @d, align 4
+; CHECK: %[[load:.*]] = load i32, ptr @d, align 4
 ; CHECK: ret i32 %[[load]]
 }

diff  --git a/llvm/test/Transforms/SCCP/global-alias-constprop.ll b/llvm/test/Transforms/SCCP/global-alias-constprop.ll
index abb8bc2ebc76..2207ff5a5bec 100644
--- a/llvm/test/Transforms/SCCP/global-alias-constprop.ll
+++ b/llvm/test/Transforms/SCCP/global-alias-constprop.ll
@@ -1,11 +1,11 @@
 ; RUN: opt < %s -passes=sccp -S | FileCheck %s
 
 @0 = private unnamed_addr constant [2 x i32] [i32 -1, i32 1]
-@"\01??_7A@@6B@" = unnamed_addr alias i32, getelementptr inbounds ([2 x i32], [2 x i32]* @0, i32 0, i32 1)
+@"\01??_7A@@6B@" = unnamed_addr alias i32, getelementptr inbounds ([2 x i32], ptr @0, i32 0, i32 1)
 
 ; CHECK: ret i32 1
 
 define i32 @main() {
-  %a = load i32, i32* @"\01??_7A@@6B@"
+  %a = load i32, ptr @"\01??_7A@@6B@"
   ret i32 %a
 }

diff  --git a/llvm/test/Transforms/SCCP/global.ll b/llvm/test/Transforms/SCCP/global.ll
index bd058e92d656..1a87e875ea40 100644
--- a/llvm/test/Transforms/SCCP/global.ll
+++ b/llvm/test/Transforms/SCCP/global.ll
@@ -4,12 +4,12 @@
 
 define void @_Z7test1f1v() nounwind {
 entry:
-  %tmp = load i32, i32* @_ZL6test1g, align 4
+  %tmp = load i32, ptr @_ZL6test1g, align 4
   %cmp = icmp eq i32 %tmp, 0
   br i1 %cmp, label %if.then, label %if.end
 
 if.then:                                          ; preds = %entry
-  store i32 0, i32* @_ZL6test1g, align 4
+  store i32 0, ptr @_ZL6test1g, align 4
   br label %if.end
 
 if.end:                                           ; preds = %if.then, %entry
@@ -21,6 +21,6 @@ if.end:                                           ; preds = %if.then, %entry
 ; CHECK-NEXT: ret i32 42
 define i32 @_Z7test1f2v() nounwind {
 entry:
-  %tmp = load i32, i32* @_ZL6test1g, align 4
+  %tmp = load i32, ptr @_ZL6test1g, align 4
   ret i32 %tmp
 }

diff  --git a/llvm/test/Transforms/SCCP/indirectbr.ll b/llvm/test/Transforms/SCCP/indirectbr.ll
index 88f34ec32d90..280bc53ff262 100644
--- a/llvm/test/Transforms/SCCP/indirectbr.ll
+++ b/llvm/test/Transforms/SCCP/indirectbr.ll
@@ -15,7 +15,7 @@ define void @indbrtest1() {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  indirectbr i8* blockaddress(@indbrtest1, %BB1), [label %BB0, label %BB1]
+  indirectbr ptr blockaddress(@indbrtest1, %BB1), [label %BB0, label %BB1]
 BB0:
   call void @BB0_f()
   br label %BB1
@@ -37,10 +37,9 @@ define void @indbrtest2() {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %a = ptrtoint i8* blockaddress(@indbrtest2, %BB1) to i64
-  %b = inttoptr i64 %a to i8*
-  %c = bitcast i8* %b to i8*
-  indirectbr i8* %b, [label %BB0, label %BB1]
+  %a = ptrtoint ptr blockaddress(@indbrtest2, %BB1) to i64
+  %b = inttoptr i64 %a to ptr
+  indirectbr ptr %b, [label %BB0, label %BB1]
 BB0:
   call void @BB0_f()
   br label %BB1
@@ -51,11 +50,11 @@ BB1:
 
 ; Make sure we can not eliminate BB0 as we do not know the target of the indirectbr.
 
-define void @indbrtest3(i8** %Q) {
+define void @indbrtest3(ptr %Q) {
 ; CHECK-LABEL: @indbrtest3(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[T:%.*]] = load i8*, i8** [[Q:%.*]], align 8
-; CHECK-NEXT:    indirectbr i8* [[T]], [label [[BB0:%.*]], label %BB1]
+; CHECK-NEXT:    [[T:%.*]] = load ptr, ptr [[Q:%.*]], align 8
+; CHECK-NEXT:    indirectbr ptr [[T]], [label [[BB0:%.*]], label %BB1]
 ; CHECK:       BB0:
 ; CHECK-NEXT:    call void @BB0_f()
 ; CHECK-NEXT:    br label [[BB1:%.*]]
@@ -64,8 +63,8 @@ define void @indbrtest3(i8** %Q) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %t = load i8*, i8** %Q
-  indirectbr i8* %t, [label %BB0, label %BB1]
+  %t = load ptr, ptr %Q
+  indirectbr ptr %t, [label %BB0, label %BB1]
 BB0:
   call void @BB0_f()
   br label %BB1
@@ -76,13 +75,13 @@ BB1:
 
 ; Branch on undef is UB, so we can convert the indirectbr to unreachable.
 
-define void @indbrtest4(i8** %Q) {
+define void @indbrtest4(ptr %Q) {
 ; CHECK-LABEL: @indbrtest4(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    unreachable
 ;
 entry:
-  indirectbr i8* undef, [label %BB0, label %BB1]
+  indirectbr ptr undef, [label %BB0, label %BB1]
 BB0:
   call void @BB0_f()
   ret void
@@ -100,8 +99,8 @@ define internal i32 @indbrtest5(i1 %c) {
 ; CHECK:       bb2:
 ; CHECK-NEXT:    br label [[BRANCH_BLOCK]]
 ; CHECK:       branch.block:
-; CHECK-NEXT:    [[ADDR:%.*]] = phi i8* [ blockaddress(@indbrtest5, [[TARGET1:%.*]]), [[BB1]] ], [ blockaddress(@indbrtest5, [[TARGET2:%.*]]), [[BB2]] ]
-; CHECK-NEXT:    indirectbr i8* [[ADDR]], [label [[TARGET1]], label %target2]
+; CHECK-NEXT:    [[ADDR:%.*]] = phi ptr [ blockaddress(@indbrtest5, [[TARGET1:%.*]]), [[BB1]] ], [ blockaddress(@indbrtest5, [[TARGET2:%.*]]), [[BB2]] ]
+; CHECK-NEXT:    indirectbr ptr [[ADDR]], [label [[TARGET1]], label %target2]
 ; CHECK:       target1:
 ; CHECK-NEXT:    br label [[TARGET2]]
 ; CHECK:       target2:
@@ -118,8 +117,8 @@ bb2:
   br label %branch.block
 
 branch.block:
-  %addr = phi i8* [blockaddress(@indbrtest5, %target1), %bb1], [blockaddress(@indbrtest5, %target2), %bb2]
-  indirectbr i8* %addr, [label %target1, label %target2]
+  %addr = phi ptr [blockaddress(@indbrtest5, %target1), %bb1], [blockaddress(@indbrtest5, %target2), %bb2]
+  indirectbr ptr %addr, [label %target1, label %target2]
 
 target1:
   br label %target2
@@ -152,7 +151,7 @@ entry:
   br i1 %c, label %indbr, label %BB0
 
 indbr:
-  indirectbr i8* blockaddress(@indbr_duplicate_successors_phi, %BB0), [label %BB0, label %BB0, label %BB1]
+  indirectbr ptr blockaddress(@indbr_duplicate_successors_phi, %BB0), [label %BB0, label %BB0, label %BB1]
 
 BB0:
   %phi = phi i32 [ %x, %entry ], [ 0, %indbr ], [ 0, %indbr ]

diff  --git a/llvm/test/Transforms/SCCP/int-phis.ll b/llvm/test/Transforms/SCCP/int-phis.ll
index b261e72d3c06..d2641952d7f3 100644
--- a/llvm/test/Transforms/SCCP/int-phis.ll
+++ b/llvm/test/Transforms/SCCP/int-phis.ll
@@ -9,7 +9,7 @@ define void @read_dmatrix() #0 {
 ; CHECK-NEXT:    [[HEIGHT:%.*]] = alloca i32, align 4
 ; CHECK-NEXT:    br label [[FOR_COND:%.*]]
 ; CHECK:       for.cond:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[HEIGHT]], align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr [[HEIGHT]], align 4
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 0, [[TMP0]]
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_COND6:%.*]], label [[FOR_END16:%.*]]
 ; CHECK:       for.cond6:
@@ -23,7 +23,7 @@ entry:
 
 for.cond:                                         ; preds = %for.cond6, %entry
   %j.0 = phi i32 [ undef, %entry ], [ 0, %for.cond6 ]
-  %0 = load i32, i32* %height, align 4
+  %0 = load i32, ptr %height, align 4
   %cmp = icmp slt i32 0, %0
   br i1 %cmp, label %for.cond6, label %for.end16
 

diff  --git a/llvm/test/Transforms/SCCP/intrinsics.ll b/llvm/test/Transforms/SCCP/intrinsics.ll
index 68d18e358855..2fd33dc97c75 100644
--- a/llvm/test/Transforms/SCCP/intrinsics.ll
+++ b/llvm/test/Transforms/SCCP/intrinsics.ll
@@ -8,9 +8,9 @@ declare i8 @llvm.umax.i8(i8, i8)
 declare void @use(i1)
 declare void @use_vec(<2 x i1>)
 
-define void @abs1(i8* %p) {
+define void @abs1(ptr %p) {
 ; CHECK-LABEL: @abs1(
-; CHECK-NEXT:    [[X:%.*]] = load i8, i8* [[P:%.*]], align 1, [[RNG0:!range !.*]]
+; CHECK-NEXT:    [[X:%.*]] = load i8, ptr [[P:%.*]], align 1, [[RNG0:!range !.*]]
 ; CHECK-NEXT:    [[ABS:%.*]] = call i8 @llvm.abs.i8(i8 [[X]], i1 false)
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 true)
@@ -20,7 +20,7 @@ define void @abs1(i8* %p) {
 ; CHECK-NEXT:    call void @use(i1 [[CMP4]])
 ; CHECK-NEXT:    ret void
 ;
-  %x = load i8, i8* %p, !range !{i8 -9, i8 10}
+  %x = load i8, ptr %p, !range !{i8 -9, i8 10}
   %abs = call i8 @llvm.abs.i8(i8 %x, i1 false)
   %cmp1 = icmp sge i8 %abs, 0
   call void @use(i1 %cmp1)
@@ -60,10 +60,10 @@ define void @abs2_vec(<2 x i8> %x) {
   ret void
 }
 
-define void @umax1(i8* %p1, i8* %p2) {
+define void @umax1(ptr %p1, ptr %p2) {
 ; CHECK-LABEL: @umax1(
-; CHECK-NEXT:    [[X1:%.*]] = load i8, i8* [[P1:%.*]], align 1, [[RNG1:!range !.*]]
-; CHECK-NEXT:    [[X2:%.*]] = load i8, i8* [[P2:%.*]], align 1, [[RNG2:!range !.*]]
+; CHECK-NEXT:    [[X1:%.*]] = load i8, ptr [[P1:%.*]], align 1, [[RNG1:!range !.*]]
+; CHECK-NEXT:    [[X2:%.*]] = load i8, ptr [[P2:%.*]], align 1, [[RNG2:!range !.*]]
 ; CHECK-NEXT:    [[M:%.*]] = call i8 @llvm.umax.i8(i8 [[X1]], i8 [[X2]])
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 true)
@@ -73,8 +73,8 @@ define void @umax1(i8* %p1, i8* %p2) {
 ; CHECK-NEXT:    call void @use(i1 [[CMP4]])
 ; CHECK-NEXT:    ret void
 ;
-  %x1 = load i8, i8* %p1, !range !{i8 0, i8 10}
-  %x2 = load i8, i8* %p2, !range !{i8 5, i8 15}
+  %x1 = load i8, ptr %p1, !range !{i8 0, i8 10}
+  %x2 = load i8, ptr %p2, !range !{i8 5, i8 15}
   %m = call i8 @llvm.umax.i8(i8 %x1, i8 %x2)
   %cmp1 = icmp uge i8 %m, 5
   call void @use(i1 %cmp1)

diff  --git a/llvm/test/Transforms/SCCP/ip-add-range-to-call.ll b/llvm/test/Transforms/SCCP/ip-add-range-to-call.ll
index 288e5bed5184..9c5b73c8164c 100644
--- a/llvm/test/Transforms/SCCP/ip-add-range-to-call.ll
+++ b/llvm/test/Transforms/SCCP/ip-add-range-to-call.ll
@@ -39,7 +39,7 @@ define i32 @caller2(i32 %x) {
 ; it is passed to @use_cb1. We cannot infer a range for the return value, no
 ; metadata should be added.
 
-declare void @use_cb1(i32 (i32)*)
+declare void @use_cb1(ptr)
 
 define internal noundef i32 @callee2(i32 %x) {
 ; CHECK-LABEL: @callee2(
@@ -54,12 +54,12 @@ define void @caller_cb1() {
 ; CHECK-NOT:   !range
 ; CHECK-NEXT:    [[C2:%.*]] = call i32 @callee2(i32 10)
 ; CHECK-NOT:   !range
-; CHECK-NEXT:    call void @use_cb1(i32 (i32)* @callee2)
+; CHECK-NEXT:    call void @use_cb1(ptr @callee2)
 ; CHECK-NEXT:    ret void
 ;
   %c1 = call i32 @callee2(i32 9)
   %c2 = call i32 @callee2(i32 10)
-  call void @use_cb1(i32 (i32)* @callee2)
+  call void @use_cb1(ptr @callee2)
   ret void
 }
 
@@ -68,7 +68,7 @@ define void @caller_cb1() {
 ; depend on the arguments, which cannot be tracked because @callee3 is passed
 ; to @use_cb2. The result range can be added to the call sites of @callee.
 
-declare void @use_cb2(i32 (i32)*)
+declare void @use_cb2(ptr)
 
 define internal noundef i32 @callee3(i32 %x) {
 ; CHECK-LABEL: @callee3(
@@ -85,12 +85,12 @@ define void @caller_cb2() {
 ; CHECK-LABEL: @caller_cb2(
 ; CHECK-NEXT:    [[C1:%.*]] = call i32 @callee3(i32 9), !range [[RANGE_500_601:![0-9]+]]
 ; CHECK-NEXT:    [[C2:%.*]] = call i32 @callee3(i32 10), !range [[RANGE_500_601]]
-; CHECK-NEXT:    call void @use_cb2(i32 (i32)* @callee3)
+; CHECK-NEXT:    call void @use_cb2(ptr @callee3)
 ; CHECK-NEXT:    ret void
 ;
   %c1 = call i32 @callee3(i32 9)
   %c2 = call i32 @callee3(i32 10)
-  call void @use_cb2(i32 (i32)* @callee3)
+  call void @use_cb2(ptr @callee3)
   ret void
 }
 
@@ -98,7 +98,7 @@ define void @caller_cb2() {
 ; The return value of @callee4 can be tracked, but depends on an argument which
 ; cannot be tracked. No result range can be inferred.
 
-declare void @use_cb3(i32 (i32, i32)*)
+declare void @use_cb3(ptr)
 
 define internal noundef i32 @callee4(i32 %x, i32 %y) {
 ; CHECK-LABEL: @callee4(
@@ -117,12 +117,12 @@ define void @caller_cb3() {
 ; CHECK-NOT:   !range
 ; CHECK-NEXT:    [[C2:%.*]] = call i32 @callee4(i32 12, i32 40)
 ; CHECK-NOT:   !range
-; CHECK-NEXT:    call void @use_cb3(i32 (i32, i32)* @callee4)
+; CHECK-NEXT:    call void @use_cb3(ptr @callee4)
 ; CHECK-NEXT:    ret void
 ;
   %c1 = call i32 @callee4(i32 11, i32 30)
   %c2 = call i32 @callee4(i32 12, i32 40)
-  call void @use_cb3(i32 (i32, i32)* @callee4)
+  call void @use_cb3(ptr @callee4)
   ret void
 }
 

diff  --git a/llvm/test/Transforms/SCCP/ip-ranges-casts.ll b/llvm/test/Transforms/SCCP/ip-ranges-casts.ll
index bbf58886698d..bcbddb3c6b95 100644
--- a/llvm/test/Transforms/SCCP/ip-ranges-casts.ll
+++ b/llvm/test/Transforms/SCCP/ip-ranges-casts.ll
@@ -246,8 +246,8 @@ define i1 @caller.fpext() {
 ; There's nothing we can do besides going to the full range or overdefined.
 define internal i1 @f.inttoptr.ptrtoint(i64 %x) {
 ; CHECK-LABEL: @f.inttoptr.ptrtoint(
-; CHECK-NEXT:    [[TO_PTR:%.*]] = inttoptr i64 [[X:%.*]] to i8*
-; CHECK-NEXT:    [[TO_I64:%.*]] = ptrtoint i8* [[TO_PTR]] to i64
+; CHECK-NEXT:    [[TO_PTR:%.*]] = inttoptr i64 [[X:%.*]] to ptr
+; CHECK-NEXT:    [[TO_I64:%.*]] = ptrtoint ptr [[TO_PTR]] to i64
 ; CHECK-NEXT:    [[C_1:%.*]] = icmp sgt i64 [[TO_I64]], 300
 ; CHECK-NEXT:    [[C_2:%.*]] = icmp sgt i64 [[TO_I64]], 299
 ; CHECK-NEXT:    [[C_3:%.*]] = icmp slt i64 [[TO_I64]], 100
@@ -257,8 +257,8 @@ define internal i1 @f.inttoptr.ptrtoint(i64 %x) {
 ; CHECK-NEXT:    [[RES_3:%.*]] = add i1 [[RES_2]], [[C_4]]
 ; CHECK-NEXT:    ret i1 [[RES_3]]
 ;
-  %to.ptr = inttoptr i64 %x to i8*
-  %to.i64 = ptrtoint i8* %to.ptr to i64
+  %to.ptr = inttoptr i64 %x to ptr
+  %to.i64 = ptrtoint ptr %to.ptr to i64
   %c.1 = icmp sgt i64 %to.i64, 300
   %c.2 = icmp sgt i64 %to.i64, 299
   %c.3 = icmp slt i64 %to.i64, 100

diff  --git a/llvm/test/Transforms/SCCP/ip-ranges-select.ll b/llvm/test/Transforms/SCCP/ip-ranges-select.ll
index bedfeca8c430..ac57bbf9943b 100644
--- a/llvm/test/Transforms/SCCP/ip-ranges-select.ll
+++ b/llvm/test/Transforms/SCCP/ip-ranges-select.ll
@@ -1,7 +1,7 @@
 ; RUN: opt -passes=ipsccp -S %s -o -| FileCheck %s
 
-define void @caller.1(i8* %arg) {
-; CHECK-LABEL: define void @caller.1(i8* %arg) {
+define void @caller.1(ptr %arg) {
+; CHECK-LABEL: define void @caller.1(ptr %arg) {
 ; CHECK-NEXT:    %r.1 = tail call i32 @callee.1(i32 4)
 ; CHECK-NEXT:    %r.2 = tail call i32 @callee.1(i32 2)
 ; CHECK-NEXT:    call void @use(i32 20)
@@ -111,10 +111,10 @@ define i1 @caller2(i32 %y, i1 %cmp) {
 
 define i32 @f3_constantexpr_cond(i32 %x, i32 %y) {
 ; CHECK-LABEL: define i32 @f3_constantexpr_cond(i32 %x, i32 %y)
-; CHECK-NEXT:   %sel.1 = select i1 icmp eq (i32* bitcast (i32 (i32, i32)* @f3_constantexpr_cond to i32*), i32* @GV), i32 %x, i32 %y
+; CHECK-NEXT:   %sel.1 = select i1 icmp eq (ptr @f3_constantexpr_cond, ptr @GV), i32 %x, i32 %y
 ; CHECK-NEXT:   ret i32 %sel.1
 ;
-  %sel.1 = select i1 icmp eq (i32* bitcast (i32 (i32, i32)* @f3_constantexpr_cond to i32*), i32* @GV), i32 %x, i32 %y
+  %sel.1 = select i1 icmp eq (ptr @f3_constantexpr_cond, ptr @GV), i32 %x, i32 %y
   ret i32 %sel.1
 }
 

diff  --git a/llvm/test/Transforms/SCCP/ipsccp-addr-taken.ll b/llvm/test/Transforms/SCCP/ipsccp-addr-taken.ll
index cfa3d413b2c8..125ff6f410dc 100644
--- a/llvm/test/Transforms/SCCP/ipsccp-addr-taken.ll
+++ b/llvm/test/Transforms/SCCP/ipsccp-addr-taken.ll
@@ -16,7 +16,7 @@ declare i32 @bar()
 define internal i32 @test(i32 %c) nounwind noinline ssp {
 bb:
   %tmp1 = icmp ne i32 %c, 0                       ; <i1> [#uses=1]
-  %tmp2 = select i1 %tmp1, i32 ()* @foo, i32 ()* @bar ; <i32 ()*> [#uses=1]
+  %tmp2 = select i1 %tmp1, ptr @foo, ptr @bar ; <ptr> [#uses=1]
   %tmp3 = tail call i32 %tmp2() nounwind          ; <i32> [#uses=1]
   ret i32 %tmp3
 }

diff  --git a/llvm/test/Transforms/SCCP/ipsccp-basic.ll b/llvm/test/Transforms/SCCP/ipsccp-basic.ll
index d6a102ee54b2..5402af0e5eef 100644
--- a/llvm/test/Transforms/SCCP/ipsccp-basic.ll
+++ b/llvm/test/Transforms/SCCP/ipsccp-basic.ll
@@ -51,38 +51,38 @@ define i32 @test2b() {
 @G = internal global i32 undef
 
 define void @test3a() {
-	%X = load i32, i32* @G
-	store i32 %X, i32* @G
+	%X = load i32, ptr @G
+	store i32 %X, ptr @G
 	ret void
 }
 ; CHECK-LABEL: define void @test3a(
-; CHECK-NEXT:    %X = load i32, i32* @G
-; CHECK-NEXT:    store i32 %X, i32* @G
+; CHECK-NEXT:    %X = load i32, ptr @G
+; CHECK-NEXT:    store i32 %X, ptr @G
 ; CHECK-NEXT:   ret void
 
 
 define i32 @test3b() {
-	%V = load i32, i32* @G
+	%V = load i32, ptr @G
 	%C = icmp eq i32 %V, 17
 	br i1 %C, label %T, label %F
 T:
-	store i32 17, i32* @G
+	store i32 17, ptr @G
 	ret i32 %V
 F:	
-	store i32 123, i32* @G
+	store i32 123, ptr @G
 	ret i32 0
 }
 ; CHECK-LABEL: define i32 @test3b(
-; CHECK-NEXT:    %V = load i32, i32* @G
+; CHECK-NEXT:    %V = load i32, ptr @G
 ; CHECK-NEXT:    %C = icmp eq i32 %V, 17
 ; CHECK-NEXT:    br i1 %C, label %T, label %F
 
 ; CHECK-LABEL: T:
-; CHECK-NEXT:   store i32 17, i32* @G
+; CHECK-NEXT:   store i32 17, ptr @G
 ; CHECK-NEXT:   ret i32 17
 
 ; CHECK-LABEL: F:
-; CHECK-NEXT:    store i32 123, i32* @G
+; CHECK-NEXT:    store i32 123, ptr @G
 ; CHECK-NEXT:    ret i32 0
 
 ;;======================== test4
@@ -97,7 +97,7 @@ define internal {i64,i64} @test4a() {
 ; CHECK-NEXT:   ret { i64, i64 } undef
 ; CHECK-NEXT: }
 
-define i64 @test4b() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i64 @test4b() personality ptr @__gxx_personality_v0 {
   %a = invoke {i64,i64} @test4a()
           to label %A unwind label %B
 A:
@@ -105,8 +105,8 @@ A:
   %c = call i64 @test4c(i64 %b)
   ret i64 %c
 B:
-  %val = landingpad { i8*, i32 }
-           catch i8* null
+  %val = landingpad { ptr, i32 }
+           catch ptr null
   ret i64 0
 }
 ; CHECK: define i64 @test4b()
@@ -131,15 +131,15 @@ define internal {i64,i64} @test5a() {
   ret {i64,i64} %b
 }
 
-define i64 @test5b() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i64 @test5b() personality ptr @__gxx_personality_v0 {
   %a = invoke {i64,i64} @test5a()
           to label %A unwind label %B
 A:
   %c = call i64 @test5c({i64,i64} %a)
   ret i64 %c
 B:
-  %val = landingpad { i8*, i32 }
-           catch i8* null
+  %val = landingpad { ptr, i32 }
+           catch ptr null
   ret i64 0
 }
 
@@ -194,16 +194,16 @@ define i32 @test7b() {
 ;;======================== test8
 
 
-define internal {} @test8a(i32 %A, i32* %P) {
-  store i32 %A, i32* %P
+define internal {} @test8a(i32 %A, ptr %P) {
+  store i32 %A, ptr %P
   ret {} {}
 ; CHECK-LABEL: @test8a(
 ; CHECK-NEXT: store i32 5, 
 ; CHECK-NEXT: ret 
 }
 
-define void @test8b(i32* %P) {
-    %X = call {} @test8a(i32 5, i32* %P)
+define void @test8b(ptr %P) {
+    %X = call {} @test8a(i32 5, ptr %P)
     ret void
 ; CHECK-LABEL: define void @test8b(
 ; CHECK-NEXT: call {} @test8a
@@ -217,15 +217,15 @@ define void @test8b(i32* %P) {
 define void @test9() {
 entry:
         %local_foo = alloca {  }
-        load {  }, {  }* @test9g
-        store {  } %0, {  }* %local_foo
+        load {  }, ptr @test9g
+        store {  } %0, ptr %local_foo
         ret void
 }
 
 ; CHECK-LABEL: define void @test9(
 ; CHECK-NEXT: entry:
 ; CHECK-NEXT: %local_foo = alloca {}
-; CHECK-NEXT:  store {} zeroinitializer, {}* %local_foo
+; CHECK-NEXT:  store {} zeroinitializer, ptr %local_foo
 ; CHECK-NEXT: ret void
 
 declare i32 @__gxx_personality_v0(...)

diff  --git a/llvm/test/Transforms/SCCP/ipsccp-clear-returned.ll b/llvm/test/Transforms/SCCP/ipsccp-clear-returned.ll
index 753978b5a4e9..e5bd5d5973ed 100644
--- a/llvm/test/Transforms/SCCP/ipsccp-clear-returned.ll
+++ b/llvm/test/Transforms/SCCP/ipsccp-clear-returned.ll
@@ -41,8 +41,8 @@ bb2:
   br label %branch.block
 
 branch.block:
-  %addr = phi i8* [blockaddress(@blockaddr_user, %target1), %bb1], [blockaddress(@blockaddr_user, %target2), %bb2]
-  indirectbr i8* %addr, [label %target1, label %target2]
+  %addr = phi ptr [blockaddress(@blockaddr_user, %target1), %bb1], [blockaddress(@blockaddr_user, %target2), %bb2]
+  indirectbr ptr %addr, [label %target1, label %target2]
 
 target1:
   br label %target2

diff  --git a/llvm/test/Transforms/SCCP/ipsccp-cycles.ll b/llvm/test/Transforms/SCCP/ipsccp-cycles.ll
index cacfb30721fc..ceae0b5b41ab 100644
--- a/llvm/test/Transforms/SCCP/ipsccp-cycles.ll
+++ b/llvm/test/Transforms/SCCP/ipsccp-cycles.ll
@@ -40,9 +40,9 @@ define i32 @test2(i32 %a) {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
-; CHECK-NEXT:    [[LV:%.*]] = load i32, i32* @Getopt.optind, align 4
+; CHECK-NEXT:    [[LV:%.*]] = load i32, ptr @Getopt.optind, align 4
 ; CHECK-NEXT:    [[ADD:%.*]] = add i32 [[LV]], 1
-; CHECK-NEXT:    store i32 [[ADD]], i32* @Getopt.optind, align 4
+; CHECK-NEXT:    store i32 [[ADD]], ptr @Getopt.optind, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp eq i32 [[ADD]], [[A:%.*]]
 ; CHECK-NEXT:    br i1 [[C]], label [[EXIT:%.*]], label [[LOOP]]
 ; CHECK:       exit:
@@ -52,9 +52,9 @@ entry:
   br label %loop
 
 loop:
-  %lv = load i32, i32* @Getopt.optind, align 4
+  %lv = load i32, ptr @Getopt.optind, align 4
   %add = add i32 %lv, 1
-  store i32 %add, i32* @Getopt.optind
+  store i32 %add, ptr @Getopt.optind
   %c = icmp eq i32 %add, %a
   br i1 %c, label %exit, label %loop
 
@@ -162,24 +162,24 @@ define i32 @test4b(i32 %b) {
 
 ; Check for a range extension cycle through a returned value.
 
-define internal i32 @test5a(i8* %arg, i32 %arg1, i32 %arg2) {
+define internal i32 @test5a(ptr %arg, i32 %arg1, i32 %arg2) {
 ; CHECK-LABEL: @test5a(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = icmp eq i8* [[ARG:%.*]], null
+; CHECK-NEXT:    [[TMP:%.*]] = icmp eq ptr [[ARG:%.*]], null
 ; CHECK-NEXT:    br i1 [[TMP]], label [[BB6:%.*]], label [[BB3:%.*]]
 ; CHECK:       bb3:
-; CHECK-NEXT:    [[TMP4:%.*]] = tail call i32 @test5a(i8* [[ARG]], i32 0, i32 -1)
+; CHECK-NEXT:    [[TMP4:%.*]] = tail call i32 @test5a(ptr [[ARG]], i32 0, i32 -1)
 ; CHECK-NEXT:    [[TMP5:%.*]] = add nsw i32 [[TMP4]], -1
 ; CHECK-NEXT:    ret i32 [[TMP5]]
 ; CHECK:       bb6:
 ; CHECK-NEXT:    ret i32 0
 ;
 bb:
-  %tmp = icmp eq i8* %arg, null
+  %tmp = icmp eq ptr %arg, null
   br i1 %tmp, label %bb6, label %bb3
 
 bb3:                                              ; preds = %bb
-  %tmp4 = tail call i32 @test5a(i8* %arg, i32 %arg1, i32 %arg2)
+  %tmp4 = tail call i32 @test5a(ptr %arg, i32 %arg1, i32 %arg2)
   %tmp5 = add nsw i32 %tmp4, %arg2
   ret i32 %tmp5
 
@@ -187,26 +187,26 @@ bb6:                                              ; preds = %bb
   ret i32 %arg1
 }
 
-define void @test5b(i8* %ptr) {
+define void @test5b(ptr %ptr) {
 ; CHECK-LABEL: @test5b(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = tail call i32 @test5a(i8* [[PTR:%.*]], i32 0, i32 -1)
+; CHECK-NEXT:    [[TMP:%.*]] = tail call i32 @test5a(ptr [[PTR:%.*]], i32 0, i32 -1)
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  %tmp = tail call i32 @test5a(i8* %ptr, i32 0, i32 -1)
+  %tmp = tail call i32 @test5a(ptr %ptr, i32 0, i32 -1)
   ret void
 }
 
 %struct = type { i32, i32 }
 
-define internal %struct @test6a(i8* %arg, i32 %arg1, i32 %arg2) {
+define internal %struct @test6a(ptr %arg, i32 %arg1, i32 %arg2) {
 ; CHECK-LABEL: @test6a(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = icmp eq i8* [[ARG:%.*]], null
+; CHECK-NEXT:    [[TMP:%.*]] = icmp eq ptr [[ARG:%.*]], null
 ; CHECK-NEXT:    br i1 [[TMP]], label [[BB6:%.*]], label [[BB3:%.*]]
 ; CHECK:       bb3:
-; CHECK-NEXT:    [[S1:%.*]] = tail call [[STRUCT:%.*]] @test6a(i8* [[ARG]], i32 0, i32 -1)
+; CHECK-NEXT:    [[S1:%.*]] = tail call [[STRUCT:%.*]] @test6a(ptr [[ARG]], i32 0, i32 -1)
 ; CHECK-NEXT:    [[TMP4:%.*]] = extractvalue [[STRUCT]] %s1, 0
 ; CHECK-NEXT:    [[TMP5:%.*]] = add nsw i32 [[TMP4]], -1
 ; CHECK-NEXT:    [[S2:%.*]] = insertvalue [[STRUCT]] %s1, i32 [[TMP5]], 0
@@ -215,11 +215,11 @@ define internal %struct @test6a(i8* %arg, i32 %arg1, i32 %arg2) {
 ; CHECK-NEXT:    ret [[STRUCT]] { i32 0, i32 undef }
 ;
 bb:
-  %tmp = icmp eq i8* %arg, null
+  %tmp = icmp eq ptr %arg, null
   br i1 %tmp, label %bb6, label %bb3
 
 bb3:                                              ; preds = %bb
-  %s1 = tail call %struct @test6a(i8* %arg, i32 %arg1, i32 %arg2)
+  %s1 = tail call %struct @test6a(ptr %arg, i32 %arg1, i32 %arg2)
   %tmp4 = extractvalue %struct %s1, 0
   %tmp5 = add nsw i32 %tmp4, %arg2
   %s2 = insertvalue %struct %s1, i32 %tmp5, 0
@@ -230,13 +230,13 @@ bb6:                                              ; preds = %bb
   ret %struct %s3
 }
 
-define void @test6b(i8* %ptr) {
+define void @test6b(ptr %ptr) {
 ; CHECK-LABEL: @test6b(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = tail call [[STRUCT:%.*]] @test6a(i8* [[PTR:%.*]], i32 0, i32 -1)
+; CHECK-NEXT:    [[TMP:%.*]] = tail call [[STRUCT:%.*]] @test6a(ptr [[PTR:%.*]], i32 0, i32 -1)
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  %tmp = tail call %struct @test6a(i8* %ptr, i32 0, i32 -1)
+  %tmp = tail call %struct @test6a(ptr %ptr, i32 0, i32 -1)
   ret void
 }

diff  --git a/llvm/test/Transforms/SCCP/ipsccp-predinfo-order.ll b/llvm/test/Transforms/SCCP/ipsccp-predinfo-order.ll
index 6e1f72f6bb3f..af44a973d01a 100644
--- a/llvm/test/Transforms/SCCP/ipsccp-predinfo-order.ll
+++ b/llvm/test/Transforms/SCCP/ipsccp-predinfo-order.ll
@@ -3,7 +3,7 @@
 
 declare i32 @hoge()
 
-define dso_local i32 @ham(i8* %arg, i8* %arg1) {
+define dso_local i32 @ham(ptr %arg, ptr %arg1) {
 ; CHECK-LABEL: @ham(
 ; CHECK-NEXT:  bb:
 ; CHECK-NEXT:    [[TMP:%.*]] = alloca i32
@@ -13,17 +13,17 @@ define dso_local i32 @ham(i8* %arg, i8* %arg1) {
 ; CHECK-NEXT:    br label [[BB6:%.*]]
 ; CHECK:       bb6:
 ; CHECK-NEXT:    [[TMP7:%.*]] = call i32 @hoge()
-; CHECK-NEXT:    store i32 [[TMP7]], i32* [[TMP]]
-; CHECK-NEXT:    [[TMP8:%.*]] = load i32, i32* [[TMP]]
+; CHECK-NEXT:    store i32 [[TMP7]], ptr [[TMP]]
+; CHECK-NEXT:    [[TMP8:%.*]] = load i32, ptr [[TMP]]
 ; CHECK-NEXT:    [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 912730082
-; CHECK-NEXT:    [[TMP10:%.*]] = load i32, i32* [[TMP]]
+; CHECK-NEXT:    [[TMP10:%.*]] = load i32, ptr [[TMP]]
 ; CHECK-NEXT:    br i1 [[TMP9]], label [[BB11:%.*]], label [[BB16:%.*]]
 ; CHECK:       bb11:
 ; CHECK-NEXT:    unreachable
 ; CHECK:       bb13:
 ; CHECK-NEXT:    br label [[BB14:%.*]]
 ; CHECK:       bb14:
-; CHECK-NEXT:    [[TMP15:%.*]] = load i32, i32* [[TMP]]
+; CHECK-NEXT:    [[TMP15:%.*]] = load i32, ptr [[TMP]]
 ; CHECK-NEXT:    br label [[BB16]]
 ; CHECK:       bb16:
 ; CHECK-NEXT:    [[TMP17:%.*]] = phi i32 [ [[TMP10]], [[BB6]] ], [ 0, [[BB14]] ]
@@ -33,7 +33,7 @@ define dso_local i32 @ham(i8* %arg, i8* %arg1) {
 ; CHECK:       bb19:
 ; CHECK-NEXT:    br label [[BB20:%.*]]
 ; CHECK:       bb20:
-; CHECK-NEXT:    indirectbr i8* null, [label [[BB4:%.*]], label [[BB13:%.*]], label %bb18]
+; CHECK-NEXT:    indirectbr ptr null, [label [[BB4:%.*]], label [[BB13:%.*]], label %bb18]
 ;
 bb:
   %tmp = alloca i32
@@ -45,10 +45,10 @@ bb4:                                              ; preds = %bb20
 
 bb6:                                              ; preds = %bb4
   %tmp7 = call i32 @hoge()
-  store i32 %tmp7, i32* %tmp
-  %tmp8 = load i32, i32* %tmp
+  store i32 %tmp7, ptr %tmp
+  %tmp8 = load i32, ptr %tmp
   %tmp9 = icmp eq i32 %tmp8, 912730082
-  %tmp10 = load i32, i32* %tmp
+  %tmp10 = load i32, ptr %tmp
   br i1 %tmp9, label %bb11, label %bb16
 
 bb11:                                             ; preds = %bb6
@@ -58,7 +58,7 @@ bb13:                                             ; preds = %bb20
   br label %bb14
 
 bb14:                                             ; preds = %bb13
-  %tmp15 = load i32, i32* %tmp
+  %tmp15 = load i32, ptr %tmp
   br label %bb16
 
 bb16:                                             ; preds = %bb14, %bb6
@@ -72,5 +72,5 @@ bb19:                                             ; preds = %bb16, %bb
   br label %bb20
 
 bb20:                                             ; preds = %bb19
-  indirectbr i8* null, [label %bb4, label %bb13, label %bb18]
+  indirectbr ptr null, [label %bb4, label %bb13, label %bb18]
 }

diff  --git a/llvm/test/Transforms/SCCP/ipsccp-range-crashes.ll b/llvm/test/Transforms/SCCP/ipsccp-range-crashes.ll
index 1b33ff31a095..99d728aba708 100644
--- a/llvm/test/Transforms/SCCP/ipsccp-range-crashes.ll
+++ b/llvm/test/Transforms/SCCP/ipsccp-range-crashes.ll
@@ -7,21 +7,21 @@
 @global = internal local_unnamed_addr global i32 0, align 4
 @global.3 = internal local_unnamed_addr global i32 0, align 4
 
-define void @main(i8** %arg) {
+define void @main(ptr %arg) {
 ; CHECK-LABEL: @main(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = getelementptr inbounds i8*, i8** [[ARG:%.*]], i64 undef
-; CHECK-NEXT:    [[TMP1:%.*]] = load i8*, i8** [[TMP]], align 8
-; CHECK-NEXT:    [[TMP2:%.*]] = load i8, i8* [[TMP1]], align 1
+; CHECK-NEXT:    [[TMP:%.*]] = getelementptr inbounds ptr, ptr [[ARG:%.*]], i64 undef
+; CHECK-NEXT:    [[TMP1:%.*]] = load ptr, ptr [[TMP]], align 8
+; CHECK-NEXT:    [[TMP2:%.*]] = load i8, ptr [[TMP1]], align 1
 ; CHECK-NEXT:    [[TMP3:%.*]] = sext i8 [[TMP2]] to i32
 ; CHECK-NEXT:    [[TMP4:%.*]] = icmp ne i32 [[TMP3]], 45
 ; CHECK-NEXT:    [[TMP5:%.*]] = select i1 [[TMP4]], i32 2, i32 4
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  %tmp = getelementptr inbounds i8*, i8** %arg, i64 undef
-  %tmp1 = load i8*, i8** %tmp, align 8
-  %tmp2 = load i8, i8* %tmp1, align 1
+  %tmp = getelementptr inbounds ptr, ptr %arg, i64 undef
+  %tmp1 = load ptr, ptr %tmp, align 8
+  %tmp2 = load i8, ptr %tmp1, align 1
   %tmp3 = sext i8 %tmp2 to i32
   %tmp4 = icmp ne i32 %tmp3, 45
   %tmp5 = select i1 %tmp4, i32 2, i32 4
@@ -41,7 +41,7 @@ define void @ham() local_unnamed_addr {
 ; CHECK-NEXT:    br label [[BB4]]
 ; CHECK:       bb4:
 ; CHECK-NEXT:    [[TMP5:%.*]] = phi i64 [ 0, [[BB1]] ], [ 15, [[BB3:%.*]] ]
-; CHECK-NEXT:    [[TMP6:%.*]] = add i64 [[TMP5]], add (i64 xor (i64 ptrtoint ([25 x i8]* @global.2 to i64), i64 -1), i64 1)
+; CHECK-NEXT:    [[TMP6:%.*]] = add i64 [[TMP5]], add (i64 xor (i64 ptrtoint (ptr @global.2 to i64), i64 -1), i64 1)
 ; CHECK-NEXT:    unreachable
 ; CHECK:       bb7:
 ; CHECK-NEXT:    br label [[BB3]]
@@ -61,7 +61,7 @@ bb3:                                              ; preds = %bb7
 
 bb4:                                              ; preds = %bb3, %bb1
   %tmp5 = phi i64 [ 0, %bb1 ], [ %tmp10, %bb3 ]
-  %tmp6 = add i64 %tmp5, add (i64 xor (i64 ptrtoint ([25 x i8]* @global.2 to i64), i64 -1), i64 1)
+  %tmp6 = add i64 %tmp5, add (i64 xor (i64 ptrtoint (ptr @global.2 to i64), i64 -1), i64 1)
   unreachable
 
 bb7:                                              ; preds = %bb2
@@ -76,19 +76,19 @@ declare i32 @barney.4()
 define void @wobble() {
 ; CHECK-LABEL: @wobble(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = load i32, i32* @global, align 4
-; CHECK-NEXT:    store i32 [[TMP]], i32* @global.3, align 4
+; CHECK-NEXT:    [[TMP:%.*]] = load i32, ptr @global, align 4
+; CHECK-NEXT:    store i32 [[TMP]], ptr @global.3, align 4
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  %tmp = load i32, i32* @global, align 4
-  store i32 %tmp, i32* @global.3, align 4
+  %tmp = load i32, ptr @global, align 4
+  store i32 %tmp, ptr @global.3, align 4
   ret void
 }
 
 define i32 @wobble.5(i32 %arg) {
 bb:
-  %tmp = load i32, i32* @global.3, align 4
+  %tmp = load i32, ptr @global.3, align 4
   %tmp1 = sdiv i32 0, %tmp
   ret i32 %tmp1
 }
@@ -104,7 +104,7 @@ define void @eggs() {
 ; CHECK-NEXT:    [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 1
 ; CHECK-NEXT:    br i1 [[TMP4]], label [[BB1]], label [[BB5:%.*]]
 ; CHECK:       bb5:
-; CHECK-NEXT:    store i32 [[TMP2]], i32* @global, align 4
+; CHECK-NEXT:    store i32 [[TMP2]], ptr @global, align 4
 ; CHECK-NEXT:    ret void
 ;
 bb:
@@ -118,14 +118,14 @@ bb1:                                              ; preds = %bb1, %bb
   br i1 %tmp4, label %bb1, label %bb5
 
 bb5:                                              ; preds = %bb1
-  store i32 %tmp2, i32* @global, align 4
+  store i32 %tmp2, ptr @global, align 4
   ret void
 }
 
-declare i32* @bar(i32) local_unnamed_addr #3
+declare ptr @bar(i32) local_unnamed_addr #3
 
 ; Function Attrs: nounwind ssp uwtable
-define { i8, i32* } @struct_crash(i32 %BitWidth) local_unnamed_addr #0 align 2 {
+define { i8, ptr } @struct_crash(i32 %BitWidth) local_unnamed_addr #0 align 2 {
 ; CHECK-LABEL: @struct_crash(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    switch i32 [[BITWIDTH:%.*]], label [[IF_END:%.*]] [
@@ -135,14 +135,14 @@ define { i8, i32* } @struct_crash(i32 %BitWidth) local_unnamed_addr #0 align 2 {
 ; CHECK:       sw.bb1.i:
 ; CHECK-NEXT:    br label [[CLEANUP]]
 ; CHECK:       if.end:
-; CHECK-NEXT:    [[CALL_I:%.*]] = tail call i32* @bar(i32 [[BITWIDTH]])
+; CHECK-NEXT:    [[CALL_I:%.*]] = tail call ptr @bar(i32 [[BITWIDTH]])
 ; CHECK-NEXT:    br label [[CLEANUP]]
 ; CHECK:       cleanup:
-; CHECK-NEXT:    [[V1:%.*]] = phi i32* [ [[CALL_I]], [[IF_END]] ], [ null, [[SW_BB1_I]] ], [ null, [[ENTRY:%.*]] ]
+; CHECK-NEXT:    [[V1:%.*]] = phi ptr [ [[CALL_I]], [[IF_END]] ], [ null, [[SW_BB1_I]] ], [ null, [[ENTRY:%.*]] ]
 ; CHECK-NEXT:    [[V2:%.*]] = phi i8 [ 0, [[IF_END]] ], [ 3, [[SW_BB1_I]] ], [ 2, [[ENTRY]] ]
-; CHECK-NEXT:    [[DOTFCA_0_INSERT:%.*]] = insertvalue { i8, i32* } undef, i8 [[V2]], 0
-; CHECK-NEXT:    [[DOTFCA_1_INSERT:%.*]] = insertvalue { i8, i32* } [[DOTFCA_0_INSERT]], i32* [[V1]], 1
-; CHECK-NEXT:    ret { i8, i32* } [[DOTFCA_1_INSERT]]
+; CHECK-NEXT:    [[DOTFCA_0_INSERT:%.*]] = insertvalue { i8, ptr } undef, i8 [[V2]], 0
+; CHECK-NEXT:    [[DOTFCA_1_INSERT:%.*]] = insertvalue { i8, ptr } [[DOTFCA_0_INSERT]], ptr [[V1]], 1
+; CHECK-NEXT:    ret { i8, ptr } [[DOTFCA_1_INSERT]]
 ;
 entry:
   switch i32 %BitWidth, label %if.end [
@@ -154,25 +154,25 @@ sw.bb1.i:                                         ; preds = %entry
   br label %cleanup
 
 if.end:                                           ; preds = %entry
-  %call.i = tail call i32* @bar(i32 %BitWidth)
+  %call.i = tail call ptr @bar(i32 %BitWidth)
   br label %cleanup
 
 cleanup:                                          ; preds = %entry, %sw.bb1.i, %sw.bb2.i, %sw.bb3.i, %sw.bb4.i, %sw.bb5.i, %if.end
-  %v1 = phi i32* [ %call.i, %if.end ], [ null, %sw.bb1.i ], [ null, %entry ]
+  %v1 = phi ptr [ %call.i, %if.end ], [ null, %sw.bb1.i ], [ null, %entry ]
   %v2 = phi i8 [ 0, %if.end ], [ 3, %sw.bb1.i ], [ 2, %entry ]
-  %.fca.0.insert = insertvalue { i8, i32* } undef, i8 %v2, 0
-  %.fca.1.insert = insertvalue { i8, i32* } %.fca.0.insert, i32* %v1, 1
-  ret { i8, i32* } %.fca.1.insert
+  %.fca.0.insert = insertvalue { i8, ptr } undef, i8 %v2, 0
+  %.fca.1.insert = insertvalue { i8, ptr } %.fca.0.insert, ptr %v1, 1
+  ret { i8, ptr } %.fca.1.insert
 }
 
-define i64 @crash_ctpop(i1 %cond, i32* %addr) {
+define i64 @crash_ctpop(i1 %cond, ptr %addr) {
 ; CHECK-LABEL: @crash_ctpop(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br i1 [[COND:%.*]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
 ; CHECK:       if.then:
 ; CHECK-NEXT:    ret i64 0
 ; CHECK:       if.else:
-; CHECK-NEXT:    [[LV:%.*]] = load i32, i32* [[ADDR:%.*]], align 8
+; CHECK-NEXT:    [[LV:%.*]] = load i32, ptr [[ADDR:%.*]], align 8
 ; CHECK-NEXT:    [[ANDV:%.*]] = and i32 [[LV]], 16777215
 ; CHECK-NEXT:    [[TRUNCV:%.*]] = zext i32 [[ANDV]] to i64
 ; CHECK-NEXT:    [[RES:%.*]] = tail call i64 @llvm.ctpop.i64(i64 [[TRUNCV]])
@@ -185,7 +185,7 @@ if.then:                                        ; preds = %entry
   ret i64 0
 
 if.else:                                        ; preds = %entry
-  %lv = load i32, i32* %addr, align 8
+  %lv = load i32, ptr %addr, align 8
   %andv = and i32 %lv, 16777215
   %truncv = zext i32 %andv to i64
   %res = tail call i64 @llvm.ctpop.i64(i64 %truncv)

diff  --git a/llvm/test/Transforms/SCCP/ipsccp-ssa-copy-nested-conds.ll b/llvm/test/Transforms/SCCP/ipsccp-ssa-copy-nested-conds.ll
index 2c1361694755..55a7fdf7197e 100644
--- a/llvm/test/Transforms/SCCP/ipsccp-ssa-copy-nested-conds.ll
+++ b/llvm/test/Transforms/SCCP/ipsccp-ssa-copy-nested-conds.ll
@@ -3,25 +3,24 @@
 
 ; Test for PR39772
 
-%struct.Node = type { %struct.Node*, %struct.Node*, i32 }
+%struct.Node = type { ptr, ptr, i32 }
 
-define i32 @check(%struct.Node* %node) {
-; CHECK-LABEL: define i32 @check(
+define i32 @check(ptr %node) {
+; CHECK-LABEL: @check(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[CMP:%.*]] = icmp eq %struct.Node* [[NODE:%.*]], null
+; CHECK-NEXT:    [[CMP:%.*]] = icmp eq ptr [[NODE:%.*]], null
 ; CHECK-NEXT:    br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
 ; CHECK:       if.then:
 ; CHECK-NEXT:    br label [[CLEANUP:%.*]]
 ; CHECK:       if.end:
-; CHECK-NEXT:    [[LEFT:%.*]] = getelementptr inbounds [[STRUCT_NODE:%.*]], %struct.Node* [[NODE]], i32 0, i32 0
-; CHECK-NEXT:    [[TMP0:%.*]] = load %struct.Node*, %struct.Node** [[LEFT]]
-; CHECK-NEXT:    [[CALL:%.*]] = call i32 @check(%struct.Node* [[TMP0]])
-; CHECK-NEXT:    [[RIGHT:%.*]] = getelementptr inbounds [[STRUCT_NODE]], %struct.Node* [[NODE]], i32 0, i32 1
-; CHECK-NEXT:    [[TMP1:%.*]] = load %struct.Node*, %struct.Node** [[RIGHT]]
-; CHECK-NEXT:    [[CALL1:%.*]] = call i32 @check(%struct.Node* [[TMP1]])
-; CHECK-NEXT:    [[TMP2:%.*]] = load %struct.Node*, %struct.Node** [[RIGHT]]
-; CHECK-NEXT:    [[HEIGHT:%.*]] = getelementptr inbounds [[STRUCT_NODE]], %struct.Node* [[TMP2]], i32 0, i32 2
-; CHECK-NEXT:    [[TMP3:%.*]] = load i32, i32* [[HEIGHT]]
+; CHECK-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[NODE]], align 8
+; CHECK-NEXT:    [[CALL:%.*]] = call i32 @check(ptr [[TMP0]])
+; CHECK-NEXT:    [[RIGHT:%.*]] = getelementptr inbounds [[STRUCT_NODE:%.*]], ptr [[NODE]], i32 0, i32 1
+; CHECK-NEXT:    [[TMP1:%.*]] = load ptr, ptr [[RIGHT]], align 8
+; CHECK-NEXT:    [[CALL1:%.*]] = call i32 @check(ptr [[TMP1]])
+; CHECK-NEXT:    [[TMP2:%.*]] = load ptr, ptr [[RIGHT]], align 8
+; CHECK-NEXT:    [[HEIGHT:%.*]] = getelementptr inbounds [[STRUCT_NODE]], ptr [[TMP2]], i32 0, i32 2
+; CHECK-NEXT:    [[TMP3:%.*]] = load i32, ptr [[HEIGHT]], align 4
 ; CHECK-NEXT:    [[CMP3:%.*]] = icmp ne i32 [[TMP3]], [[CALL1]]
 ; CHECK-NEXT:    br i1 [[CMP3]], label [[IF_THEN4:%.*]], label [[IF_END5:%.*]]
 ; CHECK:       if.then4:
@@ -40,22 +39,21 @@ define i32 @check(%struct.Node* %node) {
 ; CHECK-NEXT:    ret i32 [[RETVAL_0]]
 ;
 entry:
-  %cmp = icmp eq %struct.Node* %node, null
+  %cmp = icmp eq ptr %node, null
   br i1 %cmp, label %if.then, label %if.end
 
 if.then:                                          ; preds = %entry
   br label %cleanup
 
 if.end:                                           ; preds = %entry
-  %left = getelementptr inbounds %struct.Node, %struct.Node* %node, i32 0, i32 0
-  %0 = load %struct.Node*, %struct.Node** %left
-  %call = call i32 @check(%struct.Node* %0)
-  %right = getelementptr inbounds %struct.Node, %struct.Node* %node, i32 0, i32 1
-  %1 = load %struct.Node*, %struct.Node** %right
-  %call1 = call i32 @check(%struct.Node* %1)
-  %2 = load %struct.Node*, %struct.Node** %right
-  %height = getelementptr inbounds %struct.Node, %struct.Node* %2, i32 0, i32 2
-  %3 = load i32, i32* %height
+  %0 = load ptr, ptr %node
+  %call = call i32 @check(ptr %0)
+  %right = getelementptr inbounds %struct.Node, ptr %node, i32 0, i32 1
+  %1 = load ptr, ptr %right
+  %call1 = call i32 @check(ptr %1)
+  %2 = load ptr, ptr %right
+  %height = getelementptr inbounds %struct.Node, ptr %2, i32 0, i32 2
+  %3 = load i32, ptr %height
   %cmp3 = icmp ne i32 %3, %call1
   br i1 %cmp3, label %if.then4, label %if.end5
 
@@ -79,7 +77,7 @@ cleanup:                                          ; preds = %if.else, %if.then7,
   ret i32 %retval.0
 }
 
-declare i8* @test2_callee(i32, i32)
+declare ptr @test2_callee(i32, i32)
 
 define void @test2() {
 ; CHECK-LABEL: @test2(
@@ -92,7 +90,7 @@ define void @test2() {
 ; CHECK:       if.else33:
 ; CHECK-NEXT:    br label [[IF_THEN38:%.*]]
 ; CHECK:       if.then38:
-; CHECK-NEXT:    [[CALL42:%.*]] = call i8* @test2_callee(i32 0, i32 0)
+; CHECK-NEXT:    [[CALL42:%.*]] = call ptr @test2_callee(i32 0, i32 0)
 ; CHECK-NEXT:    unreachable
 ;
 entry:
@@ -116,7 +114,7 @@ if.else33:                                        ; preds = %for.body
   br i1 %or.cond, label %if.then38, label %for.inc46
 
 if.then38:                                        ; preds = %if.else33
-  %call42 = call i8* @test2_callee(i32 %op.0, i32 0)
+  %call42 = call ptr @test2_callee(i32 %op.0, i32 0)
   unreachable
 
 for.inc46:                                        ; preds = %if.else33

diff  --git a/llvm/test/Transforms/SCCP/ipscp-drop-argmemonly.ll b/llvm/test/Transforms/SCCP/ipscp-drop-argmemonly.ll
index 6a6f52afb0be..015c9afb3720 100644
--- a/llvm/test/Transforms/SCCP/ipscp-drop-argmemonly.ll
+++ b/llvm/test/Transforms/SCCP/ipscp-drop-argmemonly.ll
@@ -10,152 +10,152 @@
 
 ; Here the pointer argument %arg will be replaced by a constant. We need to
 ; drop argmemonly.
-define internal void @ptrarg.1(i32* %arg, i32 %val) argmemonly nounwind {
+define internal void @ptrarg.1(ptr %arg, i32 %val) argmemonly nounwind {
 ; CHECK: Function Attrs: nounwind
 ; CHECK-LABEL: @ptrarg.1(
-; CHECK-NEXT:    store i32 10, i32* @g, align 4
+; CHECK-NEXT:    store i32 10, ptr @g, align 4
 ; CHECK-NEXT:    ret void
 ;
-  store i32 %val, i32* %arg
+  store i32 %val, ptr %arg
   ret void
 }
 
 define i32 @caller.1(i32 %n) {
 ; CHECK-LABEL: @caller.1(
-; CHECK-NEXT:    store i32 1, i32* @g, align 4
-; CHECK-NEXT:    tail call void @ptrarg.1(i32* @g, i32 10)
-; CHECK-NEXT:    [[G_VAL:%.*]] = load i32, i32* @g, align 4
+; CHECK-NEXT:    store i32 1, ptr @g, align 4
+; CHECK-NEXT:    tail call void @ptrarg.1(ptr @g, i32 10)
+; CHECK-NEXT:    [[G_VAL:%.*]] = load i32, ptr @g, align 4
 ; CHECK-NEXT:    ret i32 [[G_VAL]]
 ;
-  store i32 1, i32* @g
-  tail call void @ptrarg.1(i32* @g, i32 10)
-  %g.val = load i32, i32* @g
+  store i32 1, ptr @g
+  tail call void @ptrarg.1(ptr @g, i32 10)
+  %g.val = load i32, ptr @g
   ret i32 %g.val
 }
 
 
 ; Here only the non-pointer argument %val is replaced, no need
 ; to drop the argmemonly attribute.
-define internal void @ptrarg.2(i32* %arg, i32 %val) argmemonly nounwind {
+define internal void @ptrarg.2(ptr %arg, i32 %val) argmemonly nounwind {
 ; CHECK: Function Attrs: argmemonly nounwind
 ; CHECK-LABEL: @ptrarg.2(
-; CHECK-NEXT:    store i32 10, i32* [[ARG:%.*]], align 4
+; CHECK-NEXT:    store i32 10, ptr [[ARG:%.*]], align 4
 ; CHECK-NEXT:    ret void
 ;
-  store i32 %val, i32* %arg
+  store i32 %val, ptr %arg
   ret void
 }
 
-define void @caller.2(i32* %ptr) {
+define void @caller.2(ptr %ptr) {
 ; CHECK-LABEL: @caller.2(
-; CHECK-NEXT:    tail call void @ptrarg.2(i32* [[PTR:%.*]], i32 10)
+; CHECK-NEXT:    tail call void @ptrarg.2(ptr [[PTR:%.*]], i32 10)
 ; CHECK-NEXT:    ret void
 ;
-  tail call void @ptrarg.2(i32* %ptr, i32 10)
+  tail call void @ptrarg.2(ptr %ptr, i32 10)
   ret void
 }
 
 
 ; Here the pointer argument %arg will be replaced by a constant. We need to
 ; drop inaccessiblemem_or_argmemonly.
-define internal void @ptrarg.3(i32* %arg, i32 %val) inaccessiblemem_or_argmemonly nounwind {
+define internal void @ptrarg.3(ptr %arg, i32 %val) inaccessiblemem_or_argmemonly nounwind {
 ; CHECK: Function Attrs: nounwind
 ; CHECK-LABEL: @ptrarg.3(
-; CHECK-NEXT:    store i32 10, i32* @g, align 4
+; CHECK-NEXT:    store i32 10, ptr @g, align 4
 ; CHECK-NEXT:    ret void
 ;
-  store i32 %val, i32* %arg
+  store i32 %val, ptr %arg
   ret void
 }
 
 define i32 @caller.3(i32 %n) {
 ; CHECK-LABEL: @caller.3(
-; CHECK-NEXT:    store i32 1, i32* @g, align 4
-; CHECK-NEXT:    tail call void @ptrarg.3(i32* @g, i32 10)
-; CHECK-NEXT:    [[G_VAL:%.*]] = load i32, i32* @g, align 4
+; CHECK-NEXT:    store i32 1, ptr @g, align 4
+; CHECK-NEXT:    tail call void @ptrarg.3(ptr @g, i32 10)
+; CHECK-NEXT:    [[G_VAL:%.*]] = load i32, ptr @g, align 4
 ; CHECK-NEXT:    ret i32 [[G_VAL]]
 ;
-  store i32 1, i32* @g
-  tail call void @ptrarg.3(i32* @g, i32 10)
-  %g.val = load i32, i32* @g
+  store i32 1, ptr @g
+  tail call void @ptrarg.3(ptr @g, i32 10)
+  %g.val = load i32, ptr @g
   ret i32 %g.val
 }
 
 
 ; Here only the non-pointer argument %val is replaced, no need
 ; to drop the inaccessiblemem_or_argmemonly attribute.
-define internal void @ptrarg.4(i32* %arg, i32 %val) inaccessiblemem_or_argmemonly nounwind {
+define internal void @ptrarg.4(ptr %arg, i32 %val) inaccessiblemem_or_argmemonly nounwind {
 ; CHECK: Function Attrs: inaccessiblemem_or_argmemonly nounwind
 ; CHECK-LABEL: @ptrarg.4(
-; CHECK-NEXT:    store i32 10, i32* [[ARG:%.*]], align 4
+; CHECK-NEXT:    store i32 10, ptr [[ARG:%.*]], align 4
 ; CHECK-NEXT:    ret void
 ;
-  store i32 %val, i32* %arg
+  store i32 %val, ptr %arg
   ret void
 }
 
-define void @caller.4(i32* %ptr) {
+define void @caller.4(ptr %ptr) {
 ; CHECK-LABEL: @caller.4(
-; CHECK-NEXT:    tail call void @ptrarg.4(i32* [[PTR:%.*]], i32 10)
+; CHECK-NEXT:    tail call void @ptrarg.4(ptr [[PTR:%.*]], i32 10)
 ; CHECK-NEXT:    ret void
 ;
-  tail call void @ptrarg.4(i32* %ptr, i32 10)
+  tail call void @ptrarg.4(ptr %ptr, i32 10)
   ret void
 }
 
 
 ; Here the pointer argument %arg will be replaced by a constant. We need to
 ; drop inaccessiblemem_or_argmemonly.
-define internal void @ptrarg.5(i32* %arg, i32 %val) argmemonly inaccessiblemem_or_argmemonly nounwind {
+define internal void @ptrarg.5(ptr %arg, i32 %val) argmemonly inaccessiblemem_or_argmemonly nounwind {
 ; CHECK: Function Attrs: nounwind
 ; CHECK-LABEL: @ptrarg.5(
-; CHECK-NEXT:    store i32 10, i32* @g, align 4
+; CHECK-NEXT:    store i32 10, ptr @g, align 4
 ; CHECK-NEXT:    ret void
 ;
-  store i32 %val, i32* %arg
+  store i32 %val, ptr %arg
   ret void
 }
 
 define i32 @caller.5(i32 %n) {
 ; CHECK-LABEL: @caller.5(
-; CHECK-NEXT:    store i32 1, i32* @g, align 4
-; CHECK-NEXT:    tail call void @ptrarg.5(i32* @g, i32 10)
-; CHECK-NEXT:    [[G_VAL:%.*]] = load i32, i32* @g, align 4
+; CHECK-NEXT:    store i32 1, ptr @g, align 4
+; CHECK-NEXT:    tail call void @ptrarg.5(ptr @g, i32 10)
+; CHECK-NEXT:    [[G_VAL:%.*]] = load i32, ptr @g, align 4
 ; CHECK-NEXT:    ret i32 [[G_VAL]]
 ;
-  store i32 1, i32* @g
-  tail call void @ptrarg.5(i32* @g, i32 10)
-  %g.val = load i32, i32* @g
+  store i32 1, ptr @g
+  tail call void @ptrarg.5(ptr @g, i32 10)
+  %g.val = load i32, ptr @g
   ret i32 %g.val
 }
 
 
 ; Make sure callsite attributes are also dropped when a pointer argument is
 ; replaced.
-define internal void @ptrarg.6.cs.attributes(i32* %arg, i32 %val) {
+define internal void @ptrarg.6.cs.attributes(ptr %arg, i32 %val) {
 ; CHECK-LABEL: @ptrarg.6.cs.attributes(
 ; CHECK-NEXT:    unreachable
 ;
-  store i32 %val, i32* %arg
+  store i32 %val, ptr %arg
   ret void
 }
 
 define i32 @caller.6.cs.attributes(i32 %n) {
 ; CHECK-LABEL: @caller.6.cs.attributes(
-; CHECK-NEXT:    store i32 1, i32* @g, align 4
-; CHECK-NEXT:    tail call void @ptrarg.5(i32* @g, i32 10) [[NOUNWIND:#[0-9]+]]
-; CHECK-NEXT:    tail call void @ptrarg.5(i32* @g, i32 10) [[NOUNWIND:#[0-9]+]]
-; CHECK-NEXT:    tail call void @ptrarg.5(i32* @g, i32 10) [[NOUNWIND:#[0-9]+]]
-; CHECK-NEXT:    tail call void @ptrarg.5(i32* @g, i32 10) [[NOUNWIND:#[0-9]+]]
-; CHECK-NEXT:    [[G_VAL:%.*]] = load i32, i32* @g, align 4
+; CHECK-NEXT:    store i32 1, ptr @g, align 4
+; CHECK-NEXT:    tail call void @ptrarg.5(ptr @g, i32 10) [[NOUNWIND:#[0-9]+]]
+; CHECK-NEXT:    tail call void @ptrarg.5(ptr @g, i32 10) [[NOUNWIND:#[0-9]+]]
+; CHECK-NEXT:    tail call void @ptrarg.5(ptr @g, i32 10) [[NOUNWIND:#[0-9]+]]
+; CHECK-NEXT:    tail call void @ptrarg.5(ptr @g, i32 10) [[NOUNWIND:#[0-9]+]]
+; CHECK-NEXT:    [[G_VAL:%.*]] = load i32, ptr @g, align 4
 ; CHECK-NEXT:    ret i32 [[G_VAL]]
 ;
-  store i32 1, i32* @g
-  tail call void @ptrarg.5(i32* @g, i32 10) argmemonly inaccessiblemem_or_argmemonly nounwind
-  tail call void @ptrarg.5(i32* @g, i32 10) inaccessiblemem_or_argmemonly nounwind
-  tail call void @ptrarg.5(i32* @g, i32 10) argmemonly nounwind
-  tail call void @ptrarg.5(i32* @g, i32 10) nounwind
-  %g.val = load i32, i32* @g
+  store i32 1, ptr @g
+  tail call void @ptrarg.5(ptr @g, i32 10) argmemonly inaccessiblemem_or_argmemonly nounwind
+  tail call void @ptrarg.5(ptr @g, i32 10) inaccessiblemem_or_argmemonly nounwind
+  tail call void @ptrarg.5(ptr @g, i32 10) argmemonly nounwind
+  tail call void @ptrarg.5(ptr @g, i32 10) nounwind
+  %g.val = load i32, ptr @g
   ret i32 %g.val
 }
 

diff  --git a/llvm/test/Transforms/SCCP/landingpad.ll b/llvm/test/Transforms/SCCP/landingpad.ll
index e07ef689ac02..36f26e4bfd26 100644
--- a/llvm/test/Transforms/SCCP/landingpad.ll
+++ b/llvm/test/Transforms/SCCP/landingpad.ll
@@ -5,7 +5,7 @@
 
 declare void @fn()
 
-define void @test() personality i8* null {
+define void @test() personality ptr null {
 ; CHECK-LABEL: @test(
 ; CHECK-NEXT:    invoke void @fn()
 ; CHECK-NEXT:    to label [[SUCCESS:%.*]] unwind label [[FAILURE:%.*]]

diff  --git a/llvm/test/Transforms/SCCP/latticeval-invalidate.ll b/llvm/test/Transforms/SCCP/latticeval-invalidate.ll
index 2a35a02d99fb..c94088a4169c 100644
--- a/llvm/test/Transforms/SCCP/latticeval-invalidate.ll
+++ b/llvm/test/Transforms/SCCP/latticeval-invalidate.ll
@@ -7,11 +7,10 @@ BB4:
   %A20 = alloca i1
   %A15 = alloca i64
   %A7 = alloca i64
-  %A3 = alloca i32**
-  %P = getelementptr i32, i32* @A, i32 0
-  %B = ptrtoint i32* %P to i64
+  %A3 = alloca ptr
+  %B = ptrtoint ptr @A to i64
   %B8 = shl i64 %B, 9223372036854775807
-  %G10 = getelementptr i32*, i32** undef, i64 %B
+  %G10 = getelementptr ptr, ptr undef, i64 %B
   %B10 = urem i64 %B, %B8
   %B12 = shl i64 %B, %B
   %BB = and i64 %B, %B8
@@ -20,21 +19,21 @@ BB4:
   %C5 = icmp uge i64 %B, %B10
   %C17 = fcmp ord double 4.940660e-324, 0x7FEFFFFFFFFFFFFF
   %C2 = icmp uge i1 %C17, false
-  %G = getelementptr i32, i32* %P, i1 %C17
+  %G = getelementptr i32, ptr @A, i1 %C17
   %X = select i1 false, i712 0, i712 1
   %C4 = icmp ule i1 true, false
   %B3 = xor i1 %C17, %C2
   %C33 = icmp slt i1 false, %C5
   %B15 = sub i64 %B8, %B23
   %C18 = icmp slt i64 undef, %BB
-  %G29 = getelementptr i32**, i32*** undef, i64 %B15
+  %G29 = getelementptr ptr, ptr undef, i64 %B15
   %C35 = icmp eq i1 %C17, undef
   %C31 = icmp ult i1 %C35, %C5
   %C29 = icmp sle i1 true, %C5
   %C16 = icmp ne i16 -1, -32768
   %A24 = alloca i1
   %A21 = alloca i1
-  %A25 = alloca i32**
+  %A25 = alloca ptr
   %C7 = icmp ule i1 %C4, %B3
   %C14 = icmp slt i64 %B8, 0
   ret void

diff  --git a/llvm/test/Transforms/SCCP/load-store-range.ll b/llvm/test/Transforms/SCCP/load-store-range.ll
index a57e42d1f7e2..1760121c14e6 100644
--- a/llvm/test/Transforms/SCCP/load-store-range.ll
+++ b/llvm/test/Transforms/SCCP/load-store-range.ll
@@ -7,7 +7,7 @@ declare void @use(i1)
 
 define void @test1a() {
 ; CHECK-LABEL: @test1a(
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* @G
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr @G
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 false)
@@ -16,7 +16,7 @@ define void @test1a() {
 ; CHECK-NEXT:    call void @use(i1 [[C_1]])
 ; CHECK-NEXT:    ret void
 ;
-  %X = load i32, i32* @G
+  %X = load i32, ptr @G
   %t.1 = icmp ne i32 %X, 124
   call void @use(i1 %t.1)
   %t.2 = icmp ult i32 %X, 124
@@ -34,18 +34,18 @@ define void @test1b(i1 %c) {
 ; CHECK-LABEL: @test1b(
 ; CHECK-NEXT:    br i1 [[C:%.*]], label [[T:%.*]], label [[F:%.*]]
 ; CHECK:       T:
-; CHECK-NEXT:    store i32 17, i32* @G
+; CHECK-NEXT:    store i32 17, ptr @G
 ; CHECK-NEXT:    ret void
 ; CHECK:       F:
-; CHECK-NEXT:    store i32 123, i32* @G
+; CHECK-NEXT:    store i32 123, ptr @G
 ; CHECK-NEXT:    ret void
 ;
   br i1 %c, label %T, label %F
 T:
-  store i32 17, i32* @G
+  store i32 17, ptr @G
   ret void
 F:
-  store i32 123, i32* @G
+  store i32 123, ptr @G
   ret void
 }
 
@@ -54,7 +54,7 @@ F:
 
 define void @test2a() {
 ; CHECK-LABEL: @test2a(
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* @H
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr @H
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 false)
@@ -63,7 +63,7 @@ define void @test2a() {
 ; CHECK-NEXT:    call void @use(i1 [[C_1]])
 ; CHECK-NEXT:    ret void
 ;
-  %X = load i32, i32* @H
+  %X = load i32, ptr @H
   %t.1 = icmp ne i32 %X, 124
   call void @use(i1 %t.1)
   %t.2 = icmp ult i32 %X, 124
@@ -83,13 +83,13 @@ define void @test2b(i1 %c.1, i1 %c.2) {
 ; CHECK:       T:
 ; CHECK-NEXT:    br i1 [[C_2:%.*]], label [[T_1:%.*]], label [[F_1:%.*]]
 ; CHECK:       T.1:
-; CHECK-NEXT:    store i32 17, i32* @H
+; CHECK-NEXT:    store i32 17, ptr @H
 ; CHECK-NEXT:    ret void
 ; CHECK:       F.1:
-; CHECK-NEXT:    store i32 20, i32* @H
+; CHECK-NEXT:    store i32 20, ptr @H
 ; CHECK-NEXT:    ret void
 ; CHECK:       F:
-; CHECK-NEXT:    store i32 123, i32* @H
+; CHECK-NEXT:    store i32 123, ptr @H
 ; CHECK-NEXT:    ret void
 ;
   br i1 %c.1, label %T, label %F
@@ -97,15 +97,15 @@ T:
   br i1 %c.2, label %T.1, label %F.1
 
 T.1:
-  store i32 17, i32* @H
+  store i32 17, ptr @H
   ret void
 
 F.1:
-  store i32 20, i32* @H
+  store i32 20, ptr @H
   ret void
 
 F:
-  store i32 123, i32* @H
+  store i32 123, ptr @H
   ret void
 }
 
@@ -114,7 +114,7 @@ F:
 
 define void @test3a() {
 ; CHECK-LABEL: @test3a(
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* @I
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr @I
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 false)
@@ -123,7 +123,7 @@ define void @test3a() {
 ; CHECK-NEXT:    call void @use(i1 [[C_1]])
 ; CHECK-NEXT:    ret void
 ;
-  %X = load i32, i32* @I
+  %X = load i32, ptr @I
   %t.1 = icmp ne i32 %X, 124
   call void @use(i1 %t.1)
   %t.2 = icmp ult i32 %X, 124
@@ -146,7 +146,7 @@ define void @test3b(i1 %c.1, i1 %c.2) {
 ; CHECK-NEXT:    br label [[EXIT]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    [[P:%.*]] = phi i32 [ 17, [[T]] ], [ 123, [[F]] ]
-; CHECK-NEXT:    store i32 [[P]], i32* @I
+; CHECK-NEXT:    store i32 [[P]], ptr @I
 ; CHECK-NEXT:    ret void
 ;
   br i1 %c.1, label %T, label %F
@@ -159,7 +159,7 @@ F:
 
 exit:
   %p = phi i32 [ 17, %T ], [ 123, %F ]
-  store i32 %p, i32* @I
+  store i32 %p, ptr @I
   ret void
 
 }
@@ -169,7 +169,7 @@ exit:
 
 define void @test4a() {
 ; CHECK-LABEL: @test4a(
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* @J
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr @J
 ; CHECK-NEXT:    [[C_1:%.*]] = icmp ne i32 [[X]], 124
 ; CHECK-NEXT:    call void @use(i1 [[C_1]])
 ; CHECK-NEXT:    [[C_2:%.*]] = icmp ult i32 [[X]], 124
@@ -182,7 +182,7 @@ define void @test4a() {
 ; CHECK-NEXT:    call void @use(i1 [[C_5]])
 ; CHECK-NEXT:    ret void
 ;
-  %X = load i32, i32* @J
+  %X = load i32, ptr @J
   %c.1 = icmp ne i32 %X, 124
   call void @use(i1 %c.1)
   %c.2 = icmp ult i32 %X, 124
@@ -209,7 +209,7 @@ define void @test4b(i1 %c.1, i1 %c.2, i32 %x) {
 ; CHECK-NEXT:    br label [[EXIT]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    [[P:%.*]] = phi i32 [ 17, [[T_1]] ], [ [[X:%.*]], [[F_1]] ], [ 123, [[F]] ]
-; CHECK-NEXT:    store i32 [[P]], i32* @J
+; CHECK-NEXT:    store i32 [[P]], ptr @J
 ; CHECK-NEXT:    ret void
 ;
   br i1 %c.1, label %T, label %F
@@ -227,7 +227,7 @@ F:
 
 exit:
   %p = phi i32 [ 17, %T.1 ], [ %x, %F.1 ], [ 123, %F ]
-  store i32 %p, i32* @J
+  store i32 %p, ptr @J
   ret void
 }
 
@@ -237,7 +237,7 @@ exit:
 
 define void @test5a() {
 ; CHECK-LABEL: @test5a(
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* @K
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr @K
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 false)
@@ -246,7 +246,7 @@ define void @test5a() {
 ; CHECK-NEXT:    call void @use(i1 [[C_1]])
 ; CHECK-NEXT:    ret void
 ;
-  %X = load i32, i32* @K
+  %X = load i32, ptr @K
   %t.1 = icmp ne i32 %X, 499
   call void @use(i1 %t.1)
   %t.2 = icmp ult i32 %X, 600
@@ -266,18 +266,18 @@ define void @test5b(i1 %c.1, i1 %c.2) {
 ; CHECK:       T.1:
 ; CHECK-NEXT:    br i1 [[C_2:%.*]], label [[T_2:%.*]], label [[F_2:%.*]]
 ; CHECK:       T.2:
-; CHECK-NEXT:    store i32 500, i32* @K
+; CHECK-NEXT:    store i32 500, ptr @K
 ; CHECK-NEXT:    ret void
 ; CHECK:       F.2:
-; CHECK-NEXT:    store i32 510, i32* @K
+; CHECK-NEXT:    store i32 510, ptr @K
 ; CHECK-NEXT:    ret void
 ; CHECK:       F.1:
 ; CHECK-NEXT:    br i1 [[C_2]], label [[T_3:%.*]], label [[F_3:%.*]]
 ; CHECK:       T.3:
-; CHECK-NEXT:    store i32 520, i32* @K
+; CHECK-NEXT:    store i32 520, ptr @K
 ; CHECK-NEXT:    ret void
 ; CHECK:       F.3:
-; CHECK-NEXT:    store i32 530, i32* @K
+; CHECK-NEXT:    store i32 530, ptr @K
 ; CHECK-NEXT:    ret void
 ;
   br i1 %c.1, label %T.1, label %F.1
@@ -286,21 +286,21 @@ T.1:
   br i1 %c.2, label %T.2, label %F.2
 
 T.2:
-  store i32 500, i32* @K
+  store i32 500, ptr @K
   ret void
 
 F.2:
-  store i32 510, i32* @K
+  store i32 510, ptr @K
   ret void
 
 F.1:
   br i1 %c.2, label %T.3, label %F.3
 
 T.3:
-  store i32 520, i32* @K
+  store i32 520, ptr @K
   ret void
 
 F.3:
-  store i32 530, i32* @K
+  store i32 530, ptr @K
   ret void
 }

diff  --git a/llvm/test/Transforms/SCCP/loadtest2.ll b/llvm/test/Transforms/SCCP/loadtest2.ll
index ae2935caff0a..439764837835 100644
--- a/llvm/test/Transforms/SCCP/loadtest2.ll
+++ b/llvm/test/Transforms/SCCP/loadtest2.ll
@@ -8,7 +8,7 @@ define i32 @test5(i32 %b) {
 ; CHECK-NEXT:    %add = add nsw i32 undef, %b
 ; CHECK-NEXT:    ret i32 %add
 ;
-  %l = load i32, i32* @j, align 4
+  %l = load i32, ptr @j, align 4
   %add = add nsw i32 %l, %b
   ret i32 %add
 }

diff  --git a/llvm/test/Transforms/SCCP/metadata.ll b/llvm/test/Transforms/SCCP/metadata.ll
index baaf213e1e7a..8b1299c85661 100644
--- a/llvm/test/Transforms/SCCP/metadata.ll
+++ b/llvm/test/Transforms/SCCP/metadata.ll
@@ -4,9 +4,9 @@
 declare void @use(i1)
 declare i32 @get_i32()
 
-define void @load_range(i32* %p) {
+define void @load_range(ptr %p) {
 ; CHECK-LABEL: @load_range(
-; CHECK-NEXT:    [[V:%.*]] = load i32, i32* [[P:%.*]], align 4, !range !0
+; CHECK-NEXT:    [[V:%.*]] = load i32, ptr [[P:%.*]], align 4, !range !0
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    [[C2:%.*]] = icmp ult i32 [[V]], 9
 ; CHECK-NEXT:    call void @use(i1 [[C2]])
@@ -15,7 +15,7 @@ define void @load_range(i32* %p) {
 ; CHECK-NEXT:    call void @use(i1 [[C4]])
 ; CHECK-NEXT:    ret void
 ;
-  %v = load i32, i32* %p, !range !{i32 0, i32 10}
+  %v = load i32, ptr %p, !range !{i32 0, i32 10}
   %c1 = icmp ult i32 %v, 10
   call void @use(i1 %c1)
   %c2 = icmp ult i32 %v, 9
@@ -27,56 +27,56 @@ define void @load_range(i32* %p) {
   ret void
 }
 
-define i32 @load_range_single(i32* %p) {
+define i32 @load_range_single(ptr %p) {
 ; CHECK-LABEL: @load_range_single(
 ; CHECK-NEXT:    ret i32 0
 ;
-  %v = load i32, i32* %p, !range !{i32 0, i32 1}
+  %v = load i32, ptr %p, !range !{i32 0, i32 1}
   ret i32 %v
 }
 
-define i32 @load_range_single_volatile(i32* %p) {
+define i32 @load_range_single_volatile(ptr %p) {
 ; CHECK-LABEL: @load_range_single_volatile(
-; CHECK-NEXT:    [[V:%.*]] = load volatile i32, i32* [[P:%.*]], align 4, !range !1
+; CHECK-NEXT:    [[V:%.*]] = load volatile i32, ptr [[P:%.*]], align 4, !range !1
 ; CHECK-NEXT:    ret i32 [[V]]
 ;
-  %v = load volatile i32, i32* %p, !range !{i32 0, i32 1}
+  %v = load volatile i32, ptr %p, !range !{i32 0, i32 1}
   ret i32 %v
 }
 
-define void @load_nonnull(i32** %p, i32** %p2) {
+define void @load_nonnull(ptr %p, ptr %p2) {
 ; CHECK-LABEL: @load_nonnull(
-; CHECK-NEXT:    [[V:%.*]] = load i32*, i32** [[P:%.*]], align 8, !nonnull !2
-; CHECK-NEXT:    [[V2:%.*]] = load i32*, i32** [[P2:%.*]], align 8, !nonnull !2
+; CHECK-NEXT:    [[V:%.*]] = load ptr, ptr [[P:%.*]], align 8, !nonnull !2
+; CHECK-NEXT:    [[V2:%.*]] = load ptr, ptr [[P2:%.*]], align 8, !nonnull !2
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 false)
 ; CHECK-NEXT:    call void @use(i1 true)
 ; CHECK-NEXT:    call void @use(i1 false)
-; CHECK-NEXT:    [[C5:%.*]] = icmp eq i32* [[V]], [[V2]]
+; CHECK-NEXT:    [[C5:%.*]] = icmp eq ptr [[V]], [[V2]]
 ; CHECK-NEXT:    call void @use(i1 [[C5]])
-; CHECK-NEXT:    [[C6:%.*]] = icmp ne i32* [[V]], [[V2]]
+; CHECK-NEXT:    [[C6:%.*]] = icmp ne ptr [[V]], [[V2]]
 ; CHECK-NEXT:    call void @use(i1 [[C6]])
 ; CHECK-NEXT:    ret void
 ;
-  %v = load i32*, i32** %p, !nonnull !{}
-  %v2 = load i32*, i32** %p2, !nonnull !{}
-  %c1 = icmp ne i32* %v, null
+  %v = load ptr, ptr %p, !nonnull !{}
+  %v2 = load ptr, ptr %p2, !nonnull !{}
+  %c1 = icmp ne ptr %v, null
   call void @use(i1 %c1)
-  %c2 = icmp eq i32* %v, null
+  %c2 = icmp eq ptr %v, null
   call void @use(i1 %c2)
-  %c3 = icmp ne i32* null, %v
+  %c3 = icmp ne ptr null, %v
   call void @use(i1 %c3)
-  %c4 = icmp eq i32* null, %v
+  %c4 = icmp eq ptr null, %v
   call void @use(i1 %c4)
   ; There is no particular relationship between two nonnull values.
-  %c5 = icmp eq i32* %v, %v2
+  %c5 = icmp eq ptr %v, %v2
   call void @use(i1 %c5)
-  %c6 = icmp ne i32* %v, %v2
+  %c6 = icmp ne ptr %v, %v2
   call void @use(i1 %c6)
   ret void
 }
 
-define void @call_range(i32* %p) {
+define void @call_range(ptr %p) {
 ; CHECK-LABEL: @call_range(
 ; CHECK-NEXT:    [[V:%.*]] = call i32 @get_i32(), !range !0
 ; CHECK-NEXT:    call void @use(i1 true)
@@ -107,13 +107,13 @@ define internal i1 @ip_cmp_range(i32 %v) {
   ret i1 %c
 }
 
-define i1 @ip_load_range(i32* %p) {
+define i1 @ip_load_range(ptr %p) {
 ; CHECK-LABEL: @ip_load_range(
-; CHECK-NEXT:    [[V:%.*]] = load i32, i32* [[P:%.*]], align 4, !range !0
+; CHECK-NEXT:    [[V:%.*]] = load i32, ptr [[P:%.*]], align 4, !range !0
 ; CHECK-NEXT:    [[C:%.*]] = call i1 @ip_cmp_range(i32 [[V]])
 ; CHECK-NEXT:    ret i1 true
 ;
-  %v = load i32, i32* %p, !range !{i32 0, i32 10}
+  %v = load i32, ptr %p, !range !{i32 0, i32 10}
   %c = call i1 @ip_cmp_range(i32 %v)
   ret i1 %c
 }

diff  --git a/llvm/test/Transforms/SCCP/multiple_callbacks.ll b/llvm/test/Transforms/SCCP/multiple_callbacks.ll
index b3092e4ceed9..47c882985631 100644
--- a/llvm/test/Transforms/SCCP/multiple_callbacks.ll
+++ b/llvm/test/Transforms/SCCP/multiple_callbacks.ll
@@ -88,23 +88,23 @@ define void @foo() {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[CALL:%.*]] = call i32 @cb0(i32 0)
 ; CHECK-NEXT:    [[CALL1:%.*]] = call i32 @cb3(i32 1)
-; CHECK-NEXT:    call void @broker(i32 (i32)* nonnull @cb0, i32 (i32)* nonnull @cb1, i32 (i32)* nonnull @cb0, i32 0, i32 1)
-; CHECK-NEXT:    call void @broker(i32 (i32)* nonnull @cb1, i32 (i32)* nonnull @cb2, i32 (i32)* nonnull @cb2, i32 0, i32 1)
-; CHECK-NEXT:    call void @broker(i32 (i32)* nonnull @cb3, i32 (i32)* nonnull @cb2, i32 (i32)* nonnull @cb3, i32 0, i32 1)
-; CHECK-NEXT:    call void @broker(i32 (i32)* nonnull @cb4, i32 (i32)* nonnull @cb4, i32 (i32)* nonnull @cb4, i32 0, i32 1)
+; CHECK-NEXT:    call void @broker(ptr nonnull @cb0, ptr nonnull @cb1, ptr nonnull @cb0, i32 0, i32 1)
+; CHECK-NEXT:    call void @broker(ptr nonnull @cb1, ptr nonnull @cb2, ptr nonnull @cb2, i32 0, i32 1)
+; CHECK-NEXT:    call void @broker(ptr nonnull @cb3, ptr nonnull @cb2, ptr nonnull @cb3, i32 0, i32 1)
+; CHECK-NEXT:    call void @broker(ptr nonnull @cb4, ptr nonnull @cb4, ptr nonnull @cb4, i32 0, i32 1)
 ; CHECK-NEXT:    ret void
 ;
 entry:
   %call = call i32 @cb0(i32 0)
   %call1 = call i32 @cb3(i32 1)
-  call void @broker(i32 (i32)* nonnull @cb0, i32 (i32)* nonnull @cb1, i32 (i32)* nonnull @cb0, i32 0, i32 1)
-  call void @broker(i32 (i32)* nonnull @cb1, i32 (i32)* nonnull @cb2, i32 (i32)* nonnull @cb2, i32 0, i32 1)
-  call void @broker(i32 (i32)* nonnull @cb3, i32 (i32)* nonnull @cb2, i32 (i32)* nonnull @cb3, i32 0, i32 1)
-  call void @broker(i32 (i32)* nonnull @cb4, i32 (i32)* nonnull @cb4, i32 (i32)* nonnull @cb4, i32 0, i32 1)
+  call void @broker(ptr nonnull @cb0, ptr nonnull @cb1, ptr nonnull @cb0, i32 0, i32 1)
+  call void @broker(ptr nonnull @cb1, ptr nonnull @cb2, ptr nonnull @cb2, i32 0, i32 1)
+  call void @broker(ptr nonnull @cb3, ptr nonnull @cb2, ptr nonnull @cb3, i32 0, i32 1)
+  call void @broker(ptr nonnull @cb4, ptr nonnull @cb4, ptr nonnull @cb4, i32 0, i32 1)
   ret void
 }
 
-declare !callback !3 void @broker(i32 (i32)*, i32 (i32)*, i32 (i32)*, i32, i32)
+declare !callback !3 void @broker(ptr, ptr, ptr, i32, i32)
 
 !0 = !{i64 0, i64 3, i1 false}
 !1 = !{i64 1, i64 4, i1 false}

diff  --git a/llvm/test/Transforms/SCCP/musttail-call.ll b/llvm/test/Transforms/SCCP/musttail-call.ll
index ec346c0d7302..964683e5886f 100644
--- a/llvm/test/Transforms/SCCP/musttail-call.ll
+++ b/llvm/test/Transforms/SCCP/musttail-call.ll
@@ -6,45 +6,45 @@
 
 declare i32 @external()
 
-define i8* @start(i8 %v) {
+define ptr @start(i8 %v) {
 ; CHECK-LABEL: define {{[^@]+}}@start
 ; CHECK-SAME: (i8 [[V:%.*]]) {
 ; CHECK-NEXT:    [[C1:%.*]] = icmp eq i8 [[V]], 0
 ; CHECK-NEXT:    br i1 [[C1]], label [[TRUE:%.*]], label [[FALSE:%.*]]
 ; CHECK:       true:
-; CHECK-NEXT:    [[CA:%.*]] = musttail call i8* @side_effects(i8 0)
-; CHECK-NEXT:    ret i8* [[CA]]
+; CHECK-NEXT:    [[CA:%.*]] = musttail call ptr @side_effects(i8 0)
+; CHECK-NEXT:    ret ptr [[CA]]
 ; CHECK:       false:
 ; CHECK-NEXT:    [[C2:%.*]] = icmp eq i8 [[V]], 1
 ; CHECK-NEXT:    br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]]
 ; CHECK:       c2_true:
-; CHECK-NEXT:    ret i8* null
+; CHECK-NEXT:    ret ptr null
 ; CHECK:       c2_false:
-; CHECK-NEXT:    [[CA2:%.*]] = musttail call i8* @dont_zap_me(i8 [[V]])
-; CHECK-NEXT:    ret i8* [[CA2]]
+; CHECK-NEXT:    [[CA2:%.*]] = musttail call ptr @dont_zap_me(i8 [[V]])
+; CHECK-NEXT:    ret ptr [[CA2]]
 ;
   %c1 = icmp eq i8 %v, 0
   br i1 %c1, label %true, label %false
 true:
-  %ca = musttail call i8* @side_effects(i8 %v)
-  ret i8* %ca
+  %ca = musttail call ptr @side_effects(i8 %v)
+  ret ptr %ca
 false:
   %c2 = icmp eq i8 %v, 1
   br i1 %c2, label %c2_true, label %c2_false
 c2_true:
-  %ca1 = musttail call i8* @no_side_effects(i8 %v)
-  ret i8* %ca1
+  %ca1 = musttail call ptr @no_side_effects(i8 %v)
+  ret ptr %ca1
 c2_false:
-  %ca2 = musttail call i8* @dont_zap_me(i8 %v)
-  ret i8* %ca2
+  %ca2 = musttail call ptr @dont_zap_me(i8 %v)
+  ret ptr %ca2
 }
 
-define internal i8* @side_effects(i8 %v) {
+define internal ptr @side_effects(i8 %v) {
 ; CHECK-LABEL: define {{[^@]+}}@side_effects
 ; CHECK-SAME: (i8 [[V:%.*]]) {
 ; CHECK-NEXT:    [[I1:%.*]] = call i32 @external()
-; CHECK-NEXT:    [[CA:%.*]] = musttail call i8* @start(i8 0)
-; CHECK-NEXT:    ret i8* [[CA]]
+; CHECK-NEXT:    [[CA:%.*]] = musttail call ptr @start(i8 0)
+; CHECK-NEXT:    ret ptr [[CA]]
 ;
   %i1 = call i32 @external()
 
@@ -52,29 +52,29 @@ define internal i8* @side_effects(i8 %v) {
   ; is always `null`.
   ; The call can't be removed due to `external` call above, though.
 
-  %ca = musttail call i8* @start(i8 %v)
+  %ca = musttail call ptr @start(i8 %v)
 
   ; Thus the result must be returned anyway
-  ret i8* %ca
+  ret ptr %ca
 }
 
 ; The call to this function is removed, so the return value must be zapped
-define internal i8* @no_side_effects(i8 %v) readonly nounwind willreturn {
+define internal ptr @no_side_effects(i8 %v) readonly nounwind willreturn {
 ; CHECK-LABEL: define {{[^@]+}}@no_side_effects
 ; CHECK-SAME: (i8 [[V:%.*]]) #[[ATTR0:[0-9]+]] {
-; CHECK-NEXT:    ret i8* undef
+; CHECK-NEXT:    ret ptr undef
 ;
-  ret i8* null
+  ret ptr null
 }
 
 ; The call to this function cannot be removed due to side effects. Thus the
 ; return value should stay as it is, and should not be zapped.
-define internal i8* @dont_zap_me(i8 %v) {
+define internal ptr @dont_zap_me(i8 %v) {
 ; CHECK-LABEL: define {{[^@]+}}@dont_zap_me
 ; CHECK-SAME: (i8 [[V:%.*]]) {
 ; CHECK-NEXT:    [[I1:%.*]] = call i32 @external()
-; CHECK-NEXT:    ret i8* null
+; CHECK-NEXT:    ret ptr null
 ;
   %i1 = call i32 @external()
-  ret i8* null
+  ret ptr null
 }

diff  --git a/llvm/test/Transforms/SCCP/openmp_parallel_for.ll b/llvm/test/Transforms/SCCP/openmp_parallel_for.ll
index 7bc48e63290e..aa2e0cfd5a21 100644
--- a/llvm/test/Transforms/SCCP/openmp_parallel_for.ll
+++ b/llvm/test/Transforms/SCCP/openmp_parallel_for.ll
@@ -18,34 +18,34 @@
 ;
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 
-%struct.ident_t = type { i32, i32, i32, i32, i8* }
+%struct.ident_t = type { i32, i32, i32, i32, ptr }
 
 @.str = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1
- at 0 = private unnamed_addr global %struct.ident_t { i32 0, i32 514, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0) }, align 8
- at 1 = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0) }, align 8
+ at 0 = private unnamed_addr global %struct.ident_t { i32 0, i32 514, i32 0, i32 0, ptr @.str }, align 8
+ at 1 = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, ptr @.str }, align 8
 
 define dso_local void @foo(i32 %N) {
 ; CHECK-LABEL: @foo(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[N_ADDR:%.*]] = alloca i32, align 4
 ; CHECK-NEXT:    [[P:%.*]] = alloca float, align 4
-; CHECK-NEXT:    store i32 [[N:%.*]], i32* [[N_ADDR]], align 4
-; CHECK-NEXT:    store float 3.000000e+00, float* [[P]], align 4
-; CHECK-NEXT:    store i32 7, i32* [[N_ADDR]], align 4
-; CHECK-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* nonnull @1, i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, float*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* nonnull [[N_ADDR]], float* nonnull [[P]], i64 4617315517961601024)
+; CHECK-NEXT:    store i32 [[N:%.*]], ptr [[N_ADDR]], align 4
+; CHECK-NEXT:    store float 3.000000e+00, ptr [[P]], align 4
+; CHECK-NEXT:    store i32 7, ptr [[N_ADDR]], align 4
+; CHECK-NEXT:    call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 3, ptr @.omp_outlined., ptr nonnull [[N_ADDR]], ptr nonnull [[P]], i64 4617315517961601024)
 ; CHECK-NEXT:    ret void
 ;
 entry:
   %N.addr = alloca i32, align 4
   %p = alloca float, align 4
-  store i32 %N, i32* %N.addr, align 4
-  store float 3.000000e+00, float* %p, align 4
-  store i32 7, i32* %N.addr, align 4
-  call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* nonnull @1, i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, float*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* nonnull %N.addr, float* nonnull %p, i64 4617315517961601024)
+  store i32 %N, ptr %N.addr, align 4
+  store float 3.000000e+00, ptr %p, align 4
+  store i32 7, ptr %N.addr, align 4
+  call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 3, ptr @.omp_outlined., ptr nonnull %N.addr, ptr nonnull %p, i64 4617315517961601024)
   ret void
 }
 
-define internal void @.omp_outlined.(i32* noalias %.global_tid., i32* noalias %.bound_tid., i32* dereferenceable(4) %N, float* dereferenceable(4) %p, i64 %q) {
+define internal void @.omp_outlined.(ptr noalias %.global_tid., ptr noalias %.bound_tid., ptr dereferenceable(4) %N, ptr dereferenceable(4) %p, i64 %q) {
 ; CHECK-LABEL: @.omp_outlined.(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[Q_ADDR:%.*]] = alloca i64, align 8
@@ -53,43 +53,42 @@ define internal void @.omp_outlined.(i32* noalias %.global_tid., i32* noalias %.
 ; CHECK-NEXT:    [[DOTOMP_UB:%.*]] = alloca i32, align 4
 ; CHECK-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
 ; CHECK-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
-; CHECK-NEXT:    store i64 [[Q:%.*]], i64* [[Q_ADDR]], align 8
-; CHECK-NEXT:    [[CONV:%.*]] = bitcast i64* [[Q_ADDR]] to double*
-; CHECK-NEXT:    [[TMP:%.*]] = load i32, i32* [[N:%.*]], align 4
+; CHECK-NEXT:    store i64 [[Q:%.*]], ptr [[Q_ADDR]], align 8
+; CHECK-NEXT:    [[TMP:%.*]] = load i32, ptr [[N:%.*]], align 4
 ; CHECK-NEXT:    [[SUB3:%.*]] = add nsw i32 [[TMP]], -3
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt i32 [[TMP]], 2
 ; CHECK-NEXT:    br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
 ; CHECK:       omp.precond.then:
-; CHECK-NEXT:    store i32 0, i32* [[DOTOMP_LB]], align 4
-; CHECK-NEXT:    store i32 [[SUB3]], i32* [[DOTOMP_UB]], align 4
-; CHECK-NEXT:    store i32 1, i32* [[DOTOMP_STRIDE]], align 4
-; CHECK-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
-; CHECK-NEXT:    [[TMP5:%.*]] = load i32, i32* [[DOTGLOBAL_TID_:%.*]], align 4
-; CHECK-NEXT:    call void @__kmpc_for_static_init_4(%struct.ident_t* nonnull @0, i32 [[TMP5]], i32 34, i32* nonnull [[DOTOMP_IS_LAST]], i32* nonnull [[DOTOMP_LB]], i32* nonnull [[DOTOMP_UB]], i32* nonnull [[DOTOMP_STRIDE]], i32 1, i32 1)
-; CHECK-NEXT:    [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
+; CHECK-NEXT:    store i32 0, ptr [[DOTOMP_LB]], align 4
+; CHECK-NEXT:    store i32 [[SUB3]], ptr [[DOTOMP_UB]], align 4
+; CHECK-NEXT:    store i32 1, ptr [[DOTOMP_STRIDE]], align 4
+; CHECK-NEXT:    store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
+; CHECK-NEXT:    [[TMP5:%.*]] = load i32, ptr [[DOTGLOBAL_TID_:%.*]], align 4
+; CHECK-NEXT:    call void @__kmpc_for_static_init_4(ptr nonnull @0, i32 [[TMP5]], i32 34, ptr nonnull [[DOTOMP_IS_LAST]], ptr nonnull [[DOTOMP_LB]], ptr nonnull [[DOTOMP_UB]], ptr nonnull [[DOTOMP_STRIDE]], i32 1, i32 1)
+; CHECK-NEXT:    [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
 ; CHECK-NEXT:    [[CMP6:%.*]] = icmp sgt i32 [[TMP6]], [[SUB3]]
 ; CHECK-NEXT:    br i1 [[CMP6]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
 ; CHECK:       cond.true:
 ; CHECK-NEXT:    br label [[COND_END:%.*]]
 ; CHECK:       cond.false:
-; CHECK-NEXT:    [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
+; CHECK-NEXT:    [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
 ; CHECK-NEXT:    br label [[COND_END]]
 ; CHECK:       cond.end:
 ; CHECK-NEXT:    [[COND:%.*]] = phi i32 [ [[SUB3]], [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
-; CHECK-NEXT:    store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
-; CHECK-NEXT:    [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
+; CHECK-NEXT:    store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
+; CHECK-NEXT:    [[TMP8:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
 ; CHECK-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
 ; CHECK:       omp.inner.for.cond:
 ; CHECK-NEXT:    [[DOTOMP_IV_0:%.*]] = phi i32 [ [[TMP8]], [[COND_END]] ], [ [[ADD11:%.*]], [[OMP_INNER_FOR_INC:%.*]] ]
-; CHECK-NEXT:    [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
+; CHECK-NEXT:    [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
 ; CHECK-NEXT:    [[CMP8:%.*]] = icmp sgt i32 [[DOTOMP_IV_0]], [[TMP9]]
 ; CHECK-NEXT:    br i1 [[CMP8]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]], label [[OMP_INNER_FOR_BODY:%.*]]
 ; CHECK:       omp.inner.for.cond.cleanup:
 ; CHECK-NEXT:    br label [[OMP_INNER_FOR_END:%.*]]
 ; CHECK:       omp.inner.for.body:
 ; CHECK-NEXT:    [[ADD10:%.*]] = add nsw i32 [[DOTOMP_IV_0]], 2
-; CHECK-NEXT:    [[TMP10:%.*]] = load float, float* [[P:%.*]], align 4
-; CHECK-NEXT:    [[TMP11:%.*]] = load double, double* [[CONV]], align 8
+; CHECK-NEXT:    [[TMP10:%.*]] = load float, ptr [[P:%.*]], align 4
+; CHECK-NEXT:    [[TMP11:%.*]] = load double, ptr [[Q_ADDR]], align 8
 ; CHECK-NEXT:    call void @bar(i32 [[ADD10]], float [[TMP10]], double [[TMP11]])
 ; CHECK-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
 ; CHECK:       omp.body.continue:
@@ -100,8 +99,8 @@ define internal void @.omp_outlined.(i32* noalias %.global_tid., i32* noalias %.
 ; CHECK:       omp.inner.for.end:
 ; CHECK-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
 ; CHECK:       omp.loop.exit:
-; CHECK-NEXT:    [[TMP12:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4
-; CHECK-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* nonnull @0, i32 [[TMP12]])
+; CHECK-NEXT:    [[TMP12:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
+; CHECK-NEXT:    call void @__kmpc_for_static_fini(ptr nonnull @0, i32 [[TMP12]])
 ; CHECK-NEXT:    br label [[OMP_PRECOND_END]]
 ; CHECK:       omp.precond.end:
 ; CHECK-NEXT:    ret void
@@ -112,21 +111,20 @@ entry:
   %.omp.ub = alloca i32, align 4
   %.omp.stride = alloca i32, align 4
   %.omp.is_last = alloca i32, align 4
-  store i64 %q, i64* %q.addr, align 8
-  %conv = bitcast i64* %q.addr to double*
-  %tmp = load i32, i32* %N, align 4
+  store i64 %q, ptr %q.addr, align 8
+  %tmp = load i32, ptr %N, align 4
   %sub3 = add nsw i32 %tmp, -3
   %cmp = icmp sgt i32 %tmp, 2
   br i1 %cmp, label %omp.precond.then, label %omp.precond.end
 
 omp.precond.then:                                 ; preds = %entry
-  store i32 0, i32* %.omp.lb, align 4
-  store i32 %sub3, i32* %.omp.ub, align 4
-  store i32 1, i32* %.omp.stride, align 4
-  store i32 0, i32* %.omp.is_last, align 4
-  %tmp5 = load i32, i32* %.global_tid., align 4
-  call void @__kmpc_for_static_init_4(%struct.ident_t* nonnull @0, i32 %tmp5, i32 34, i32* nonnull %.omp.is_last, i32* nonnull %.omp.lb, i32* nonnull %.omp.ub, i32* nonnull %.omp.stride, i32 1, i32 1)
-  %tmp6 = load i32, i32* %.omp.ub, align 4
+  store i32 0, ptr %.omp.lb, align 4
+  store i32 %sub3, ptr %.omp.ub, align 4
+  store i32 1, ptr %.omp.stride, align 4
+  store i32 0, ptr %.omp.is_last, align 4
+  %tmp5 = load i32, ptr %.global_tid., align 4
+  call void @__kmpc_for_static_init_4(ptr nonnull @0, i32 %tmp5, i32 34, ptr nonnull %.omp.is_last, ptr nonnull %.omp.lb, ptr nonnull %.omp.ub, ptr nonnull %.omp.stride, i32 1, i32 1)
+  %tmp6 = load i32, ptr %.omp.ub, align 4
   %cmp6 = icmp sgt i32 %tmp6, %sub3
   br i1 %cmp6, label %cond.true, label %cond.false
 
@@ -134,18 +132,18 @@ cond.true:                                        ; preds = %omp.precond.then
   br label %cond.end
 
 cond.false:                                       ; preds = %omp.precond.then
-  %tmp7 = load i32, i32* %.omp.ub, align 4
+  %tmp7 = load i32, ptr %.omp.ub, align 4
   br label %cond.end
 
 cond.end:                                         ; preds = %cond.false, %cond.true
   %cond = phi i32 [ %sub3, %cond.true ], [ %tmp7, %cond.false ]
-  store i32 %cond, i32* %.omp.ub, align 4
-  %tmp8 = load i32, i32* %.omp.lb, align 4
+  store i32 %cond, ptr %.omp.ub, align 4
+  %tmp8 = load i32, ptr %.omp.lb, align 4
   br label %omp.inner.for.cond
 
 omp.inner.for.cond:                               ; preds = %omp.inner.for.inc, %cond.end
   %.omp.iv.0 = phi i32 [ %tmp8, %cond.end ], [ %add11, %omp.inner.for.inc ]
-  %tmp9 = load i32, i32* %.omp.ub, align 4
+  %tmp9 = load i32, ptr %.omp.ub, align 4
   %cmp8 = icmp sgt i32 %.omp.iv.0, %tmp9
   br i1 %cmp8, label %omp.inner.for.cond.cleanup, label %omp.inner.for.body
 
@@ -154,8 +152,8 @@ omp.inner.for.cond.cleanup:                       ; preds = %omp.inner.for.cond
 
 omp.inner.for.body:                               ; preds = %omp.inner.for.cond
   %add10 = add nsw i32 %.omp.iv.0, 2
-  %tmp10 = load float, float* %p, align 4
-  %tmp11 = load double, double* %conv, align 8
+  %tmp10 = load float, ptr %p, align 4
+  %tmp11 = load double, ptr %q.addr, align 8
   call void @bar(i32 %add10, float %tmp10, double %tmp11)
   br label %omp.body.continue
 
@@ -170,21 +168,21 @@ omp.inner.for.end:                                ; preds = %omp.inner.for.cond.
   br label %omp.loop.exit
 
 omp.loop.exit:                                    ; preds = %omp.inner.for.end
-  %tmp12 = load i32, i32* %.global_tid., align 4
-  call void @__kmpc_for_static_fini(%struct.ident_t* nonnull @0, i32 %tmp12)
+  %tmp12 = load i32, ptr %.global_tid., align 4
+  call void @__kmpc_for_static_fini(ptr nonnull @0, i32 %tmp12)
   br label %omp.precond.end
 
 omp.precond.end:                                  ; preds = %omp.loop.exit, %entry
   ret void
 }
 
-declare dso_local void @__kmpc_for_static_init_4(%struct.ident_t*, i32, i32, i32*, i32*, i32*, i32*, i32, i32)
+declare dso_local void @__kmpc_for_static_init_4(ptr, i32, i32, ptr, ptr, ptr, ptr, i32, i32)
 
 declare dso_local void @bar(i32, float, double)
 
-declare dso_local void @__kmpc_for_static_fini(%struct.ident_t*, i32)
+declare dso_local void @__kmpc_for_static_fini(ptr, i32)
 
-declare !callback !0 dso_local void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...)
+declare !callback !0 dso_local void @__kmpc_fork_call(ptr, i32, ptr, ...)
 
 !1 = !{i64 2, i64 -1, i64 -1, i1 true}
 !0 = !{!1}

diff  --git a/llvm/test/Transforms/SCCP/pr35357.ll b/llvm/test/Transforms/SCCP/pr35357.ll
index bca4cb150bf0..8d5b1be685ee 100644
--- a/llvm/test/Transforms/SCCP/pr35357.ll
+++ b/llvm/test/Transforms/SCCP/pr35357.ll
@@ -9,7 +9,7 @@ define i32 @patatino() {
 ; CHECK-NEXT: ret i32 0
 entry:
   call void @f(i32 undef, i32 1)
-  %0 = load i32, i32* @a
+  %0 = load i32, ptr @a
   call void @f(i32 %0, i32 0)
   ret i32 0
 }

diff  --git a/llvm/test/Transforms/SCCP/pr45185-range-predinfo.ll b/llvm/test/Transforms/SCCP/pr45185-range-predinfo.ll
index 24382c7d062a..aeaaf995efb9 100644
--- a/llvm/test/Transforms/SCCP/pr45185-range-predinfo.ll
+++ b/llvm/test/Transforms/SCCP/pr45185-range-predinfo.ll
@@ -3,29 +3,27 @@
 
 ;Test for PR45185.
 
-define void @spam([4 x [24 x float]]* %arg) {
+define void @spam(ptr %arg) {
 ; CHECK-LABEL: @spam(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = getelementptr inbounds [4 x [24 x float]], [4 x [24 x float]]* [[ARG:%.*]], i64 0, i64 0, i64 0
-; CHECK-NEXT:    call void @blam(i32 0, float* nonnull [[TMP]])
-; CHECK-NEXT:    [[TMP1:%.*]] = getelementptr inbounds [4 x [24 x float]], [4 x [24 x float]]* [[ARG]], i64 0, i64 1, i64 0
-; CHECK-NEXT:    call void @blam(i32 1, float* nonnull [[TMP1]])
-; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr inbounds [4 x [24 x float]], [4 x [24 x float]]* [[ARG]], i64 0, i64 2, i64 0
-; CHECK-NEXT:    call void @blam(i32 2, float* nonnull [[TMP2]])
+; CHECK-NEXT:    call void @blam(i32 0, ptr nonnull [[ARG:%.*]])
+; CHECK-NEXT:    [[TMP1:%.*]] = getelementptr inbounds [4 x [24 x float]], ptr [[ARG]], i64 0, i64 1, i64 0
+; CHECK-NEXT:    call void @blam(i32 1, ptr nonnull [[TMP1]])
+; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr inbounds [4 x [24 x float]], ptr [[ARG]], i64 0, i64 2, i64 0
+; CHECK-NEXT:    call void @blam(i32 2, ptr nonnull [[TMP2]])
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  %tmp = getelementptr inbounds [4 x [24 x float]], [4 x [24 x float]]* %arg, i64 0, i64 0, i64 0
-  call void @blam(i32 0, float* nonnull %tmp)
-  %tmp1 = getelementptr inbounds [4 x [24 x float]], [4 x [24 x float]]* %arg, i64 0, i64 1, i64 0
-  call void @blam(i32 1, float* nonnull %tmp1)
-  %tmp2 = getelementptr inbounds [4 x [24 x float]], [4 x [24 x float]]* %arg, i64 0, i64 2, i64 0
-  call void @blam(i32 2, float* nonnull %tmp2)
+  call void @blam(i32 0, ptr nonnull %arg)
+  %tmp1 = getelementptr inbounds [4 x [24 x float]], ptr %arg, i64 0, i64 1, i64 0
+  call void @blam(i32 1, ptr nonnull %tmp1)
+  %tmp2 = getelementptr inbounds [4 x [24 x float]], ptr %arg, i64 0, i64 2, i64 0
+  call void @blam(i32 2, ptr nonnull %tmp2)
   ret void
 }
 
 ; Make sure we do not incorrectly eliminate the checks in @blam.
-define internal void @blam(i32 %arg, float* nocapture %arg1) {
+define internal void @blam(i32 %arg, ptr nocapture %arg1) {
 ; CHECK-LABEL: define {{.*}} @blam(
 ; CHECK-NEXT:  bb:
 ; CHECK-NEXT:    [[TMP:%.*]] = icmp eq i32 [[ARG:%.*]], 0

diff  --git a/llvm/test/Transforms/SCCP/pr49582-iterator-invalidation.ll b/llvm/test/Transforms/SCCP/pr49582-iterator-invalidation.ll
index b6dfc155ae12..ed5703da35e6 100644
--- a/llvm/test/Transforms/SCCP/pr49582-iterator-invalidation.ll
+++ b/llvm/test/Transforms/SCCP/pr49582-iterator-invalidation.ll
@@ -2,7 +2,7 @@
 ; PR49582: This test checks for an iterator invalidation issue, which only gets
 ; exposed on a large-enough test case. We intentionally do not check the output.
 
- at c = external dso_local global i32*, align 8
+ at c = external dso_local global ptr, align 8
 @d = external dso_local global i32, align 4
 
 define void @f(i32 %i) {
@@ -13,12 +13,12 @@ for.cond:                                         ; preds = %if.end628, %entry
   %e.0 = phi i32 [ 1, %entry ], [ %e.15, %if.end628 ]
   %cmp = icmp slt i32 %e.0, %i
   call void @llvm.assume(i1 %cmp)
-  %0 = load i32*, i32** @c, align 8
-  %tobool = icmp ne i32* %0, null
+  %0 = load ptr, ptr @c, align 8
+  %tobool = icmp ne ptr %0, null
   br i1 %tobool, label %if.then, label %if.end628
 
 if.then:                                          ; preds = %for.cond
-  %1 = load i32, i32* %0, align 4
+  %1 = load i32, ptr %0, align 4
   %tobool1 = icmp ne i32 %1, 0
   br i1 %tobool1, label %if.then2, label %if.else78
 
@@ -105,8 +105,8 @@ if.then49:                                        ; preds = %if.end47
 
 if.end51:                                         ; preds = %if.then49, %if.end47
   %e.5 = phi i32 [ %inc50, %if.then49 ], [ %e.4, %if.end47 ]
-  %2 = load i32*, i32** @c, align 8
-  %tobool52 = icmp ne i32* %2, null
+  %2 = load ptr, ptr @c, align 8
+  %tobool52 = icmp ne ptr %2, null
   br i1 %tobool52, label %if.then53, label %if.else
 
 if.then53:                                        ; preds = %if.end51
@@ -117,7 +117,7 @@ if.then55:                                        ; preds = %if.then53
   unreachable
 
 if.else:                                          ; preds = %if.end51
-  %3 = load i32, i32* @d, align 4
+  %3 = load i32, ptr @d, align 4
   %tobool57 = icmp ne i32 %3, 0
   br i1 %tobool57, label %if.then58, label %if.else68
 
@@ -273,8 +273,8 @@ if.then162:                                       ; preds = %if.end160
   unreachable
 
 if.else164:                                       ; preds = %if.then126
-  %4 = load i32*, i32** @c, align 8
-  %tobool165 = icmp ne i32* %4, null
+  %4 = load ptr, ptr @c, align 8
+  %tobool165 = icmp ne ptr %4, null
   br i1 %tobool165, label %if.then166, label %if.else195
 
 if.then166:                                       ; preds = %if.else164
@@ -307,7 +307,7 @@ if.then190:                                       ; preds = %if.end187
   br label %if.end628
 
 if.else195:                                       ; preds = %if.else164
-  %5 = load i32, i32* @d, align 4
+  %5 = load i32, ptr @d, align 4
   %tobool196 = icmp ne i32 %5, 0
   br i1 %tobool196, label %if.then197, label %if.else205
 
@@ -339,8 +339,8 @@ if.end215:                                        ; preds = %if.then208
   br label %if.end628
 
 if.else217:                                       ; preds = %if.else205
-  %7 = load i32*, i32** @c, align 8
-  %tobool218 = icmp ne i32* %7, null
+  %7 = load ptr, ptr @c, align 8
+  %tobool218 = icmp ne ptr %7, null
   br i1 %tobool218, label %if.then219, label %if.else227
 
 if.then219:                                       ; preds = %if.else217
@@ -374,8 +374,8 @@ if.then240:                                       ; preds = %if.end237
   br label %if.end628
 
 if.else245:                                       ; preds = %if.else227
-  %8 = load i32*, i32** @c, align 8
-  %tobool246 = icmp ne i32* %8, null
+  %8 = load ptr, ptr @c, align 8
+  %tobool246 = icmp ne ptr %8, null
   br i1 %tobool246, label %if.then247, label %if.else258
 
 if.then247:                                       ; preds = %if.else245
@@ -392,7 +392,7 @@ if.end254:                                        ; preds = %if.then247
   br label %if.end628
 
 if.else258:                                       ; preds = %if.else245
-  %10 = load i32, i32* @d, align 4
+  %10 = load i32, ptr @d, align 4
   %tobool259 = icmp ne i32 %10, 0
   br i1 %tobool259, label %if.then260, label %if.else268
 
@@ -420,8 +420,8 @@ if.then274:                                       ; preds = %if.then271
   br label %if.end628
 
 if.else279:                                       ; preds = %if.else268
-  %11 = load i32*, i32** @c, align 8
-  %tobool280 = icmp ne i32* %11, null
+  %11 = load ptr, ptr @c, align 8
+  %tobool280 = icmp ne ptr %11, null
   br i1 %tobool280, label %if.then281, label %if.else287
 
 if.then281:                                       ; preds = %if.else279
@@ -438,8 +438,8 @@ if.else287:                                       ; preds = %if.else279
   br i1 %tobool289, label %if.then290, label %if.else307
 
 if.then290:                                       ; preds = %if.else287
-  %12 = load i32*, i32** @c, align 8
-  %tobool291 = icmp ne i32* %12, null
+  %12 = load ptr, ptr @c, align 8
+  %tobool291 = icmp ne ptr %12, null
   br i1 %tobool291, label %if.then292, label %if.else298
 
 if.then292:                                       ; preds = %if.then290
@@ -460,8 +460,8 @@ if.then301:                                       ; preds = %if.else298
   br label %if.end628
 
 if.else307:                                       ; preds = %if.else287
-  %13 = load i32*, i32** @c, align 8
-  %tobool308 = icmp ne i32* %13, null
+  %13 = load ptr, ptr @c, align 8
+  %tobool308 = icmp ne ptr %13, null
   br i1 %tobool308, label %if.then309, label %if.else324
 
 if.then309:                                       ; preds = %if.else307

diff  --git a/llvm/test/Transforms/SCCP/pthreads.ll b/llvm/test/Transforms/SCCP/pthreads.ll
index fa4d7311f3b4..20d9f12ff6c3 100644
--- a/llvm/test/Transforms/SCCP/pthreads.ll
+++ b/llvm/test/Transforms/SCCP/pthreads.ll
@@ -3,10 +3,10 @@
 ;
 ;    #include <pthread.h>
 ;
-;    void *GlobalVPtr;
+;    ptr GlobalVPtr;
 ;
-;    static void *foo(void *arg) { return arg; }
-;    static void *bar(void *arg) { return arg; }
+;    static ptr foo(ptr arg) { return arg; }
+;    static ptr bar(ptr arg) { return arg; }
 ;
 ;    int main() {
 ;      pthread_t thread;
@@ -22,41 +22,41 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 
 %union.pthread_attr_t = type { i64, [48 x i8] }
 
- at GlobalVPtr = common dso_local global i8* null, align 8
+ at GlobalVPtr = common dso_local global ptr null, align 8
 
 define dso_local i32 @main() {
 ; CHECK-LABEL: @main(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[THREAD:%.*]] = alloca i64, align 8
-; CHECK-NEXT:    [[CALL:%.*]] = call i32 @pthread_create(i64* nonnull [[THREAD]], %union.pthread_attr_t* null, i8* (i8*)* nonnull @foo, i8* null)
-; CHECK-NEXT:    [[CALL1:%.*]] = call i32 @pthread_create(i64* nonnull [[THREAD]], %union.pthread_attr_t* null, i8* (i8*)* nonnull @bar, i8* bitcast (i8** @GlobalVPtr to i8*))
+; CHECK-NEXT:    [[CALL:%.*]] = call i32 @pthread_create(ptr nonnull [[THREAD]], ptr null, ptr nonnull @foo, ptr null)
+; CHECK-NEXT:    [[CALL1:%.*]] = call i32 @pthread_create(ptr nonnull [[THREAD]], ptr null, ptr nonnull @bar, ptr @GlobalVPtr)
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
   %thread = alloca i64, align 8
-  %call = call i32 @pthread_create(i64* nonnull %thread, %union.pthread_attr_t* null, i8* (i8*)* nonnull @foo, i8* null)
-  %call1 = call i32 @pthread_create(i64* nonnull %thread, %union.pthread_attr_t* null, i8* (i8*)* nonnull @bar, i8* bitcast (i8** @GlobalVPtr to i8*))
+  %call = call i32 @pthread_create(ptr nonnull %thread, ptr null, ptr nonnull @foo, ptr null)
+  %call1 = call i32 @pthread_create(ptr nonnull %thread, ptr null, ptr nonnull @bar, ptr @GlobalVPtr)
   ret i32 0
 }
 
-declare !callback !0 dso_local i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)
+declare !callback !0 dso_local i32 @pthread_create(ptr, ptr, ptr, ptr)
 
-define internal i8* @foo(i8* %arg) {
+define internal ptr @foo(ptr %arg) {
 ; CHECK-LABEL: @foo(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    ret i8* [[ARG:%.*]]
+; CHECK-NEXT:    ret ptr [[ARG:%.*]]
 ;
 entry:
-  ret i8* %arg
+  ret ptr %arg
 }
 
-define internal i8* @bar(i8* %arg) {
+define internal ptr @bar(ptr %arg) {
 ; CHECK-LABEL: @bar(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    ret i8* [[ARG:%.*]]
+; CHECK-NEXT:    ret ptr [[ARG:%.*]]
 ;
 entry:
-  ret i8* %arg
+  ret ptr %arg
 }
 
 !1 = !{i64 2, i64 3, i1 false}

diff  --git a/llvm/test/Transforms/SCCP/replace-dereferenceable-ptr-with-undereferenceable.ll b/llvm/test/Transforms/SCCP/replace-dereferenceable-ptr-with-undereferenceable.ll
index b887e7850365..39af513a4506 100644
--- a/llvm/test/Transforms/SCCP/replace-dereferenceable-ptr-with-undereferenceable.ll
+++ b/llvm/test/Transforms/SCCP/replace-dereferenceable-ptr-with-undereferenceable.ll
@@ -4,82 +4,82 @@
 @y = common global [1 x i32] zeroinitializer, align 4
 @x = common global [1 x i32] zeroinitializer, align 4
 
-define i32 @eq_undereferenceable(i32* %p) {
+define i32 @eq_undereferenceable(ptr %p) {
 ; CHECK-LABEL: @eq_undereferenceable(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    store i32 1, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @y, i64 0, i64 0), align 4
-; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i32* [[P:%.*]], getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 1, i64 0)
+; CHECK-NEXT:    store i32 1, ptr @y, align 4
+; CHECK-NEXT:    [[CMP:%.*]] = icmp eq ptr [[P:%.*]], getelementptr inbounds (i32, ptr @x, i64 1)
 ; CHECK-NEXT:    br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
 ; CHECK:       if.then:
-; CHECK-NEXT:    store i32 2, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 1, i64 0), align 4
+; CHECK-NEXT:    store i32 2, ptr getelementptr inbounds (i32, ptr @x, i64 1), align 4
 ; CHECK-NEXT:    br label [[IF_END]]
 ; CHECK:       if.end:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @y, i64 0, i64 0), align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @y, align 4
 ; CHECK-NEXT:    ret i32 [[TMP0]]
 ;
 entry:
-  store i32 1, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @y, i64 0, i64 0), align 4
-  %cmp = icmp eq i32* %p, getelementptr inbounds (i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 0, i64 0), i64 1)
+  store i32 1, ptr @y, align 4
+  %cmp = icmp eq ptr %p, getelementptr inbounds (i32, ptr @x, i64 1)
   br i1 %cmp, label %if.then, label %if.end
 
 if.then:                                          ; preds = %entry
-  store i32 2, i32* %p, align 4
+  store i32 2, ptr %p, align 4
   br label %if.end
 
 if.end:                                           ; preds = %if.then, %entry
-  %0 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @y, i64 0, i64 0), align 4
+  %0 = load i32, ptr @y, align 4
   ret i32 %0
 }
 
 
-define i32 @eq_dereferenceable(i32* %p) {
+define i32 @eq_dereferenceable(ptr %p) {
 ; CHECK-LABEL: @eq_dereferenceable(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    store i32 1, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @y, i64 0, i64 0), align 4
-; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i32* [[P:%.*]], getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 0, i64 0)
+; CHECK-NEXT:    store i32 1, ptr @y, align 4
+; CHECK-NEXT:    [[CMP:%.*]] = icmp eq ptr [[P:%.*]], @x
 ; CHECK-NEXT:    br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
 ; CHECK:       if.then:
-; CHECK-NEXT:    store i32 2, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 0, i64 0), align 4
+; CHECK-NEXT:    store i32 2, ptr @x, align 4
 ; CHECK-NEXT:    br label [[IF_END]]
 ; CHECK:       if.end:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @y, i64 0, i64 0), align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @y, align 4
 ; CHECK-NEXT:    ret i32 [[TMP0]]
 ;
 entry:
-  store i32 1, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @y, i64 0, i64 0), align 4
-  %cmp = icmp eq i32* %p, getelementptr inbounds (i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 0, i64 0), i64 0)
+  store i32 1, ptr @y, align 4
+  %cmp = icmp eq ptr %p, @x
   br i1 %cmp, label %if.then, label %if.end
 
 if.then:                                          ; preds = %entry
-  store i32 2, i32* %p, align 4
+  store i32 2, ptr %p, align 4
   br label %if.end
 
 if.end:                                           ; preds = %if.then, %entry
-  %0 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @y, i64 0, i64 0), align 4
+  %0 = load i32, ptr @y, align 4
   ret i32 %0
 }
 
-define i1 @eq_undereferenceable_cmp_simp(i32* %p) {
+define i1 @eq_undereferenceable_cmp_simp(ptr %p) {
 ; CHECK-LABEL: @eq_undereferenceable_cmp_simp(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[CMP_0:%.*]] = icmp eq i32* [[P:%.*]], getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 1, i64 0)
+; CHECK-NEXT:    [[CMP_0:%.*]] = icmp eq ptr [[P:%.*]], getelementptr inbounds (i32, ptr @x, i64 1)
 ; CHECK-NEXT:    br i1 [[CMP_0]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
 ; CHECK:       if.then:
-; CHECK-NEXT:    store i32 2, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 1, i64 0), align 4
+; CHECK-NEXT:    store i32 2, ptr getelementptr inbounds (i32, ptr @x, i64 1), align 4
 ; CHECK-NEXT:    ret i1 true
 ; CHECK:       if.end:
 ; CHECK-NEXT:    ret i1 false
 ;
 entry:
-  %cmp.0 = icmp eq i32* %p, getelementptr inbounds (i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 0, i64 0), i64 1)
+  %cmp.0 = icmp eq ptr %p, getelementptr inbounds (i32, ptr @x, i64 1)
   br i1 %cmp.0, label %if.then, label %if.end
 
 if.then:                                          ; preds = %entry
-  store i32 2, i32* %p, align 4
-  %cmp.1 = icmp eq i32* %p, getelementptr inbounds (i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 0, i64 0), i64 1)
+  store i32 2, ptr %p, align 4
+  %cmp.1 = icmp eq ptr %p, getelementptr inbounds (i32, ptr @x, i64 1)
   ret i1 %cmp.1
 
 if.end:                                           ; preds = %if.then, %entry
-  %cmp.2 = icmp eq i32* %p, getelementptr inbounds (i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @x, i64 0, i64 0), i64 1)
+  %cmp.2 = icmp eq ptr %p, getelementptr inbounds (i32, ptr @x, i64 1)
   ret i1 %cmp.2
 }

diff  --git a/llvm/test/Transforms/SCCP/report-changed.ll b/llvm/test/Transforms/SCCP/report-changed.ll
index 473c16b78f38..df76c688db94 100644
--- a/llvm/test/Transforms/SCCP/report-changed.ll
+++ b/llvm/test/Transforms/SCCP/report-changed.ll
@@ -8,27 +8,27 @@ entry:
   ret i16 0
 }
 
-declare i16 (i16, i16)* @add_fp2()
+declare ptr @add_fp2()
 
-define internal i16 (i16, i16)* ()* @add_fp3() {
+define internal ptr @add_fp3() {
 entry:
-  ret i16 (i16, i16)* ()* @add_fp2
+  ret ptr @add_fp2
 }
 
 define internal i16 @test_local_fp3(i16 %tnr) {
 entry:
   %tnr.addr = alloca i16, align 1
-  %call10 = call i16 @apply_fp3_local(i16 (i16, i16)* ()* ()* @add_fp3, i16 181, i16 16384)
-  %0 = load i16, i16* %tnr.addr, align 1
+  %call10 = call i16 @apply_fp3_local(ptr @add_fp3, i16 181, i16 16384)
+  %0 = load i16, ptr %tnr.addr, align 1
   ret i16 %0
 }
 
-define internal i16 @apply_fp3_local(i16 (i16, i16)* ()* ()* %fp, i16 %p1, i16 %p2) {
+define internal i16 @apply_fp3_local(ptr %fp, i16 %p1, i16 %p2) {
 entry:
-  %fp.addr = alloca i16 (i16, i16)* ()* ()*, align 1
-  store i16 (i16, i16)* ()* ()* %fp, i16 (i16, i16)* ()* ()** %fp.addr, align 1
-  %0 = load i16 (i16, i16)* ()* ()*, i16 (i16, i16)* ()* ()** %fp.addr, align 1
-  %call = call i16 (i16, i16)* ()* %0()
+  %fp.addr = alloca ptr, align 1
+  store ptr %fp, ptr %fp.addr, align 1
+  %0 = load ptr, ptr %fp.addr, align 1
+  %call = call ptr %0()
   %call2 = call i16 undef(i16 undef, i16 undef)
   ret i16 %call2
 }

diff  --git a/llvm/test/Transforms/SCCP/resolvedundefsin-tracked-fn.ll b/llvm/test/Transforms/SCCP/resolvedundefsin-tracked-fn.ll
index f56b4cad149c..58aa3a45e866 100644
--- a/llvm/test/Transforms/SCCP/resolvedundefsin-tracked-fn.ll
+++ b/llvm/test/Transforms/SCCP/resolvedundefsin-tracked-fn.ll
@@ -14,16 +14,16 @@ define i32 @test1_m(i32 %h) {
 ; CHECK-NEXT:    [[CONV:%.*]] = trunc i32 [[H]] to i8
 ; CHECK-NEXT:    [[CALL:%.*]] = call i32 @test1_k(i8 [[CONV]], i32 0)
 ; CHECK-NEXT:    [[CONV1:%.*]] = sext i32 [[H]] to i64
-; CHECK-NEXT:    [[TMP0:%.*]] = inttoptr i64 [[CONV1]] to %t1*
-; CHECK-NEXT:    [[CALL2:%.*]] = call i1 @test1_g(%t1* [[TMP0]], i32 1)
+; CHECK-NEXT:    [[TMP0:%.*]] = inttoptr i64 [[CONV1]] to ptr
+; CHECK-NEXT:    [[CALL2:%.*]] = call i1 @test1_g(ptr [[TMP0]], i32 1)
 ; CHECK-NEXT:    ret i32 undef
 ;
 entry:
   %conv = trunc i32 %h to i8
   %call = call i32 @test1_k(i8 %conv, i32 0)
   %conv1 = sext i32 %h to i64
-  %0 = inttoptr i64 %conv1 to %t1*
-  %call2 = call i1 @test1_g(%t1* %0, i32 1)
+  %0 = inttoptr i64 %conv1 to ptr
+  %call2 = call i1 @test1_g(ptr %0, i32 1)
   ret i32 undef
 
 ; uselistorder directives
@@ -36,27 +36,27 @@ define internal i32 @test1_k(i8 %h, i32 %i) {
 ; CHECK-LABEL: define {{[^@]+}}@test1_k
 ; CHECK-SAME: (i8 [[H:%.*]], i32 [[I:%.*]])
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* @e, align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @e, align 4
 ; CHECK-NEXT:    [[CONV:%.*]] = sext i32 [[TMP0]] to i64
-; CHECK-NEXT:    [[TMP1:%.*]] = inttoptr i64 [[CONV]] to %t1*
-; CHECK-NEXT:    [[CALL:%.*]] = call i1 @test1_g(%t1* [[TMP1]], i32 0)
+; CHECK-NEXT:    [[TMP1:%.*]] = inttoptr i64 [[CONV]] to ptr
+; CHECK-NEXT:    [[CALL:%.*]] = call i1 @test1_g(ptr [[TMP1]], i32 0)
 ; CHECK-NEXT:    call void @use.1(i1 false)
 ; CHECK-NEXT:    ret i32 undef
 ;
 entry:
-  %0 = load i32, i32* @e, align 4
+  %0 = load i32, ptr @e, align 4
   %conv = sext i32 %0 to i64
-  %1 = inttoptr i64 %conv to %t1*
-  %call = call i1 @test1_g(%t1* %1, i32 %i)
+  %1 = inttoptr i64 %conv to ptr
+  %call = call i1 @test1_g(ptr %1, i32 %i)
   %frombool.1 = zext i1 %call to i8
   %tobool.1 = trunc i8 %frombool.1 to i1
   call void @use.1(i1 %tobool.1)
   ret i32 undef
 }
 
-define internal i1 @test1_g(%t1* %h, i32 %i) #0 {
+define internal i1 @test1_g(ptr %h, i32 %i) #0 {
 ; CHECK-LABEL: define {{[^@]+}}@test1_g
-; CHECK-SAME: (%t1* [[H:%.*]], i32 [[I:%.*]])
+; CHECK-SAME: (ptr [[H:%.*]], i32 [[I:%.*]])
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[I]], 0
 ; CHECK-NEXT:    br i1 [[TOBOOL]], label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
@@ -91,16 +91,16 @@ define i32 @test2_m(i32 %h) #0 {
 ; CHECK-NEXT:    [[CONV:%.*]] = trunc i32 [[H]] to i8
 ; CHECK-NEXT:    [[CALL:%.*]] = call i32 @test2_k(i8 [[CONV]], i32 0)
 ; CHECK-NEXT:    [[CONV1:%.*]] = sext i32 [[H]] to i64
-; CHECK-NEXT:    [[TMP0:%.*]] = inttoptr i64 [[CONV1]] to %t1*
-; CHECK-NEXT:    [[CALL2:%.*]] = call i1 @test2_g(%t1* [[TMP0]], i32 1)
+; CHECK-NEXT:    [[TMP0:%.*]] = inttoptr i64 [[CONV1]] to ptr
+; CHECK-NEXT:    [[CALL2:%.*]] = call i1 @test2_g(ptr [[TMP0]], i32 1)
 ; CHECK-NEXT:    ret i32 undef
 ;
 entry:
   %conv = trunc i32 %h to i8
   %call = call i32 @test2_k(i8 %conv, i32 0)
   %conv1 = sext i32 %h to i64
-  %0 = inttoptr i64 %conv1 to %t1*
-  %call2 = call i1 @test2_g(%t1* %0, i32 1)
+  %0 = inttoptr i64 %conv1 to ptr
+  %call2 = call i1 @test2_g(ptr %0, i32 1)
   ret i32 undef
 
 ; uselistorder directives
@@ -113,18 +113,18 @@ define internal i32 @test2_k(i8 %h, i32 %i) {
 ; CHECK-LABEL: define {{[^@]+}}@test2_k
 ; CHECK-SAME: (i8 [[H:%.*]], i32 [[I:%.*]])
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* @e, align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @e, align 4
 ; CHECK-NEXT:    [[CONV:%.*]] = sext i32 [[TMP0]] to i64
-; CHECK-NEXT:    [[TMP1:%.*]] = inttoptr i64 [[CONV]] to %t1*
-; CHECK-NEXT:    [[CALL:%.*]] = call i1 @test3_g(%t1* [[TMP1]], i32 0)
+; CHECK-NEXT:    [[TMP1:%.*]] = inttoptr i64 [[CONV]] to ptr
+; CHECK-NEXT:    [[CALL:%.*]] = call i1 @test3_g(ptr [[TMP1]], i32 0)
 ; CHECK-NEXT:    call void @use.1(i1 false)
 ; CHECK-NEXT:    ret i32 undef
 ;
 entry:
-  %0 = load i32, i32* @e, align 4
+  %0 = load i32, ptr @e, align 4
   %conv = sext i32 %0 to i64
-  %1 = inttoptr i64 %conv to %t1*
-  %call = call i1 @test3_g(%t1* %1, i32 %i)
+  %1 = inttoptr i64 %conv to ptr
+  %call = call i1 @test3_g(ptr %1, i32 %i)
   %frombool = icmp slt i1 %call, 1
   %add = add i1 %frombool, %frombool
   call void @use.1(i1 %frombool)
@@ -132,9 +132,9 @@ entry:
 
 }
 
-define internal i1 @test2_g(%t1* %h, i32 %i) {
+define internal i1 @test2_g(ptr %h, i32 %i) {
 ; CHECK-LABEL: define {{[^@]+}}@test2_g
-; CHECK-SAME: (%t1* [[H:%.*]], i32 [[I:%.*]])
+; CHECK-SAME: (ptr [[H:%.*]], i32 [[I:%.*]])
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LAND_RHS:%.*]]
 ; CHECK:       land.rhs:
@@ -170,16 +170,16 @@ define i32 @test3_m(i32 %h) #0 {
 ; CHECK-NEXT:    [[CONV:%.*]] = trunc i32 [[H]] to i8
 ; CHECK-NEXT:    [[CALL:%.*]] = call i32 @test3_k(i8 [[CONV]], i32 0)
 ; CHECK-NEXT:    [[CONV1:%.*]] = sext i32 [[H]] to i64
-; CHECK-NEXT:    [[TMP0:%.*]] = inttoptr i64 [[CONV1]] to %t1*
-; CHECK-NEXT:    [[CALL2:%.*]] = call i1 @test3_g(%t1* [[TMP0]], i32 1)
+; CHECK-NEXT:    [[TMP0:%.*]] = inttoptr i64 [[CONV1]] to ptr
+; CHECK-NEXT:    [[CALL2:%.*]] = call i1 @test3_g(ptr [[TMP0]], i32 1)
 ; CHECK-NEXT:    ret i32 undef
 ;
 entry:
   %conv = trunc i32 %h to i8
   %call = call i32 @test3_k(i8 %conv, i32 0)
   %conv1 = sext i32 %h to i64
-  %0 = inttoptr i64 %conv1 to %t1*
-  %call2 = call i1 @test3_g(%t1* %0, i32 1)
+  %0 = inttoptr i64 %conv1 to ptr
+  %call2 = call i1 @test3_g(ptr %0, i32 1)
   ret i32 undef
 
 ; uselistorder directives
@@ -190,26 +190,26 @@ define internal i32 @test3_k(i8 %h, i32 %i) {
 ; CHECK-LABEL: define {{[^@]+}}@test3_k
 ; CHECK-SAME: (i8 [[H:%.*]], i32 [[I:%.*]])
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* @e, align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @e, align 4
 ; CHECK-NEXT:    [[CONV:%.*]] = sext i32 [[TMP0]] to i64
-; CHECK-NEXT:    [[TMP1:%.*]] = inttoptr i64 [[CONV]] to %t1*
+; CHECK-NEXT:    [[TMP1:%.*]] = inttoptr i64 [[CONV]] to ptr
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
-; CHECK-NEXT:    [[CALL:%.*]] = call i1 @test3_g(%t1* [[TMP1]], i32 0)
+; CHECK-NEXT:    [[CALL:%.*]] = call i1 @test3_g(ptr [[TMP1]], i32 0)
 ; CHECK-NEXT:    call void @use.1(i1 false)
 ; CHECK-NEXT:    br label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret i32 undef
 ;
 entry:
-  %0 = load i32, i32* @e, align 4
+  %0 = load i32, ptr @e, align 4
   %conv = sext i32 %0 to i64
-  %1 = inttoptr i64 %conv to %t1*
+  %1 = inttoptr i64 %conv to ptr
   br label %loop
 
 loop:
   %phi = phi i1 [ undef, %entry], [ %call, %loop ]
-  %call = call i1 @test3_g(%t1* %1, i32 %i)
+  %call = call i1 @test3_g(ptr %1, i32 %i)
   %frombool = icmp slt i1 %call, 1
   %add = add i1 %frombool, %frombool
   call void @use.1(i1 %frombool)
@@ -219,9 +219,9 @@ exit:
   ret i32 undef
 }
 
-define internal i1 @test3_g(%t1* %h, i32 %i) {
+define internal i1 @test3_g(ptr %h, i32 %i) {
 ; CHECK-LABEL: define {{[^@]+}}@test3_g
-; CHECK-SAME: (%t1* [[H:%.*]], i32 [[I:%.*]])
+; CHECK-SAME: (ptr [[H:%.*]], i32 [[I:%.*]])
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[I]], 0
 ; CHECK-NEXT:    br i1 [[TOBOOL]], label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
@@ -253,50 +253,48 @@ declare i32 @test3_j(...)
 ; TODO: We can eliminate the bitcast, if we resolve the unknown argument of
 ;       @test4_b first.
 
-declare void @use.16(i16*)
-declare void @use.8(i8*)
+declare void @use.16(ptr)
+declare void @use.8(ptr)
 
 define void @test4_a() {
 ; CHECK-LABEL: define {{[^@]+}}@test4_a()
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = call i8* @test4_c(i8* null)
-; CHECK-NEXT:    call void @test4_b(i8* null)
+; CHECK-NEXT:    [[TMP:%.*]] = call ptr @test4_c(ptr null)
+; CHECK-NEXT:    call void @test4_b(ptr null)
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  %tmp = call i8* @test4_c(i8* null)
-  call void @test4_b(i8* %tmp)
+  %tmp = call ptr @test4_c(ptr null)
+  call void @test4_b(ptr %tmp)
   ret void
 }
 
-define internal void @test4_b(i8* %arg) {
+define internal void @test4_b(ptr %arg) {
 ; CHECK-LABEL: define {{[^@]+}}@test4_b
-; CHECK-SAME: (i8* [[ARG:%.*]])
+; CHECK-SAME: (ptr [[ARG:%.*]])
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = bitcast i8* null to i16*
-; CHECK-NEXT:    [[SEL:%.*]] = select i1 false, i8* null, i8* null
-; CHECK-NEXT:    call void @use.16(i16* [[TMP]])
-; CHECK-NEXT:    call void @use.8(i8* [[SEL]])
+; CHECK-NEXT:    [[SEL:%.*]] = select i1 false, ptr null, ptr null
+; CHECK-NEXT:    call void @use.16(ptr null)
+; CHECK-NEXT:    call void @use.8(ptr [[SEL]])
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  %tmp = bitcast i8* %arg to i16*
-  %sel = select i1 false, i8* %arg, i8* %arg
-  call void @use.16(i16* %tmp)
-  call void @use.8(i8* %sel)
+  %sel = select i1 false, ptr %arg, ptr %arg
+  call void @use.16(ptr %arg)
+  call void @use.8(ptr %sel)
   ret void
 }
 
-define internal i8* @test4_c(i8* %arg) {
+define internal ptr @test4_c(ptr %arg) {
 ; CHECK-LABEL: define {{[^@]+}}@test4_c
-; CHECK-SAME: (i8* [[ARG:%.*]])
+; CHECK-SAME: (ptr [[ARG:%.*]])
 ; CHECK-NEXT:  bb1:
 ; CHECK-NEXT:    [[TMP:%.*]] = and i1 undef, undef
 ; CHECK-NEXT:    br i1 [[TMP]], label [[BB3:%.*]], label [[BB2:%.*]]
 ; CHECK:       bb2:
 ; CHECK-NEXT:    unreachable
 ; CHECK:       bb3:
-; CHECK-NEXT:    ret i8* undef
+; CHECK-NEXT:    ret ptr undef
 ;
 bb1:                                              ; preds = %bb
   %tmp = and i1 undef, undef
@@ -306,7 +304,7 @@ bb2:                                              ; preds = %bb1
   unreachable
 
 bb3:                                              ; preds = %bb1
-  ret i8* null
+  ret ptr null
 }
 
 ; TODO: Same as test4, but with a select instead of a bitcast.
@@ -314,40 +312,40 @@ bb3:                                              ; preds = %bb1
 define void @test5_a() {
 ; CHECK-LABEL: define {{[^@]+}}@test5_a()
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP:%.*]] = call i8* @test5_c(i8* null)
-; CHECK-NEXT:    call void @test5_b(i8* null)
+; CHECK-NEXT:    [[TMP:%.*]] = call ptr @test5_c(ptr null)
+; CHECK-NEXT:    call void @test5_b(ptr null)
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  %tmp = call i8* @test5_c(i8* null)
-  call void @test5_b(i8* %tmp)
+  %tmp = call ptr @test5_c(ptr null)
+  call void @test5_b(ptr %tmp)
   ret void
 }
 
-define internal void @test5_b(i8* %arg) {
+define internal void @test5_b(ptr %arg) {
 ; CHECK-LABEL: define {{[^@]+}}@test5_b
-; CHECK-SAME: (i8* [[ARG:%.*]])
+; CHECK-SAME: (ptr [[ARG:%.*]])
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[SEL:%.*]] = select i1 false, i8* null, i8* null
-; CHECK-NEXT:    call void @use.8(i8* [[SEL]])
+; CHECK-NEXT:    [[SEL:%.*]] = select i1 false, ptr null, ptr null
+; CHECK-NEXT:    call void @use.8(ptr [[SEL]])
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  %sel = select i1 false, i8* %arg, i8* %arg
-  call void @use.8(i8* %sel)
+  %sel = select i1 false, ptr %arg, ptr %arg
+  call void @use.8(ptr %sel)
   ret void
 }
 
-define internal i8* @test5_c(i8* %arg) {
+define internal ptr @test5_c(ptr %arg) {
 ; CHECK-LABEL: define {{[^@]+}}@test5_c
-; CHECK-SAME: (i8* [[ARG:%.*]])
+; CHECK-SAME: (ptr [[ARG:%.*]])
 ; CHECK-NEXT:  bb1:
 ; CHECK-NEXT:    [[TMP:%.*]] = and i1 undef, undef
 ; CHECK-NEXT:    br i1 [[TMP]], label [[BB3:%.*]], label [[BB2:%.*]]
 ; CHECK:       bb2:
 ; CHECK-NEXT:    unreachable
 ; CHECK:       bb3:
-; CHECK-NEXT:    ret i8* undef
+; CHECK-NEXT:    ret ptr undef
 ;
 bb1:                                              ; preds = %bb
   %tmp = and i1 undef, undef
@@ -357,7 +355,7 @@ bb2:                                              ; preds = %bb1
   unreachable
 
 bb3:                                              ; preds = %bb1
-  ret i8* null
+  ret ptr null
 }
 
 
@@ -371,18 +369,18 @@ define void @test3() {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[IF_END16:%.*]]
 ; CHECK:       if.end16:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* @contextsize, align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @contextsize, align 4
 ; CHECK-NEXT:    [[SUB18:%.*]] = sub i32 undef, [[TMP0]]
 ; CHECK-NEXT:    [[SUB19:%.*]] = sub i32 [[SUB18]], undef
-; CHECK-NEXT:    [[TMP1:%.*]] = load i32, i32* @maxposslen, align 4
+; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr @maxposslen, align 4
 ; CHECK-NEXT:    [[ADD:%.*]] = add nsw i32 [[TMP1]], 8
 ; CHECK-NEXT:    [[DIV:%.*]] = sdiv i32 undef, [[ADD]]
-; CHECK-NEXT:    [[TMP2:%.*]] = load i32, i32* @pcount, align 4
+; CHECK-NEXT:    [[TMP2:%.*]] = load i32, ptr @pcount, align 4
 ; CHECK-NEXT:    [[MUL:%.*]] = mul nsw i32 [[DIV]], [[SUB19]]
 ; CHECK-NEXT:    [[CMP20:%.*]] = icmp sgt i32 [[TMP2]], [[MUL]]
 ; CHECK-NEXT:    br i1 [[CMP20]], label [[IF_THEN22:%.*]], label [[IF_END24:%.*]]
 ; CHECK:       if.then22:
-; CHECK-NEXT:    store i32 [[MUL]], i32* @pcount, align 4
+; CHECK-NEXT:    store i32 [[MUL]], ptr @pcount, align 4
 ; CHECK-NEXT:    ret void
 ; CHECK:       if.end24:
 ; CHECK-NEXT:    [[CMP25474:%.*]] = icmp sgt i32 [[TMP2]], 0
@@ -396,19 +394,19 @@ entry:
   br label %if.end16
 
 if.end16:                                         ; preds = %entry
-  %0 = load i32, i32* @contextsize, align 4
+  %0 = load i32, ptr @contextsize, align 4
   %sub18 = sub i32 undef, %0
   %sub19 = sub i32 %sub18, undef
-  %1 = load i32, i32* @maxposslen, align 4
+  %1 = load i32, ptr @maxposslen, align 4
   %add = add nsw i32 %1, 8
   %div = sdiv i32 undef, %add
-  %2 = load i32, i32* @pcount, align 4
+  %2 = load i32, ptr @pcount, align 4
   %mul = mul nsw i32 %div, %sub19
   %cmp20 = icmp sgt i32 %2, %mul
   br i1 %cmp20, label %if.then22, label %if.end24
 
 if.then22:                                        ; preds = %if.end16
-  store i32 %mul, i32* @pcount, align 4
+  store i32 %mul, ptr @pcount, align 4
   ret void
 
 if.end24:                                         ; preds = %if.end16

diff  --git a/llvm/test/Transforms/SCCP/return-argument.ll b/llvm/test/Transforms/SCCP/return-argument.ll
index 1bfd9b7e25cb..3995966f994a 100644
--- a/llvm/test/Transforms/SCCP/return-argument.ll
+++ b/llvm/test/Transforms/SCCP/return-argument.ll
@@ -2,31 +2,31 @@
 ; RUN: opt < %s -passes=ipsccp -S | FileCheck %s
 
 ;; This function returns its second argument on all return statements
-define internal i32* @incdec(i1 %C, i32* %V) {
+define internal ptr @incdec(i1 %C, ptr %V) {
 ; CHECK-LABEL: @incdec(
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* [[V:%.*]], align 4
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr [[V:%.*]], align 4
 ; CHECK-NEXT:    br i1 [[C:%.*]], label [[T:%.*]], label [[F:%.*]]
 ; CHECK:       T:
 ; CHECK-NEXT:    [[X1:%.*]] = add i32 [[X]], 1
-; CHECK-NEXT:    store i32 [[X1]], i32* [[V]], align 4
-; CHECK-NEXT:    ret i32* [[V]]
+; CHECK-NEXT:    store i32 [[X1]], ptr [[V]], align 4
+; CHECK-NEXT:    ret ptr [[V]]
 ; CHECK:       F:
 ; CHECK-NEXT:    [[X2:%.*]] = sub i32 [[X]], 1
-; CHECK-NEXT:    store i32 [[X2]], i32* [[V]], align 4
-; CHECK-NEXT:    ret i32* [[V]]
+; CHECK-NEXT:    store i32 [[X2]], ptr [[V]], align 4
+; CHECK-NEXT:    ret ptr [[V]]
 ;
-  %X = load i32, i32* %V
+  %X = load i32, ptr %V
   br i1 %C, label %T, label %F
 
 T:              ; preds = %0
   %X1 = add i32 %X, 1
-  store i32 %X1, i32* %V
-  ret i32* %V
+  store i32 %X1, ptr %V
+  ret ptr %V
 
 F:              ; preds = %0
   %X2 = sub i32 %X, 1
-  store i32 %X2, i32* %V
-  ret i32* %V
+  store i32 %X2, ptr %V
+  ret ptr %V
 }
 
 ;; This function returns its first argument as a part of a multiple return
@@ -44,10 +44,10 @@ define internal { i32, i32 } @foo(i32 %A, i32 %B) {
   ret { i32, i32 } %Z
 }
 
-define void @caller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
+define void @caller(i1 %C) personality ptr @__gxx_personality_v0 {
 ; CHECK-LABEL: @caller(
 ; CHECK-NEXT:    [[Q:%.*]] = alloca i32, align 4
-; CHECK-NEXT:    [[W:%.*]] = call i32* @incdec(i1 [[C:%.*]], i32* [[Q]])
+; CHECK-NEXT:    [[W:%.*]] = call ptr @incdec(i1 [[C:%.*]], ptr [[Q]])
 ; CHECK-NEXT:    [[S1:%.*]] = call { i32, i32 } @foo(i32 1, i32 2)
 ; CHECK-NEXT:    [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0
 ; CHECK-NEXT:    [[S2:%.*]] = invoke { i32, i32 } @foo(i32 3, i32 4)
@@ -55,10 +55,10 @@ define void @caller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
 ; CHECK:       OK:
 ; CHECK-NEXT:    [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0
 ; CHECK-NEXT:    [[Z:%.*]] = add i32 [[X1]], [[X2]]
-; CHECK-NEXT:    store i32 [[Z]], i32* [[W]], align 4
+; CHECK-NEXT:    store i32 [[Z]], ptr [[W]], align 4
 ; CHECK-NEXT:    br label [[RET:%.*]]
 ; CHECK:       LPAD:
-; CHECK-NEXT:    [[EXN:%.*]] = landingpad { i8*, i32 }
+; CHECK-NEXT:    [[EXN:%.*]] = landingpad { ptr, i32 }
 ; CHECK-NEXT:    cleanup
 ; CHECK-NEXT:    br label [[RET]]
 ; CHECK:       RET:
@@ -66,7 +66,7 @@ define void @caller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
 ;
   %Q = alloca i32
   ;; Call incdec to see if %W is properly replaced by %Q
-  %W = call i32* @incdec(i1 %C, i32* %Q )             ; <i32> [#uses=1]
+  %W = call ptr @incdec(i1 %C, ptr %Q )             ; <i32> [#uses=1]
   ;; Call @foo twice, to prevent the arguments from propagating into the
   ;; function (so we can check the returned argument is properly
   ;; propagated per-caller).
@@ -78,11 +78,11 @@ OK:
   %X2 = extractvalue { i32, i32 } %S2, 0
   ;; Do some stuff with the returned values which we can grep for
   %Z  = add i32 %X1, %X2
-  store i32 %Z, i32* %W
+  store i32 %Z, ptr %W
   br label %RET
 
 LPAD:
-  %exn = landingpad {i8*, i32}
+  %exn = landingpad {ptr, i32}
   cleanup
   br label %RET
 

diff  --git a/llvm/test/Transforms/SCCP/return-constant.ll b/llvm/test/Transforms/SCCP/return-constant.ll
index 5cf53eea12b7..13f01e525221 100644
--- a/llvm/test/Transforms/SCCP/return-constant.ll
+++ b/llvm/test/Transforms/SCCP/return-constant.ll
@@ -28,14 +28,14 @@ define i1 @caller(i1 %C) {
   ret i1 %Y
 }
 
-define i1 @invokecaller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
+define i1 @invokecaller(i1 %C) personality ptr @__gxx_personality_v0 {
 ; CHECK-LABEL: @invokecaller(
 ; CHECK-NEXT:    [[X:%.*]] = invoke i32 @foo(i1 [[C:%.*]])
 ; CHECK-NEXT:    to label [[OK:%.*]] unwind label [[FAIL:%.*]]
 ; CHECK:       OK:
 ; CHECK-NEXT:    ret i1 true
 ; CHECK:       FAIL:
-; CHECK-NEXT:    [[EXN:%.*]] = landingpad { i8*, i32 }
+; CHECK-NEXT:    [[EXN:%.*]] = landingpad { ptr, i32 }
 ; CHECK-NEXT:    cleanup
 ; CHECK-NEXT:    ret i1 false
 ;
@@ -44,7 +44,7 @@ OK:
   %Y = icmp ne i32 %X, 0          ; <i1> [#uses=1]
   ret i1 %Y
 FAIL:
-  %exn = landingpad {i8*, i32}
+  %exn = landingpad {ptr, i32}
   cleanup
   ret i1 false
 }

diff  --git a/llvm/test/Transforms/SCCP/retvalue-undef.ll b/llvm/test/Transforms/SCCP/retvalue-undef.ll
index bf3a48c1ee0f..c388accbe2ac 100644
--- a/llvm/test/Transforms/SCCP/retvalue-undef.ll
+++ b/llvm/test/Transforms/SCCP/retvalue-undef.ll
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define internal i32 ()* @f() {
-  ret i32 ()* @g
+define internal ptr @f() {
+  ret ptr @g
 }
 
 define internal i32 @g() {
@@ -15,17 +15,17 @@ define internal i32 @g() {
 ; CHECK-NEXT: ret i32 8
 
 define internal void @outer_mod() {
-  %1 = call i32 ()* () @f()                      ; <i32 ()*> [#uses=1]
+  %1 = call ptr () @f()                      ; <ptr> [#uses=1]
   %2 = call i32 %1()                              ; <i32> [#uses=0]
   ret void
 }
 
 define internal void @module_init() {
-  call void @register_outer_mod(void ()* @outer_mod)
+  call void @register_outer_mod(ptr @outer_mod)
   ret void
 }
 
-declare void @register_outer_mod(void ()*)
+declare void @register_outer_mod(ptr)
 
 define i32 @main() {
   ret i32 0

diff  --git a/llvm/test/Transforms/SCCP/switch.ll b/llvm/test/Transforms/SCCP/switch.ll
index 20067cc6f6c1..5ab24db1d1e2 100644
--- a/llvm/test/Transforms/SCCP/switch.ll
+++ b/llvm/test/Transforms/SCCP/switch.ll
@@ -73,12 +73,12 @@ end:
   ret i32 %phi
 }
 
-define i32 @test_duplicate_successors_phi_3(i1 %c1, i32* %p, i32 %y) {
+define i32 @test_duplicate_successors_phi_3(i1 %c1, ptr %p, i32 %y) {
 ; CHECK-LABEL: @test_duplicate_successors_phi_3(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br i1 [[C1:%.*]], label [[SWITCH:%.*]], label [[SWITCH_1:%.*]]
 ; CHECK:       switch:
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* [[P:%.*]], align 4, !range !0
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr [[P:%.*]], align 4, !range !0
 ; CHECK-NEXT:    switch i32 [[X]], label [[SWITCH_DEFAULT:%.*]] [
 ; CHECK-NEXT:    i32 0, label [[SWITCH_DEFAULT]]
 ; CHECK-NEXT:    i32 1, label [[SWITCH_0:%.*]]
@@ -95,7 +95,7 @@ entry:
   br i1 %c1, label %switch, label %switch.1
 
 switch:
-  %x = load i32, i32* %p, !range !{i32 0, i32 3}
+  %x = load i32, ptr %p, !range !{i32 0, i32 3}
   switch i32 %x, label %switch.default [
   i32 0, label %switch.default
   i32 1, label %switch.0
@@ -116,9 +116,9 @@ switch.1:
 }
 
 ; TODO: Determine that the default destination is dead.
-define i32 @test_local_range(i32* %p) {
+define i32 @test_local_range(ptr %p) {
 ; CHECK-LABEL: @test_local_range(
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* [[P:%.*]], align 4, !range !0
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr [[P:%.*]], align 4, !range !0
 ; CHECK-NEXT:    switch i32 [[X]], label [[SWITCH_DEFAULT:%.*]] [
 ; CHECK-NEXT:    i32 0, label [[SWITCH_0:%.*]]
 ; CHECK-NEXT:    i32 1, label [[SWITCH_1:%.*]]
@@ -133,7 +133,7 @@ define i32 @test_local_range(i32* %p) {
 ; CHECK:       switch.2:
 ; CHECK-NEXT:    ret i32 2
 ;
-  %x = load i32, i32* %p, !range !{i32 0, i32 3}
+  %x = load i32, ptr %p, !range !{i32 0, i32 3}
   switch i32 %x, label %switch.default [
   i32 0, label %switch.0
   i32 1, label %switch.1
@@ -158,9 +158,9 @@ switch.3:
 }
 
 ; TODO: Determine that case i3 is dead, even though the edge is shared?
-define i32 @test_duplicate_successors(i32* %p) {
+define i32 @test_duplicate_successors(ptr %p) {
 ; CHECK-LABEL: @test_duplicate_successors(
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* [[P:%.*]], align 4, !range !0
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr [[P:%.*]], align 4, !range !0
 ; CHECK-NEXT:    switch i32 [[X]], label [[SWITCH_DEFAULT:%.*]] [
 ; CHECK-NEXT:    i32 0, label [[SWITCH_0:%.*]]
 ; CHECK-NEXT:    i32 1, label [[SWITCH_0]]
@@ -174,7 +174,7 @@ define i32 @test_duplicate_successors(i32* %p) {
 ; CHECK:       switch.1:
 ; CHECK-NEXT:    ret i32 1
 ;
-  %x = load i32, i32* %p, !range !{i32 0, i32 3}
+  %x = load i32, ptr %p, !range !{i32 0, i32 3}
   switch i32 %x, label %switch.default [
   i32 0, label %switch.0
   i32 1, label %switch.0

diff  --git a/llvm/test/Transforms/SCCP/thread_local_acs.ll b/llvm/test/Transforms/SCCP/thread_local_acs.ll
index 769991fc4148..e2a3b217e0fd 100644
--- a/llvm/test/Transforms/SCCP/thread_local_acs.ll
+++ b/llvm/test/Transforms/SCCP/thread_local_acs.ll
@@ -20,17 +20,17 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 @gtl = dso_local thread_local global i32 0, align 4
 @gsh = dso_local global i32 0, align 4
 
-define internal i32 @callee(i32* %thread_local_ptr, i32* %shared_ptr) {
+define internal i32 @callee(ptr %thread_local_ptr, ptr %shared_ptr) {
 ; CHECK-LABEL: @callee(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP:%.*]] = load i32, i32* [[THREAD_LOCAL_PTR:%.*]], align 4
-; CHECK-NEXT:    [[TMP1:%.*]] = load i32, i32* [[SHARED_PTR:%.*]], align 4
+; CHECK-NEXT:    [[TMP:%.*]] = load i32, ptr [[THREAD_LOCAL_PTR:%.*]], align 4
+; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[SHARED_PTR:%.*]], align 4
 ; CHECK-NEXT:    [[ADD:%.*]] = add nsw i32 [[TMP]], [[TMP1]]
 ; CHECK-NEXT:    ret i32 [[ADD]]
 ;
 entry:
-  %tmp = load i32, i32* %thread_local_ptr, align 4
-  %tmp1 = load i32, i32* %shared_ptr, align 4
+  %tmp = load i32, ptr %thread_local_ptr, align 4
+  %tmp1 = load i32, ptr %shared_ptr, align 4
   %add = add nsw i32 %tmp, %tmp1
   ret i32 %add
 }
@@ -38,15 +38,15 @@ entry:
 define dso_local void @caller() {
 ; CHECK-LABEL: @caller(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    call void @broker(i32* nonnull @gtl, i32 (i32*, i32*)* nonnull @callee, i32* nonnull @gsh)
+; CHECK-NEXT:    call void @broker(ptr nonnull @gtl, ptr nonnull @callee, ptr nonnull @gsh)
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  call void @broker(i32* nonnull @gtl, i32 (i32*, i32*)* nonnull @callee, i32* nonnull @gsh)
+  call void @broker(ptr nonnull @gtl, ptr nonnull @callee, ptr nonnull @gsh)
   ret void
 }
 
-declare !callback !0 dso_local void @broker(i32*, i32 (i32*, i32*)*, i32*)
+declare !callback !0 dso_local void @broker(ptr, ptr, ptr)
 
 !1 = !{i64 1, i64 0, i64 2, i1 false}
 !0 = !{!1}

diff  --git a/llvm/test/Transforms/SCCP/ub-shift.ll b/llvm/test/Transforms/SCCP/ub-shift.ll
index c338043cb311..9112658fcf3d 100644
--- a/llvm/test/Transforms/SCCP/ub-shift.ll
+++ b/llvm/test/Transforms/SCCP/ub-shift.ll
@@ -1,82 +1,82 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt < %s -passes=sccp -S | FileCheck %s
 
-define void @shift_undef_64(i64* %p) {
+define void @shift_undef_64(ptr %p) {
 ; CHECK-LABEL: @shift_undef_64(
-; CHECK-NEXT:    store i64 0, i64* [[P:%.*]]
-; CHECK-NEXT:    store i64 -1, i64* [[P]]
+; CHECK-NEXT:    store i64 0, ptr [[P:%.*]]
+; CHECK-NEXT:    store i64 -1, ptr [[P]]
 ; CHECK-NEXT:    [[R3:%.*]] = shl i64 -1, 4294967298
-; CHECK-NEXT:    store i64 [[R3]], i64* [[P]]
+; CHECK-NEXT:    store i64 [[R3]], ptr [[P]]
 ; CHECK-NEXT:    ret void
 ;
   %r1 = lshr i64 -1, 4294967296 ; 2^32
-  store i64 %r1, i64* %p
+  store i64 %r1, ptr %p
 
   %r2 = ashr i64 -1, 4294967297 ; 2^32 + 1
-  store i64 %r2, i64* %p
+  store i64 %r2, ptr %p
 
   %r3 = shl i64 -1, 4294967298 ; 2^32 + 2
-  store i64 %r3, i64* %p
+  store i64 %r3, ptr %p
 
   ret void
 }
 
-define void @shift_undef_65(i65* %p) {
+define void @shift_undef_65(ptr %p) {
 ; CHECK-LABEL: @shift_undef_65(
-; CHECK-NEXT:    store i65 0, i65* [[P:%.*]]
-; CHECK-NEXT:    store i65 0, i65* [[P]]
+; CHECK-NEXT:    store i65 0, ptr [[P:%.*]]
+; CHECK-NEXT:    store i65 0, ptr [[P]]
 ; CHECK-NEXT:    [[R3:%.*]] = shl i65 1, -18446744073709551615
-; CHECK-NEXT:    store i65 [[R3]], i65* [[P]]
+; CHECK-NEXT:    store i65 [[R3]], ptr [[P]]
 ; CHECK-NEXT:    ret void
 ;
   %r1 = lshr i65 2, 18446744073709551617
-  store i65 %r1, i65* %p
+  store i65 %r1, ptr %p
 
   %r2 = ashr i65 4, 18446744073709551617
-  store i65 %r2, i65* %p
+  store i65 %r2, ptr %p
 
   %r3 = shl i65 1, 18446744073709551617
-  store i65 %r3, i65* %p
+  store i65 %r3, ptr %p
 
   ret void
 }
 
-define void @shift_undef_256(i256* %p) {
+define void @shift_undef_256(ptr %p) {
 ; CHECK-LABEL: @shift_undef_256(
-; CHECK-NEXT:    store i256 0, i256* [[P:%.*]]
-; CHECK-NEXT:    store i256 0, i256* [[P]]
+; CHECK-NEXT:    store i256 0, ptr [[P:%.*]]
+; CHECK-NEXT:    store i256 0, ptr [[P]]
 ; CHECK-NEXT:    [[R3:%.*]] = shl i256 1, 18446744073709551619
-; CHECK-NEXT:    store i256 [[R3]], i256* [[P]]
+; CHECK-NEXT:    store i256 [[R3]], ptr [[P]]
 ; CHECK-NEXT:    ret void
 ;
   %r1 = lshr i256 2, 18446744073709551617
-  store i256 %r1, i256* %p
+  store i256 %r1, ptr %p
 
   %r2 = ashr i256 4, 18446744073709551618
-  store i256 %r2, i256* %p
+  store i256 %r2, ptr %p
 
   %r3 = shl i256 1, 18446744073709551619
-  store i256 %r3, i256* %p
+  store i256 %r3, ptr %p
 
   ret void
 }
 
-define void @shift_undef_511(i511* %p) {
+define void @shift_undef_511(ptr %p) {
 ; CHECK-LABEL: @shift_undef_511(
-; CHECK-NEXT:    store i511 0, i511* [[P:%.*]]
-; CHECK-NEXT:    store i511 -1, i511* [[P]]
+; CHECK-NEXT:    store i511 0, ptr [[P:%.*]]
+; CHECK-NEXT:    store i511 -1, ptr [[P]]
 ; CHECK-NEXT:    [[R3:%.*]] = shl i511 -3, 1208925819614629174706180
-; CHECK-NEXT:    store i511 [[R3]], i511* [[P]]
+; CHECK-NEXT:    store i511 [[R3]], ptr [[P]]
 ; CHECK-NEXT:    ret void
 ;
   %r1 = lshr i511 -1, 1208925819614629174706276 ; 2^80 + 100
-  store i511 %r1, i511* %p
+  store i511 %r1, ptr %p
 
   %r2 = ashr i511 -2, 1208925819614629174706200
-  store i511 %r2, i511* %p
+  store i511 %r2, ptr %p
 
   %r3 = shl i511 -3, 1208925819614629174706180
-  store i511 %r3, i511* %p
+  store i511 %r3, ptr %p
 
   ret void
 }

diff  --git a/llvm/test/Transforms/SCCP/ubsan_overflow.ll b/llvm/test/Transforms/SCCP/ubsan_overflow.ll
index 299c1e757e23..6073d6070c3a 100644
--- a/llvm/test/Transforms/SCCP/ubsan_overflow.ll
+++ b/llvm/test/Transforms/SCCP/ubsan_overflow.ll
@@ -7,7 +7,7 @@ define i8 @foo() {
 entry:
   %0 = add nuw nsw i64 0, -1
   %1 = lshr i64 %0, 1
-  %2 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* bitcast ([16 x i8]* @0 to [4 x [4 x i8]]*), i64 0, i64 0, i64 %1
-  %3 = load i8, i8* %2, align 1
+  %2 = getelementptr inbounds [4 x [4 x i8]], ptr @0, i64 0, i64 0, i64 %1
+  %3 = load i8, ptr %2, align 1
   ret i8 %3
 }

diff  --git a/llvm/test/Transforms/SCCP/undef-resolve.ll b/llvm/test/Transforms/SCCP/undef-resolve.ll
index f66978e08a23..9aecadaec0ee 100644
--- a/llvm/test/Transforms/SCCP/undef-resolve.ll
+++ b/llvm/test/Transforms/SCCP/undef-resolve.ll
@@ -258,11 +258,11 @@ entry:
 define i32 @test11(i1 %tobool) {
 ; CHECK-LABEL: @test11(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[SHR4:%.*]] = ashr i32 undef, zext (i1 icmp eq (i32* bitcast (i32 (i1)* @test11 to i32*), i32* @GV) to i32)
+; CHECK-NEXT:    [[SHR4:%.*]] = ashr i32 undef, zext (i1 icmp eq (ptr @test11, ptr @GV) to i32)
 ; CHECK-NEXT:    ret i32 [[SHR4]]
 ;
 entry:
-  %shr4 = ashr i32 undef, zext (i1 icmp eq (i32* bitcast (i32 (i1)* @test11 to i32*), i32* @GV) to i32)
+  %shr4 = ashr i32 undef, zext (i1 icmp eq (ptr @test11, ptr @GV) to i32)
   ret i32 %shr4
 }
 

diff  --git a/llvm/test/Transforms/SCCP/vector-bitcast.ll b/llvm/test/Transforms/SCCP/vector-bitcast.ll
index ab27c29b14fe..bed5c02d73bc 100644
--- a/llvm/test/Transforms/SCCP/vector-bitcast.ll
+++ b/llvm/test/Transforms/SCCP/vector-bitcast.ll
@@ -7,7 +7,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
 
 declare void @use(i1)
 
-define void @foo(<2 x i64>* %p) nounwind {
+define void @foo(ptr %p) nounwind {
 ; CHECK-LABEL: @foo(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[WHILE_BODY_I:%.*]]
@@ -15,7 +15,7 @@ define void @foo(<2 x i64>* %p) nounwind {
 ; CHECK-NEXT:    [[VWORKEXPONENT_I_033:%.*]] = phi <4 x i32> [ [[SUB_I_I:%.*]], [[WHILE_BODY_I]] ], [ <i32 939524096, i32 939524096, i32 939524096, i32 939524096>, [[ENTRY:%.*]] ]
 ; CHECK-NEXT:    [[SUB_I_I]] = add <4 x i32> [[VWORKEXPONENT_I_033]], <i32 -8388608, i32 -8388608, i32 -8388608, i32 -8388608>
 ; CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x i32> [[SUB_I_I]] to <2 x i64>
-; CHECK-NEXT:    store volatile <2 x i64> zeroinitializer, <2 x i64>* [[P:%.*]], align 16
+; CHECK-NEXT:    store volatile <2 x i64> zeroinitializer, ptr [[P:%.*]], align 16
 ; CHECK-NEXT:    br label [[WHILE_BODY_I]]
 ;
 entry:
@@ -26,7 +26,7 @@ while.body.i:                                     ; preds = %while.body.i, %entr
   %sub.i.i = add <4 x i32> %vWorkExponent.i.033, <i32 -8388608, i32 -8388608, i32 -8388608, i32 -8388608>
   %0 = bitcast <4 x i32> %sub.i.i to <2 x i64>
   %and.i119.i = and <2 x i64> %0, zeroinitializer
-  store volatile <2 x i64> %and.i119.i, <2 x i64>* %p
+  store volatile <2 x i64> %and.i119.i, ptr %p
   br label %while.body.i
 }
 
@@ -39,7 +39,7 @@ declare <64 x i8> @llvm.abs.v64i8(<64 x i8>, i1 immarg)
 define void @vec_cast_abs() {
 ; CHECK-LABEL: @vec_cast_abs(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP1:%.*]] = load <64 x i8>, <64 x i8>* bitcast (%union.V512* @i8_mix to <64 x i8>*), align 64
+; CHECK-NEXT:    [[TMP1:%.*]] = load <64 x i8>, ptr @i8_mix, align 64
 ; CHECK-NEXT:    [[TMP2:%.*]] = tail call <64 x i8> @llvm.abs.v64i8(<64 x i8> [[TMP1]], i1 false)
 ; CHECK-NEXT:    [[TMP3:%.*]] = bitcast <64 x i8> [[TMP2]] to i512
 ; CHECK-NEXT:    [[CMP_1:%.*]] = icmp eq i512 [[TMP3]], 12
@@ -54,7 +54,7 @@ define void @vec_cast_abs() {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %tmp1 = load <64 x i8>, <64 x i8>* bitcast (%union.V512* @i8_mix to <64 x i8>*)
+  %tmp1 = load <64 x i8>, ptr @i8_mix
   %tmp2 = tail call <64 x i8> @llvm.abs.v64i8(<64 x i8> %tmp1, i1 false)
 
   %tmp3 = bitcast <64 x i8> %tmp2 to i512

diff  --git a/llvm/test/Transforms/SCCP/widening.ll b/llvm/test/Transforms/SCCP/widening.ll
index eb75442585f7..c5bf3417d687 100644
--- a/llvm/test/Transforms/SCCP/widening.ll
+++ b/llvm/test/Transforms/SCCP/widening.ll
@@ -432,12 +432,11 @@ exit:
 ; In the function below, the condition %c.1 results in a range [7, 6), which
 ; can be used as a widening bound. It does not fully contain the range we get
 ; from combining it with the information from %tmp12.
-define void @foo(i64* %arg) {
+define void @foo(ptr %arg) {
 ; SCCP-LABEL: @foo(
 ; SCCP-NEXT:  bb:
 ; SCCP-NEXT:    [[TMP:%.*]] = zext i8 undef to i32
-; SCCP-NEXT:    [[TMP1:%.*]] = getelementptr inbounds i64, i64* [[ARG:%.*]], i32 0
-; SCCP-NEXT:    [[TMP2:%.*]] = load i64, i64* [[TMP1]], align 8
+; SCCP-NEXT:    [[TMP2:%.*]] = load i64, ptr [[ARG:%.*]], align 8
 ; SCCP-NEXT:    switch i32 [[TMP]], label [[BB20:%.*]] [
 ; SCCP-NEXT:    i32 1, label [[BB3:%.*]]
 ; SCCP-NEXT:    i32 2, label [[BB4:%.*]]
@@ -474,8 +473,7 @@ define void @foo(i64* %arg) {
 ; IPSCCP-LABEL: @foo(
 ; IPSCCP-NEXT:  bb:
 ; IPSCCP-NEXT:    [[TMP:%.*]] = zext i8 undef to i32
-; IPSCCP-NEXT:    [[TMP1:%.*]] = getelementptr inbounds i64, i64* [[ARG:%.*]], i32 0
-; IPSCCP-NEXT:    [[TMP2:%.*]] = load i64, i64* [[TMP1]], align 8
+; IPSCCP-NEXT:    [[TMP2:%.*]] = load i64, ptr [[ARG:%.*]], align 8
 ; IPSCCP-NEXT:    switch i32 [[TMP]], label [[BB20:%.*]] [
 ; IPSCCP-NEXT:    i32 1, label [[BB3:%.*]]
 ; IPSCCP-NEXT:    i32 2, label [[BB4:%.*]]
@@ -511,8 +509,7 @@ define void @foo(i64* %arg) {
 ;
 bb:
   %tmp = zext i8 undef to i32
-  %tmp1 = getelementptr inbounds i64, i64* %arg, i32 0
-  %tmp2 = load i64, i64* %tmp1, align 8
+  %tmp2 = load i64, ptr %arg, align 8
   switch i32 %tmp, label %bb20 [
   i32 1, label %bb3
   i32 2, label %bb4
@@ -559,72 +556,70 @@ bb20:                                             ; preds = %bb
 ; The functions below check that widening with an upper bound does correctly
 ; return whether the range changed. Make sure we do not eliminate %c.2.
 
-%struct.baz.1 = type { i32, i32, i8*, i8* }
+%struct.baz.1 = type { i32, i32, ptr, ptr }
 %struct.blam.2 = type <{ %struct.baz.1, i32, [4 x i8] }>
 
 @global.11 = linkonce_odr global [4 x i8] zeroinitializer, align 1
 
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1
 
-define linkonce_odr dereferenceable(1) i8* @spam(%struct.baz.1* %arg, i32 %arg1) align 2 {
+define linkonce_odr dereferenceable(1) ptr @spam(ptr %arg, i32 %arg1) align 2 {
 ; SCCP-LABEL: @spam(
 ; SCCP-NEXT:  bb:
-; SCCP-NEXT:    [[TMP:%.*]] = getelementptr inbounds [[STRUCT_BAZ_1:%.*]], %struct.baz.1* [[ARG:%.*]], i32 0, i32 3
-; SCCP-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[TMP]], align 8
+; SCCP-NEXT:    [[TMP:%.*]] = getelementptr inbounds [[STRUCT_BAZ_1:%.*]], ptr [[ARG:%.*]], i32 0, i32 3
+; SCCP-NEXT:    [[TMP2:%.*]] = load ptr, ptr [[TMP]], align 8
 ; SCCP-NEXT:    [[TMP3:%.*]] = sext i32 [[ARG1:%.*]] to i64
-; SCCP-NEXT:    [[TMP4:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
-; SCCP-NEXT:    ret i8* [[TMP4]]
+; SCCP-NEXT:    [[TMP4:%.*]] = getelementptr inbounds i8, ptr [[TMP2]], i64 [[TMP3]]
+; SCCP-NEXT:    ret ptr [[TMP4]]
 ;
 ; IPSCCP-LABEL: @spam(
 ; IPSCCP-NEXT:  bb:
-; IPSCCP-NEXT:    [[TMP:%.*]] = getelementptr inbounds [[STRUCT_BAZ_1:%.*]], %struct.baz.1* [[ARG:%.*]], i32 0, i32 3
-; IPSCCP-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[TMP]], align 8
+; IPSCCP-NEXT:    [[TMP:%.*]] = getelementptr inbounds [[STRUCT_BAZ_1:%.*]], ptr [[ARG:%.*]], i32 0, i32 3
+; IPSCCP-NEXT:    [[TMP2:%.*]] = load ptr, ptr [[TMP]], align 8
 ; IPSCCP-NEXT:    [[TMP3:%.*]] = sext i32 [[ARG1:%.*]] to i64
-; IPSCCP-NEXT:    [[TMP4:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
-; IPSCCP-NEXT:    ret i8* [[TMP4]]
+; IPSCCP-NEXT:    [[TMP4:%.*]] = getelementptr inbounds i8, ptr [[TMP2]], i64 [[TMP3]]
+; IPSCCP-NEXT:    ret ptr [[TMP4]]
 ;
 bb:
-  %tmp = getelementptr inbounds %struct.baz.1, %struct.baz.1* %arg, i32 0, i32 3
-  %tmp2 = load i8*, i8** %tmp, align 8
+  %tmp = getelementptr inbounds %struct.baz.1, ptr %arg, i32 0, i32 3
+  %tmp2 = load ptr, ptr %tmp, align 8
   %tmp3 = sext i32 %arg1 to i64
-  %tmp4 = getelementptr inbounds i8, i8* %tmp2, i64 %tmp3
-  ret i8* %tmp4
+  %tmp4 = getelementptr inbounds i8, ptr %tmp2, i64 %tmp3
+  ret ptr %tmp4
 }
 
-define i8* @wobble(%struct.blam.2* %arg, i32 %arg1) align 2 {
+define ptr @wobble(ptr %arg, i32 %arg1) align 2 {
 ; SCCP-LABEL: @wobble(
 ; SCCP-NEXT:  bb:
 ; SCCP-NEXT:    [[TMP:%.*]] = lshr i32 [[ARG1:%.*]], 16
 ; SCCP-NEXT:    [[TMP2:%.*]] = xor i32 [[TMP]], [[ARG1]]
 ; SCCP-NEXT:    [[TMP3:%.*]] = and i32 [[TMP2]], 65535
 ; SCCP-NEXT:    [[TMP4:%.*]] = mul i32 [[ARG1]], 8
-; SCCP-NEXT:    [[TMP5:%.*]] = getelementptr inbounds [[STRUCT_BLAM_2:%.*]], %struct.blam.2* [[ARG:%.*]], i32 0, i32 1
-; SCCP-NEXT:    [[TMP6:%.*]] = load i32, i32* [[TMP5]], align 8
+; SCCP-NEXT:    [[TMP5:%.*]] = getelementptr inbounds [[STRUCT_BLAM_2:%.*]], ptr [[ARG:%.*]], i32 0, i32 1
+; SCCP-NEXT:    [[TMP6:%.*]] = load i32, ptr [[TMP5]], align 8
 ; SCCP-NEXT:    [[TMP7:%.*]] = and i32 [[TMP4]], [[TMP6]]
 ; SCCP-NEXT:    br label [[BB8:%.*]]
 ; SCCP:       bb8:
-; SCCP-NEXT:    [[TMP9:%.*]] = phi i8* [ undef, [[BB:%.*]] ], [ [[TMP17:%.*]], [[BB29:%.*]] ]
-; SCCP-NEXT:    [[TMP10:%.*]] = phi i16* [ undef, [[BB]] ], [ [[TMP18:%.*]], [[BB29]] ]
+; SCCP-NEXT:    [[TMP9:%.*]] = phi ptr [ undef, [[BB:%.*]] ], [ [[TMP17:%.*]], [[BB29:%.*]] ]
+; SCCP-NEXT:    [[TMP10:%.*]] = phi ptr [ undef, [[BB]] ], [ [[TMP18:%.*]], [[BB29]] ]
 ; SCCP-NEXT:    [[TMP11:%.*]] = phi i32 [ 0, [[BB]] ], [ [[TMP30:%.*]], [[BB29]] ]
 ; SCCP-NEXT:    [[C_1:%.*]] = icmp slt i32 [[TMP11]], 8
 ; SCCP-NEXT:    br i1 [[C_1]], label [[BB13:%.*]], label [[BB31:%.*]]
 ; SCCP:       bb13:
-; SCCP-NEXT:    [[TMP14:%.*]] = getelementptr inbounds [[STRUCT_BLAM_2]], %struct.blam.2* [[ARG]], i32 0, i32 0
 ; SCCP-NEXT:    [[TMP15:%.*]] = add i32 [[TMP7]], [[TMP11]]
 ; SCCP-NEXT:    [[TMP16:%.*]] = mul i32 [[TMP15]], 4
-; SCCP-NEXT:    [[TMP17]] = call dereferenceable(1) i8* @spam(%struct.baz.1* [[TMP14]], i32 [[TMP16]])
-; SCCP-NEXT:    [[TMP18]] = bitcast i8* [[TMP17]] to i16*
-; SCCP-NEXT:    [[TMP19:%.*]] = getelementptr inbounds i8, i8* [[TMP17]], i64 2
-; SCCP-NEXT:    [[TMP20:%.*]] = load i8, i8* [[TMP19]], align 1
+; SCCP-NEXT:    [[TMP17]] = call dereferenceable(1) ptr @spam(ptr [[ARG]], i32 [[TMP16]])
+; SCCP-NEXT:    [[TMP19:%.*]] = getelementptr inbounds i8, ptr [[TMP17]], i64 2
+; SCCP-NEXT:    [[TMP20:%.*]] = load i8, ptr [[TMP19]], align 1
 ; SCCP-NEXT:    [[TMP21:%.*]] = zext i8 [[TMP20]] to i32
 ; SCCP-NEXT:    [[TMP22:%.*]] = icmp eq i32 [[TMP21]], 0
 ; SCCP-NEXT:    br i1 [[TMP22]], label [[BB23:%.*]], label [[BB25:%.*]]
 ; SCCP:       bb23:
 ; SCCP-NEXT:    [[TMP24:%.*]] = trunc i32 [[TMP3]] to i16
-; SCCP-NEXT:    store i16 [[TMP24]], i16* [[TMP18]], align 2
+; SCCP-NEXT:    store i16 [[TMP24]], ptr [[TMP17]], align 2
 ; SCCP-NEXT:    br label [[BB31]]
 ; SCCP:       bb25:
-; SCCP-NEXT:    [[TMP26:%.*]] = load i16, i16* [[TMP18]], align 2
+; SCCP-NEXT:    [[TMP26:%.*]] = load i16, ptr [[TMP17]], align 2
 ; SCCP-NEXT:    [[TMP27:%.*]] = zext i16 [[TMP26]] to i32
 ; SCCP-NEXT:    [[TMP28:%.*]] = icmp eq i32 [[TMP27]], [[TMP3]]
 ; SCCP-NEXT:    br i1 [[TMP28]], label [[BB31]], label [[BB29]]
@@ -632,12 +627,12 @@ define i8* @wobble(%struct.blam.2* %arg, i32 %arg1) align 2 {
 ; SCCP-NEXT:    [[TMP30]] = add nsw i32 [[TMP11]], 1
 ; SCCP-NEXT:    br label [[BB8]]
 ; SCCP:       bb31:
-; SCCP-NEXT:    [[TMP32:%.*]] = phi i8* [ [[TMP17]], [[BB23]] ], [ [[TMP17]], [[BB25]] ], [ [[TMP9]], [[BB8]] ]
-; SCCP-NEXT:    [[TMP33:%.*]] = phi i16* [ [[TMP18]], [[BB23]] ], [ [[TMP18]], [[BB25]] ], [ [[TMP10]], [[BB8]] ]
+; SCCP-NEXT:    [[TMP32:%.*]] = phi ptr [ [[TMP17]], [[BB23]] ], [ [[TMP17]], [[BB25]] ], [ [[TMP9]], [[BB8]] ]
+; SCCP-NEXT:    [[TMP33:%.*]] = phi ptr [ [[TMP17]], [[BB23]] ], [ [[TMP17]], [[BB25]] ], [ [[TMP10]], [[BB8]] ]
 ; SCCP-NEXT:    [[TMP34:%.*]] = icmp eq i32 [[TMP11]], 0
 ; SCCP-NEXT:    br i1 [[TMP34]], label [[BB35:%.*]], label [[BB37:%.*]]
 ; SCCP:       bb35:
-; SCCP-NEXT:    [[TMP36:%.*]] = getelementptr inbounds i8, i8* [[TMP32]], i64 1
+; SCCP-NEXT:    [[TMP36:%.*]] = getelementptr inbounds i8, ptr [[TMP32]], i64 1
 ; SCCP-NEXT:    br label [[BB66:%.*]]
 ; SCCP:       bb37:
 ; SCCP-NEXT:    [[C_2:%.*]] = icmp eq i32 [[TMP11]], 8
@@ -645,19 +640,18 @@ define i8* @wobble(%struct.blam.2* %arg, i32 %arg1) align 2 {
 ; SCCP:       bb39:
 ; SCCP-NEXT:    [[TMP40:%.*]] = add nsw i32 [[TMP11]], -1
 ; SCCP-NEXT:    [[TMP41:%.*]] = trunc i32 [[TMP3]] to i16
-; SCCP-NEXT:    store i16 [[TMP41]], i16* bitcast ([4 x i8]* @global.11 to i16*), align 1
-; SCCP-NEXT:    [[TMP42:%.*]] = getelementptr inbounds [[STRUCT_BLAM_2]], %struct.blam.2* [[ARG]], i32 0, i32 0
+; SCCP-NEXT:    store i16 [[TMP41]], ptr @global.11, align 1
 ; SCCP-NEXT:    [[TMP43:%.*]] = add i32 [[TMP7]], [[TMP40]]
 ; SCCP-NEXT:    [[TMP44:%.*]] = mul i32 [[TMP43]], 4
 ; SCCP-NEXT:    [[TMP45:%.*]] = add i32 [[TMP44]], 2
-; SCCP-NEXT:    [[TMP46:%.*]] = call dereferenceable(1) i8* @spam(%struct.baz.1* [[TMP42]], i32 [[TMP45]])
-; SCCP-NEXT:    [[TMP47:%.*]] = load i8, i8* [[TMP46]], align 1
+; SCCP-NEXT:    [[TMP46:%.*]] = call dereferenceable(1) ptr @spam(ptr [[ARG]], i32 [[TMP45]])
+; SCCP-NEXT:    [[TMP47:%.*]] = load i8, ptr [[TMP46]], align 1
 ; SCCP-NEXT:    [[TMP48:%.*]] = zext i8 [[TMP47]] to i32
 ; SCCP-NEXT:    [[TMP49:%.*]] = sub i32 [[TMP43]], 1
 ; SCCP-NEXT:    [[TMP50:%.*]] = mul i32 [[TMP49]], 4
 ; SCCP-NEXT:    [[TMP51:%.*]] = add i32 [[TMP50]], 2
-; SCCP-NEXT:    [[TMP52:%.*]] = call dereferenceable(1) i8* @spam(%struct.baz.1* [[TMP42]], i32 [[TMP51]])
-; SCCP-NEXT:    [[TMP53:%.*]] = load i8, i8* [[TMP52]], align 1
+; SCCP-NEXT:    [[TMP52:%.*]] = call dereferenceable(1) ptr @spam(ptr [[ARG]], i32 [[TMP51]])
+; SCCP-NEXT:    [[TMP53:%.*]] = load i8, ptr [[TMP52]], align 1
 ; SCCP-NEXT:    [[TMP54:%.*]] = zext i8 [[TMP53]] to i32
 ; SCCP-NEXT:    [[TMP55:%.*]] = icmp sgt i32 [[TMP48]], [[TMP54]]
 ; SCCP-NEXT:    br i1 [[TMP55]], label [[BB56:%.*]], label [[BB60:%.*]]
@@ -665,19 +659,17 @@ define i8* @wobble(%struct.blam.2* %arg, i32 %arg1) align 2 {
 ; SCCP-NEXT:    [[TMP57:%.*]] = add nsw i32 [[TMP40]], -1
 ; SCCP-NEXT:    br label [[BB60]]
 ; SCCP:       bb58:
-; SCCP-NEXT:    [[TMP59:%.*]] = bitcast i16* [[TMP33]] to i8*
-; SCCP-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @global.11, i64 0, i64 0), i8* align 2 [[TMP59]], i64 4, i1 false)
+; SCCP-NEXT:    call void @llvm.memcpy.p0.p0.i64(ptr align 1 @global.11, ptr align 2 [[TMP33]], i64 4, i1 false)
 ; SCCP-NEXT:    br label [[BB60]]
 ; SCCP:       bb60:
 ; SCCP-NEXT:    [[TMP61:%.*]] = phi i32 [ [[TMP57]], [[BB56]] ], [ [[TMP40]], [[BB39]] ], [ [[TMP11]], [[BB58]] ]
-; SCCP-NEXT:    [[TMP62:%.*]] = getelementptr inbounds [[STRUCT_BLAM_2]], %struct.blam.2* [[ARG]], i32 0, i32 0
 ; SCCP-NEXT:    [[TMP63:%.*]] = add i32 [[TMP7]], 1
 ; SCCP-NEXT:    [[TMP64:%.*]] = mul i32 [[TMP63]], 4
-; SCCP-NEXT:    [[TMP65:%.*]] = call dereferenceable(1) i8* @spam(%struct.baz.1* [[TMP62]], i32 [[TMP64]])
+; SCCP-NEXT:    [[TMP65:%.*]] = call dereferenceable(1) ptr @spam(ptr [[ARG]], i32 [[TMP64]])
 ; SCCP-NEXT:    br label [[BB66]]
 ; SCCP:       bb66:
-; SCCP-NEXT:    [[TMP67:%.*]] = phi i8* [ [[TMP36]], [[BB35]] ], [ null, [[BB60]] ]
-; SCCP-NEXT:    ret i8* [[TMP67]]
+; SCCP-NEXT:    [[TMP67:%.*]] = phi ptr [ [[TMP36]], [[BB35]] ], [ null, [[BB60]] ]
+; SCCP-NEXT:    ret ptr [[TMP67]]
 ;
 ; IPSCCP-LABEL: @wobble(
 ; IPSCCP-NEXT:  bb:
@@ -685,33 +677,31 @@ define i8* @wobble(%struct.blam.2* %arg, i32 %arg1) align 2 {
 ; IPSCCP-NEXT:    [[TMP2:%.*]] = xor i32 [[TMP]], [[ARG1]]
 ; IPSCCP-NEXT:    [[TMP3:%.*]] = and i32 [[TMP2]], 65535
 ; IPSCCP-NEXT:    [[TMP4:%.*]] = mul i32 [[ARG1]], 8
-; IPSCCP-NEXT:    [[TMP5:%.*]] = getelementptr inbounds [[STRUCT_BLAM_2:%.*]], %struct.blam.2* [[ARG:%.*]], i32 0, i32 1
-; IPSCCP-NEXT:    [[TMP6:%.*]] = load i32, i32* [[TMP5]], align 8
+; IPSCCP-NEXT:    [[TMP5:%.*]] = getelementptr inbounds [[STRUCT_BLAM_2:%.*]], ptr [[ARG:%.*]], i32 0, i32 1
+; IPSCCP-NEXT:    [[TMP6:%.*]] = load i32, ptr [[TMP5]], align 8
 ; IPSCCP-NEXT:    [[TMP7:%.*]] = and i32 [[TMP4]], [[TMP6]]
 ; IPSCCP-NEXT:    br label [[BB8:%.*]]
 ; IPSCCP:       bb8:
-; IPSCCP-NEXT:    [[TMP9:%.*]] = phi i8* [ undef, [[BB:%.*]] ], [ [[TMP17:%.*]], [[BB29:%.*]] ]
-; IPSCCP-NEXT:    [[TMP10:%.*]] = phi i16* [ undef, [[BB]] ], [ [[TMP18:%.*]], [[BB29]] ]
+; IPSCCP-NEXT:    [[TMP9:%.*]] = phi ptr [ undef, [[BB:%.*]] ], [ [[TMP17:%.*]], [[BB29:%.*]] ]
+; IPSCCP-NEXT:    [[TMP10:%.*]] = phi ptr [ undef, [[BB]] ], [ [[TMP18:%.*]], [[BB29]] ]
 ; IPSCCP-NEXT:    [[TMP11:%.*]] = phi i32 [ 0, [[BB]] ], [ [[TMP30:%.*]], [[BB29]] ]
 ; IPSCCP-NEXT:    [[C_1:%.*]] = icmp slt i32 [[TMP11]], 8
 ; IPSCCP-NEXT:    br i1 [[C_1]], label [[BB13:%.*]], label [[BB31:%.*]]
 ; IPSCCP:       bb13:
-; IPSCCP-NEXT:    [[TMP14:%.*]] = getelementptr inbounds [[STRUCT_BLAM_2]], %struct.blam.2* [[ARG]], i32 0, i32 0
 ; IPSCCP-NEXT:    [[TMP15:%.*]] = add i32 [[TMP7]], [[TMP11]]
 ; IPSCCP-NEXT:    [[TMP16:%.*]] = mul i32 [[TMP15]], 4
-; IPSCCP-NEXT:    [[TMP17]] = call dereferenceable(1) i8* @spam(%struct.baz.1* [[TMP14]], i32 [[TMP16]])
-; IPSCCP-NEXT:    [[TMP18]] = bitcast i8* [[TMP17]] to i16*
-; IPSCCP-NEXT:    [[TMP19:%.*]] = getelementptr inbounds i8, i8* [[TMP17]], i64 2
-; IPSCCP-NEXT:    [[TMP20:%.*]] = load i8, i8* [[TMP19]], align 1
+; IPSCCP-NEXT:    [[TMP17]] = call dereferenceable(1) ptr @spam(ptr [[ARG]], i32 [[TMP16]])
+; IPSCCP-NEXT:    [[TMP19:%.*]] = getelementptr inbounds i8, ptr [[TMP17]], i64 2
+; IPSCCP-NEXT:    [[TMP20:%.*]] = load i8, ptr [[TMP19]], align 1
 ; IPSCCP-NEXT:    [[TMP21:%.*]] = zext i8 [[TMP20]] to i32
 ; IPSCCP-NEXT:    [[TMP22:%.*]] = icmp eq i32 [[TMP21]], 0
 ; IPSCCP-NEXT:    br i1 [[TMP22]], label [[BB23:%.*]], label [[BB25:%.*]]
 ; IPSCCP:       bb23:
 ; IPSCCP-NEXT:    [[TMP24:%.*]] = trunc i32 [[TMP3]] to i16
-; IPSCCP-NEXT:    store i16 [[TMP24]], i16* [[TMP18]], align 2
+; IPSCCP-NEXT:    store i16 [[TMP24]], ptr [[TMP17]], align 2
 ; IPSCCP-NEXT:    br label [[BB31]]
 ; IPSCCP:       bb25:
-; IPSCCP-NEXT:    [[TMP26:%.*]] = load i16, i16* [[TMP18]], align 2
+; IPSCCP-NEXT:    [[TMP26:%.*]] = load i16, ptr [[TMP17]], align 2
 ; IPSCCP-NEXT:    [[TMP27:%.*]] = zext i16 [[TMP26]] to i32
 ; IPSCCP-NEXT:    [[TMP28:%.*]] = icmp eq i32 [[TMP27]], [[TMP3]]
 ; IPSCCP-NEXT:    br i1 [[TMP28]], label [[BB31]], label [[BB29]]
@@ -719,87 +709,82 @@ define i8* @wobble(%struct.blam.2* %arg, i32 %arg1) align 2 {
 ; IPSCCP-NEXT:    [[TMP30]] = add nsw i32 [[TMP11]], 1
 ; IPSCCP-NEXT:    br label [[BB8]]
 ; IPSCCP:       bb31:
-; IPSCCP-NEXT:    [[TMP32:%.*]] = phi i8* [ [[TMP17]], [[BB23]] ], [ [[TMP17]], [[BB25]] ], [ [[TMP9]], [[BB8]] ]
-; IPSCCP-NEXT:    [[TMP33:%.*]] = phi i16* [ [[TMP18]], [[BB23]] ], [ [[TMP18]], [[BB25]] ], [ [[TMP10]], [[BB8]] ]
+; IPSCCP-NEXT:    [[TMP32:%.*]] = phi ptr [ [[TMP17]], [[BB23]] ], [ [[TMP17]], [[BB25]] ], [ [[TMP9]], [[BB8]] ]
+; IPSCCP-NEXT:    [[TMP33:%.*]] = phi ptr [ [[TMP17]], [[BB23]] ], [ [[TMP17]], [[BB25]] ], [ [[TMP10]], [[BB8]] ]
 ; IPSCCP-NEXT:    [[TMP34:%.*]] = icmp eq i32 [[TMP11]], 0
 ; IPSCCP-NEXT:    br i1 [[TMP34]], label [[BB35:%.*]], label [[BB37:%.*]]
 ; IPSCCP:       bb35:
-; IPSCCP-NEXT:    [[TMP36:%.*]] = getelementptr inbounds i8, i8* [[TMP32]], i64 1
+; IPSCCP-NEXT:    [[TMP36:%.*]] = getelementptr inbounds i8, ptr [[TMP32]], i64 1
 ; IPSCCP-NEXT:    br label [[BB66:%.*]]
 ; IPSCCP:       bb37:
 ; IPSCCP-NEXT:    [[C_2:%.*]] = icmp eq i32 [[TMP11]], 8
 ; IPSCCP-NEXT:    br i1 [[C_2]], label [[BB39:%.*]], label [[BB58:%.*]]
 ; IPSCCP:       bb39:
 ; IPSCCP-NEXT:    [[TMP41:%.*]] = trunc i32 [[TMP3]] to i16
-; IPSCCP-NEXT:    store i16 [[TMP41]], i16* bitcast ([4 x i8]* @global.11 to i16*), align 1
-; IPSCCP-NEXT:    [[TMP42:%.*]] = getelementptr inbounds [[STRUCT_BLAM_2]], %struct.blam.2* [[ARG]], i32 0, i32 0
+; IPSCCP-NEXT:    store i16 [[TMP41]], ptr @global.11, align 1
 ; IPSCCP-NEXT:    [[TMP43:%.*]] = add i32 [[TMP7]], 7
 ; IPSCCP-NEXT:    [[TMP44:%.*]] = mul i32 [[TMP43]], 4
 ; IPSCCP-NEXT:    [[TMP45:%.*]] = add i32 [[TMP44]], 2
-; IPSCCP-NEXT:    [[TMP46:%.*]] = call dereferenceable(1) i8* @spam(%struct.baz.1* [[TMP42]], i32 [[TMP45]])
-; IPSCCP-NEXT:    [[TMP47:%.*]] = load i8, i8* [[TMP46]], align 1
+; IPSCCP-NEXT:    [[TMP46:%.*]] = call dereferenceable(1) ptr @spam(ptr [[ARG]], i32 [[TMP45]])
+; IPSCCP-NEXT:    [[TMP47:%.*]] = load i8, ptr [[TMP46]], align 1
 ; IPSCCP-NEXT:    [[TMP48:%.*]] = zext i8 [[TMP47]] to i32
 ; IPSCCP-NEXT:    [[TMP49:%.*]] = sub i32 [[TMP43]], 1
 ; IPSCCP-NEXT:    [[TMP50:%.*]] = mul i32 [[TMP49]], 4
 ; IPSCCP-NEXT:    [[TMP51:%.*]] = add i32 [[TMP50]], 2
-; IPSCCP-NEXT:    [[TMP52:%.*]] = call dereferenceable(1) i8* @spam(%struct.baz.1* [[TMP42]], i32 [[TMP51]])
-; IPSCCP-NEXT:    [[TMP53:%.*]] = load i8, i8* [[TMP52]], align 1
+; IPSCCP-NEXT:    [[TMP52:%.*]] = call dereferenceable(1) ptr @spam(ptr [[ARG]], i32 [[TMP51]])
+; IPSCCP-NEXT:    [[TMP53:%.*]] = load i8, ptr [[TMP52]], align 1
 ; IPSCCP-NEXT:    [[TMP54:%.*]] = zext i8 [[TMP53]] to i32
 ; IPSCCP-NEXT:    [[TMP55:%.*]] = icmp sgt i32 [[TMP48]], [[TMP54]]
 ; IPSCCP-NEXT:    br i1 [[TMP55]], label [[BB56:%.*]], label [[BB60:%.*]]
 ; IPSCCP:       bb56:
 ; IPSCCP-NEXT:    br label [[BB60]]
 ; IPSCCP:       bb58:
-; IPSCCP-NEXT:    [[TMP59:%.*]] = bitcast i16* [[TMP33]] to i8*
-; IPSCCP-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @global.11, i64 0, i64 0), i8* align 2 [[TMP59]], i64 4, i1 false)
+; IPSCCP-NEXT:    call void @llvm.memcpy.p0.p0.i64(ptr align 1 @global.11, ptr align 2 [[TMP33]], i64 4, i1 false)
 ; IPSCCP-NEXT:    br label [[BB60]]
 ; IPSCCP:       bb60:
 ; IPSCCP-NEXT:    [[TMP61:%.*]] = phi i32 [ 6, [[BB56]] ], [ 7, [[BB39]] ], [ [[TMP11]], [[BB58]] ]
-; IPSCCP-NEXT:    [[TMP62:%.*]] = getelementptr inbounds [[STRUCT_BLAM_2]], %struct.blam.2* [[ARG]], i32 0, i32 0
 ; IPSCCP-NEXT:    [[TMP63:%.*]] = add i32 [[TMP7]], 1
 ; IPSCCP-NEXT:    [[TMP64:%.*]] = mul i32 [[TMP63]], 4
-; IPSCCP-NEXT:    [[TMP65:%.*]] = call dereferenceable(1) i8* @spam(%struct.baz.1* [[TMP62]], i32 [[TMP64]])
+; IPSCCP-NEXT:    [[TMP65:%.*]] = call dereferenceable(1) ptr @spam(ptr [[ARG]], i32 [[TMP64]])
 ; IPSCCP-NEXT:    br label [[BB66]]
 ; IPSCCP:       bb66:
-; IPSCCP-NEXT:    [[TMP67:%.*]] = phi i8* [ [[TMP36]], [[BB35]] ], [ null, [[BB60]] ]
-; IPSCCP-NEXT:    ret i8* [[TMP67]]
+; IPSCCP-NEXT:    [[TMP67:%.*]] = phi ptr [ [[TMP36]], [[BB35]] ], [ null, [[BB60]] ]
+; IPSCCP-NEXT:    ret ptr [[TMP67]]
 ;
 bb:
   %tmp = lshr i32 %arg1, 16
   %tmp2 = xor i32 %tmp, %arg1
   %tmp3 = and i32 %tmp2, 65535
   %tmp4 = mul i32 %arg1, 8
-  %tmp5 = getelementptr inbounds %struct.blam.2, %struct.blam.2* %arg, i32 0, i32 1
-  %tmp6 = load i32, i32* %tmp5, align 8
+  %tmp5 = getelementptr inbounds %struct.blam.2, ptr %arg, i32 0, i32 1
+  %tmp6 = load i32, ptr %tmp5, align 8
   %tmp7 = and i32 %tmp4, %tmp6
   br label %bb8
 
 bb8:                                              ; preds = %bb29, %bb
-  %tmp9 = phi i8* [ undef, %bb ], [ %tmp17, %bb29 ]
-  %tmp10 = phi i16* [ undef, %bb ], [ %tmp18, %bb29 ]
+  %tmp9 = phi ptr [ undef, %bb ], [ %tmp17, %bb29 ]
+  %tmp10 = phi ptr [ undef, %bb ], [ %tmp17, %bb29 ]
   %tmp11 = phi i32 [ 0, %bb ], [ %tmp30, %bb29 ]
   %c.1 = icmp slt i32 %tmp11, 8
   br i1 %c.1, label %bb13, label %bb31
 
 bb13:                                             ; preds = %bb8
-  %tmp14 = getelementptr inbounds %struct.blam.2, %struct.blam.2* %arg, i32 0, i32 0
   %tmp15 = add i32 %tmp7, %tmp11
   %tmp16 = mul i32 %tmp15, 4
-  %tmp17 = call dereferenceable(1) i8* @spam(%struct.baz.1* %tmp14, i32 %tmp16)
-  %tmp18 = bitcast i8* %tmp17 to i16*
-  %tmp19 = getelementptr inbounds i8, i8* %tmp17, i64 2
-  %tmp20 = load i8, i8* %tmp19, align 1
+  %tmp17 = call dereferenceable(1) ptr @spam(ptr %arg, i32 %tmp16)
+  %tmp19 = getelementptr inbounds i8, ptr %tmp17, i64 2
+  %tmp20 = load i8, ptr %tmp19, align 1
   %tmp21 = zext i8 %tmp20 to i32
   %tmp22 = icmp eq i32 %tmp21, 0
   br i1 %tmp22, label %bb23, label %bb25
 
 bb23:                                             ; preds = %bb13
   %tmp24 = trunc i32 %tmp3 to i16
-  store i16 %tmp24, i16* %tmp18, align 2
+  store i16 %tmp24, ptr %tmp17, align 2
   br label %bb31
 
 bb25:                                             ; preds = %bb13
-  %tmp26 = load i16, i16* %tmp18, align 2
+  %tmp26 = load i16, ptr %tmp17, align 2
   %tmp27 = zext i16 %tmp26 to i32
   %tmp28 = icmp eq i32 %tmp27, %tmp3
   br i1 %tmp28, label %bb31, label %bb29
@@ -809,13 +794,13 @@ bb29:                                             ; preds = %bb25
   br label %bb8
 
 bb31:                                             ; preds = %bb25, %bb23, %bb8
-  %tmp32 = phi i8* [ %tmp17, %bb23 ], [ %tmp17, %bb25 ], [ %tmp9, %bb8 ]
-  %tmp33 = phi i16* [ %tmp18, %bb23 ], [ %tmp18, %bb25 ], [ %tmp10, %bb8 ]
+  %tmp32 = phi ptr [ %tmp17, %bb23 ], [ %tmp17, %bb25 ], [ %tmp9, %bb8 ]
+  %tmp33 = phi ptr [ %tmp17, %bb23 ], [ %tmp17, %bb25 ], [ %tmp10, %bb8 ]
   %tmp34 = icmp eq i32 %tmp11, 0
   br i1 %tmp34, label %bb35, label %bb37
 
 bb35:                                             ; preds = %bb31
-  %tmp36 = getelementptr inbounds i8, i8* %tmp32, i64 1
+  %tmp36 = getelementptr inbounds i8, ptr %tmp32, i64 1
   br label %bb66
 
 bb37:                                             ; preds = %bb31
@@ -825,19 +810,18 @@ bb37:                                             ; preds = %bb31
 bb39:                                             ; preds = %bb37
   %tmp40 = add nsw i32 %tmp11, -1
   %tmp41 = trunc i32 %tmp3 to i16
-  store i16 %tmp41, i16* bitcast ([4 x i8]* @global.11 to i16*), align 1
-  %tmp42 = getelementptr inbounds %struct.blam.2, %struct.blam.2* %arg, i32 0, i32 0
+  store i16 %tmp41, ptr @global.11, align 1
   %tmp43 = add i32 %tmp7, %tmp40
   %tmp44 = mul i32 %tmp43, 4
   %tmp45 = add i32 %tmp44, 2
-  %tmp46 = call dereferenceable(1) i8* @spam(%struct.baz.1* %tmp42, i32 %tmp45)
-  %tmp47 = load i8, i8* %tmp46, align 1
+  %tmp46 = call dereferenceable(1) ptr @spam(ptr %arg, i32 %tmp45)
+  %tmp47 = load i8, ptr %tmp46, align 1
   %tmp48 = zext i8 %tmp47 to i32
   %tmp49 = sub i32 %tmp43, 1
   %tmp50 = mul i32 %tmp49, 4
   %tmp51 = add i32 %tmp50, 2
-  %tmp52 = call dereferenceable(1) i8* @spam(%struct.baz.1* %tmp42, i32 %tmp51)
-  %tmp53 = load i8, i8* %tmp52, align 1
+  %tmp52 = call dereferenceable(1) ptr @spam(ptr %arg, i32 %tmp51)
+  %tmp53 = load i8, ptr %tmp52, align 1
   %tmp54 = zext i8 %tmp53 to i32
   %tmp55 = icmp sgt i32 %tmp48, %tmp54
   br i1 %tmp55, label %bb56, label %bb60
@@ -847,21 +831,19 @@ bb56:                                             ; preds = %bb39
   br label %bb60
 
 bb58:                                             ; preds = %bb37
-  %tmp59 = bitcast i16* %tmp33 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @global.11, i64 0, i64 0), i8* align 2 %tmp59, i64 4, i1 false)
+  call void @llvm.memcpy.p0.p0.i64(ptr align 1 @global.11, ptr align 2 %tmp33, i64 4, i1 false)
   br label %bb60
 
 bb60:                                             ; preds = %bb58, %bb56, %bb39
   %tmp61 = phi i32 [ %tmp57, %bb56 ], [ %tmp40, %bb39 ], [ %tmp11, %bb58 ]
-  %tmp62 = getelementptr inbounds %struct.blam.2, %struct.blam.2* %arg, i32 0, i32 0
   %tmp63 = add i32 %tmp7, 1
   %tmp64 = mul i32 %tmp63, 4
-  %tmp65 = call dereferenceable(1) i8* @spam(%struct.baz.1* %tmp62, i32 %tmp64)
+  %tmp65 = call dereferenceable(1) ptr @spam(ptr %arg, i32 %tmp64)
   br label %bb66
 
 bb66:                                             ; preds = %bb60, %bb35
-  %tmp67 = phi i8* [ %tmp36, %bb35 ], [ null, %bb60 ]
-  ret i8* %tmp67
+  %tmp67 = phi ptr [ %tmp36, %bb35 ], [ null, %bb60 ]
+  ret ptr %tmp67
 }
 
 


        


More information about the llvm-commits mailing list