[llvm] 864bb84 - [IndVarSimplify] Convert tests to opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 05:50:22 PST 2022


Author: Nikita Popov
Date: 2022-12-13T14:50:13+01:00
New Revision: 864bb84a427de367528d15270790dd152871daf2

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

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

This leaves lftr.ll alone, because there is a suspicious test diff.

Added: 
    

Modified: 
    llvm/test/Transforms/IndVarSimplify/2002-09-09-PointerIndVar.ll
    llvm/test/Transforms/IndVarSimplify/2003-04-16-ExprAnalysis.ll
    llvm/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll
    llvm/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll
    llvm/test/Transforms/IndVarSimplify/2005-02-11-InvokeCrash.ll
    llvm/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll
    llvm/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll
    llvm/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll
    llvm/test/Transforms/IndVarSimplify/2006-12-10-BitCast.ll
    llvm/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll
    llvm/test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll
    llvm/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll
    llvm/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll
    llvm/test/Transforms/IndVarSimplify/2009-05-24-useafterfree.ll
    llvm/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll
    llvm/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
    llvm/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll
    llvm/test/Transforms/IndVarSimplify/AMDGPU/no-widen-to-i64.ll
    llvm/test/Transforms/IndVarSimplify/D108043.ll
    llvm/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll
    llvm/test/Transforms/IndVarSimplify/X86/2009-04-14-shorten_iv_vars.ll
    llvm/test/Transforms/IndVarSimplify/X86/2009-04-15-shorten-iv-vars-2.ll
    llvm/test/Transforms/IndVarSimplify/X86/2011-11-15-multiexit.ll
    llvm/test/Transforms/IndVarSimplify/X86/deterministic-scev-verify.ll
    llvm/test/Transforms/IndVarSimplify/X86/eliminate-trunc.ll
    llvm/test/Transforms/IndVarSimplify/X86/huge_muls.ll
    llvm/test/Transforms/IndVarSimplify/X86/indvar-debug-value.ll
    llvm/test/Transforms/IndVarSimplify/X86/indvar-debug-value2.ll
    llvm/test/Transforms/IndVarSimplify/X86/inner-loop.ll
    llvm/test/Transforms/IndVarSimplify/X86/loop-invariant-conditions.ll
    llvm/test/Transforms/IndVarSimplify/X86/overflow-intrinsics.ll
    llvm/test/Transforms/IndVarSimplify/X86/polynomial-expand.ll
    llvm/test/Transforms/IndVarSimplify/X86/pr24356.ll
    llvm/test/Transforms/IndVarSimplify/X86/pr24804.ll
    llvm/test/Transforms/IndVarSimplify/X86/pr24956.ll
    llvm/test/Transforms/IndVarSimplify/X86/pr25051.ll
    llvm/test/Transforms/IndVarSimplify/X86/pr26973.ll
    llvm/test/Transforms/IndVarSimplify/X86/pr27133.ll
    llvm/test/Transforms/IndVarSimplify/X86/pr35406.ll
    llvm/test/Transforms/IndVarSimplify/X86/pr45360.ll
    llvm/test/Transforms/IndVarSimplify/X86/pr57187.ll
    llvm/test/Transforms/IndVarSimplify/X86/scev-phi-debug-info.ll
    llvm/test/Transforms/IndVarSimplify/X86/uglygep.ll
    llvm/test/Transforms/IndVarSimplify/X86/variable-stride-ivs-1.ll
    llvm/test/Transforms/IndVarSimplify/X86/verify-scev.ll
    llvm/test/Transforms/IndVarSimplify/X86/widen-nsw.ll
    llvm/test/Transforms/IndVarSimplify/ada-loops.ll
    llvm/test/Transforms/IndVarSimplify/addrec_no_exec_on_every_iteration.ll
    llvm/test/Transforms/IndVarSimplify/ashr-tripcount.ll
    llvm/test/Transforms/IndVarSimplify/avoid-i0.ll
    llvm/test/Transforms/IndVarSimplify/backedge-on-min-max.ll
    llvm/test/Transforms/IndVarSimplify/bbi-63564.ll
    llvm/test/Transforms/IndVarSimplify/bec-cmp.ll
    llvm/test/Transforms/IndVarSimplify/canonicalize-cmp.ll
    llvm/test/Transforms/IndVarSimplify/constant-fold.ll
    llvm/test/Transforms/IndVarSimplify/constant_result.ll
    llvm/test/Transforms/IndVarSimplify/crash.ll
    llvm/test/Transforms/IndVarSimplify/dangling-use.ll
    llvm/test/Transforms/IndVarSimplify/deterministic-sign.ll
    llvm/test/Transforms/IndVarSimplify/divide-pointer.ll
    llvm/test/Transforms/IndVarSimplify/dont-recompute.ll
    llvm/test/Transforms/IndVarSimplify/drop-exact.ll
    llvm/test/Transforms/IndVarSimplify/elim-extend.ll
    llvm/test/Transforms/IndVarSimplify/eliminate-backedge.ll
    llvm/test/Transforms/IndVarSimplify/eliminate-exit-no-dl.ll
    llvm/test/Transforms/IndVarSimplify/eliminate-max.ll
    llvm/test/Transforms/IndVarSimplify/eliminate-rem.ll
    llvm/test/Transforms/IndVarSimplify/eliminate-sat.ll
    llvm/test/Transforms/IndVarSimplify/exit_value_test3.ll
    llvm/test/Transforms/IndVarSimplify/finite-exit-comparisons.ll
    llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll
    llvm/test/Transforms/IndVarSimplify/full_widening.ll
    llvm/test/Transforms/IndVarSimplify/indirectbr.ll
    llvm/test/Transforms/IndVarSimplify/infer-poison-flags.ll
    llvm/test/Transforms/IndVarSimplify/interesting-invoke-use.ll
    llvm/test/Transforms/IndVarSimplify/iv-fold.ll
    llvm/test/Transforms/IndVarSimplify/iv-sext.ll
    llvm/test/Transforms/IndVarSimplify/iv-zext.ll
    llvm/test/Transforms/IndVarSimplify/lftr-dead-ivs.ll
    llvm/test/Transforms/IndVarSimplify/lftr-multi-exit.ll
    llvm/test/Transforms/IndVarSimplify/lftr-pr20680.ll
    llvm/test/Transforms/IndVarSimplify/lftr-pr41998.ll
    llvm/test/Transforms/IndVarSimplify/lftr-promote.ll
    llvm/test/Transforms/IndVarSimplify/lftr_disabled.ll
    llvm/test/Transforms/IndVarSimplify/loop_evaluate7.ll
    llvm/test/Transforms/IndVarSimplify/loop_evaluate8.ll
    llvm/test/Transforms/IndVarSimplify/loop_evaluate9.ll
    llvm/test/Transforms/IndVarSimplify/lrev-existing-umin.ll
    llvm/test/Transforms/IndVarSimplify/masked-iv.ll
    llvm/test/Transforms/IndVarSimplify/monotonic_checks.ll
    llvm/test/Transforms/IndVarSimplify/negative_ranges.ll
    llvm/test/Transforms/IndVarSimplify/outer_phi.ll
    llvm/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll
    llvm/test/Transforms/IndVarSimplify/post-inc-range.ll
    llvm/test/Transforms/IndVarSimplify/pr18223.ll
    llvm/test/Transforms/IndVarSimplify/pr22222.ll
    llvm/test/Transforms/IndVarSimplify/pr24952.ll
    llvm/test/Transforms/IndVarSimplify/pr26974.ll
    llvm/test/Transforms/IndVarSimplify/pr32045.ll
    llvm/test/Transforms/IndVarSimplify/pr55925.ll
    llvm/test/Transforms/IndVarSimplify/preserve-memoryssa.ll
    llvm/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll
    llvm/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
    llvm/test/Transforms/IndVarSimplify/replace-sdiv-by-udiv.ll
    llvm/test/Transforms/IndVarSimplify/replace-srem-by-urem.ll
    llvm/test/Transforms/IndVarSimplify/rewrite-loop-exit-value.ll
    llvm/test/Transforms/IndVarSimplify/rlev-add-me.ll
    llvm/test/Transforms/IndVarSimplify/scevexpander-phi-base-case.ll
    llvm/test/Transforms/IndVarSimplify/sentinel.ll
    llvm/test/Transforms/IndVarSimplify/shared-exit-between-nested-loop.ll
    llvm/test/Transforms/IndVarSimplify/sharpen-range.ll
    llvm/test/Transforms/IndVarSimplify/shift-range-checks.ll
    llvm/test/Transforms/IndVarSimplify/shrunk-constant.ll
    llvm/test/Transforms/IndVarSimplify/signed-trip-count.ll
    llvm/test/Transforms/IndVarSimplify/simplify-pointer-arithmetic.ll
    llvm/test/Transforms/IndVarSimplify/single-element-range.ll
    llvm/test/Transforms/IndVarSimplify/sink-alloca.ll
    llvm/test/Transforms/IndVarSimplify/strengthen-overflow.ll
    llvm/test/Transforms/IndVarSimplify/udiv-invariant-but-traps.ll
    llvm/test/Transforms/IndVarSimplify/udiv.ll
    llvm/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll
    llvm/test/Transforms/IndVarSimplify/use-range-metadata.ll
    llvm/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll
    llvm/test/Transforms/IndVarSimplify/zext-nuw.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/IndVarSimplify/2002-09-09-PointerIndVar.ll b/llvm/test/Transforms/IndVarSimplify/2002-09-09-PointerIndVar.ll
index 586ca944aa092..941be230a83b8 100644
--- a/llvm/test/Transforms/IndVarSimplify/2002-09-09-PointerIndVar.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2002-09-09-PointerIndVar.ll
@@ -3,15 +3,15 @@
 ;
 ; RUN: opt < %s -passes=indvars
 ;
-define void @test(i32 %A, i32 %S, i8* %S.upgrd.1) {
+define void @test(i32 %A, i32 %S, ptr %S.upgrd.1) {
 ; <label>:0
         br label %Loop
 
 Loop:           ; preds = %Loop, %0
-        %PIV = phi i8* [ %S.upgrd.1, %0 ], [ %PIVNext.upgrd.3, %Loop ]          ; <i8*> [#uses=1]
-        %PIV.upgrd.2 = ptrtoint i8* %PIV to i64         ; <i64> [#uses=1]
+        %PIV = phi ptr [ %S.upgrd.1, %0 ], [ %PIVNext.upgrd.3, %Loop ]          ; <ptr> [#uses=1]
+        %PIV.upgrd.2 = ptrtoint ptr %PIV to i64         ; <i64> [#uses=1]
         %PIVNext = add i64 %PIV.upgrd.2, 8              ; <i64> [#uses=1]
-        %PIVNext.upgrd.3 = inttoptr i64 %PIVNext to i8*         ; <i8*> [#uses=1]
+        %PIVNext.upgrd.3 = inttoptr i64 %PIVNext to ptr         ; <ptr> [#uses=1]
         br label %Loop
 }
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/2003-04-16-ExprAnalysis.ll b/llvm/test/Transforms/IndVarSimplify/2003-04-16-ExprAnalysis.ll
index 3265a2453cdda..74923152d9cb7 100644
--- a/llvm/test/Transforms/IndVarSimplify/2003-04-16-ExprAnalysis.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2003-04-16-ExprAnalysis.ll
@@ -3,7 +3,7 @@
 ;
 ; RUN: opt < %s -passes=indvars
 
- at X = global i32 7               ; <i32*> [#uses=1]
+ at X = global i32 7               ; <ptr> [#uses=1]
 
 define void @test(i32 %A) {
 ; <label>:0
@@ -11,7 +11,7 @@ define void @test(i32 %A) {
 
 Loop:           ; preds = %Loop, %0
         %IV = phi i32 [ %A, %0 ], [ %IVNext, %Loop ]            ; <i32> [#uses=1]
-        %IVNext = add i32 %IV, ptrtoint (i32* @X to i32)                ; <i32> [#uses=1]
+        %IVNext = add i32 %IV, ptrtoint (ptr @X to i32)                ; <i32> [#uses=1]
         br label %Loop
 }
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll b/llvm/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll
index 1fe1074bee358..efc86ab75e23d 100644
--- a/llvm/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll
@@ -12,7 +12,7 @@ Loop:           ; preds = %Loop, %0
 ; CHECK-NEXT: Canonical
         %NonIndvar = phi i32 [ 200, %0 ], [ %NonIndvarNext, %Loop ]             ; <i32> [#uses=1]
         %Canonical = phi i32 [ 0, %0 ], [ %CanonicalNext, %Loop ]               ; <i32> [#uses=2]
-        store i32 %Canonical, i32* null
+        store i32 %Canonical, ptr null
         %NonIndvarNext = sdiv i32 %NonIndvar, 2         ; <i32> [#uses=1]
         %CanonicalNext = add i32 %Canonical, 1          ; <i32> [#uses=1]
         br label %Loop

diff  --git a/llvm/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll b/llvm/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll
index 8d5862529e9c7..12d26edeb606c 100644
--- a/llvm/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll
@@ -1,77 +1,77 @@
 ; RUN: opt < %s -passes=indvars -disable-output
 ; ModuleID = '2004-04-05-InvokeCastCrash.ll'
 	%struct.__false_type = type { i8 }
-	%"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>" = type { %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>"*, %"struct.llvm::Constant"* }
-	%"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >" = type { %"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >"*, %"struct.std::pair<const llvm::Value* const,int>" }
+	%"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>" = type { ptr, ptr }
+	%"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >" = type { ptr, %"struct.std::pair<const llvm::Value* const,int>" }
 	%"struct.__gnu_cxx::hash_map<const llvm::Value*,int,__gnu_cxx::hash<const llvm::Value*>,std::equal_to<const llvm::Value*>,std::allocator<int> >" = type { %"struct.__gnu_cxx::hashtable<std::pair<const llvm::Value* const, int>,const llvm::Value*,__gnu_cxx::hash<const llvm::Value*>,std::_Select1st<std::pair<const llvm::Value* const, int> >,std::equal_to<const llvm::Value*>,std::allocator<int> >" }
 	%"struct.__gnu_cxx::hash_set<const llvm::Constant*,__gnu_cxx::hash<const llvm::Constant*>,std::equal_to<const llvm::Constant*>,std::allocator<const llvm::Constant*> >" = type { %"struct.__gnu_cxx::hashtable<const llvm::Constant*,const llvm::Constant*,__gnu_cxx::hash<const llvm::Constant*>,std::_Identity<const llvm::Constant*>,std::equal_to<const llvm::Constant*>,std::allocator<const llvm::Constant*> >" }
-	%"struct.__gnu_cxx::hashtable<const llvm::Constant*,const llvm::Constant*,__gnu_cxx::hash<const llvm::Constant*>,std::_Identity<const llvm::Constant*>,std::equal_to<const llvm::Constant*>,std::allocator<const llvm::Constant*> >" = type { %struct.__false_type, %struct.__false_type, %struct.__false_type, %struct.__false_type, %"struct.std::vector<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*> >", i32 }
+	%"struct.__gnu_cxx::hashtable<const llvm::Constant*,const llvm::Constant*,__gnu_cxx::hash<const llvm::Constant*>,std::_Identity<const llvm::Constant*>,std::equal_to<const llvm::Constant*>,std::allocator<const llvm::Constant*> >" = type { %struct.__false_type, %struct.__false_type, %struct.__false_type, %struct.__false_type, %"struct.std::vector<__gnu_cxx::_Hashtable_nodeptr,std::allocator<const llvm::Constant*> >", i32 }
 	%"struct.__gnu_cxx::hashtable<std::pair<const llvm::Value* const, int>,const llvm::Value*,__gnu_cxx::hash<const llvm::Value*>,std::_Select1st<std::pair<const llvm::Value* const, int> >,std::equal_to<const llvm::Value*>,std::allocator<int> >" = type { %struct.__false_type, %struct.__false_type, %struct.__false_type, %struct.__false_type, %"struct.std::vector<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int> >", i32 }
-	%"struct.llvm::AbstractTypeUser" = type { i32 (...)** }
-	%"struct.llvm::Annotable" = type { i32 (...)**, %"struct.llvm::Annotation"* }
-	%"struct.llvm::Annotation" = type { i32 (...)**, %"struct.llvm::AnnotationID", %"struct.llvm::Annotation"* }
+	%"struct.llvm::AbstractTypeUser" = type { ptr }
+	%"struct.llvm::Annotable" = type { ptr, ptr }
+	%"struct.llvm::Annotation" = type { ptr, %"struct.llvm::AnnotationID", ptr }
 	%"struct.llvm::AnnotationID" = type { i32 }
-	%"struct.llvm::Argument" = type { %"struct.llvm::Value", %"struct.llvm::Function"*, %"struct.llvm::Argument"*, %"struct.llvm::Argument"* }
-	%"struct.llvm::BasicBlock" = type { %"struct.llvm::Value", %"struct.llvm::iplist<llvm::Instruction,llvm::ilist_traits<llvm::Instruction> >", %"struct.llvm::BasicBlock"*, %"struct.llvm::BasicBlock"* }
+	%"struct.llvm::Argument" = type { %"struct.llvm::Value", ptr, ptr, ptr }
+	%"struct.llvm::BasicBlock" = type { %"struct.llvm::Value", %"struct.llvm::iplist<llvm::Instruction,llvm::ilist_traits<llvm::Instruction> >", ptr, ptr }
 	%"struct.llvm::Constant" = type opaque
 	%"struct.llvm::DerivedType" = type { %"struct.llvm::Type", %"struct.llvm::AbstractTypeUser", %"struct.std::vector<llvm::AbstractTypeUser*,std::allocator<llvm::AbstractTypeUser*> >" }
-	%"struct.llvm::Function" = type { %"struct.llvm::GlobalValue", %"struct.llvm::Annotable", %"struct.llvm::iplist<llvm::BasicBlock,llvm::ilist_traits<llvm::BasicBlock> >", %"struct.llvm::iplist<llvm::Argument,llvm::ilist_traits<llvm::Argument> >", %"struct.llvm::SymbolTable"*, %"struct.llvm::Function"*, %"struct.llvm::Function"* }
+	%"struct.llvm::Function" = type { %"struct.llvm::GlobalValue", %"struct.llvm::Annotable", %"struct.llvm::iplist<llvm::BasicBlock,llvm::ilist_traits<llvm::BasicBlock> >", %"struct.llvm::iplist<llvm::Argument,llvm::ilist_traits<llvm::Argument> >", ptr, ptr, ptr }
 	%"struct.llvm::FunctionPass" = type { %"struct.llvm::Pass" }
 	%"struct.llvm::FunctionType" = type { %"struct.llvm::DerivedType", i1 }
-	%"struct.llvm::GlobalValue" = type { %"struct.llvm::User", i32, %"struct.llvm::Module"* }
-	%"struct.llvm::Instruction" = type { %"struct.llvm::User", %"struct.llvm::Annotable", %"struct.llvm::BasicBlock"*, %"struct.llvm::Instruction"*, %"struct.llvm::Instruction"*, i32 }
+	%"struct.llvm::GlobalValue" = type { %"struct.llvm::User", i32, ptr }
+	%"struct.llvm::Instruction" = type { %"struct.llvm::User", %"struct.llvm::Annotable", ptr, ptr, ptr, i32 }
 	%"struct.llvm::IntrinsicLowering" = type opaque
-	%"struct.llvm::MachineBasicBlock" = type { %"struct.llvm::ilist<llvm::MachineInstr>", %"struct.llvm::MachineBasicBlock"*, %"struct.llvm::MachineBasicBlock"*, %"struct.llvm::BasicBlock"* }
+	%"struct.llvm::MachineBasicBlock" = type { %"struct.llvm::ilist<llvm::MachineInstr>", ptr, ptr, ptr }
 	%"struct.llvm::MachineConstantPool" = type opaque
 	%"struct.llvm::MachineFrameInfo" = type opaque
-	%"struct.llvm::MachineFunction" = type { %"struct.llvm::Annotation", %"struct.llvm::Function"*, %"struct.llvm::TargetMachine"*, %"struct.llvm::iplist<llvm::MachineBasicBlock,llvm::ilist_traits<llvm::MachineBasicBlock> >", %"struct.llvm::SSARegMap"*, %"struct.llvm::MachineFunctionInfo"*, %"struct.llvm::MachineFrameInfo"*, %"struct.llvm::MachineConstantPool"* }
-	%"struct.llvm::MachineFunctionInfo" = type { %"struct.__gnu_cxx::hash_set<const llvm::Constant*,__gnu_cxx::hash<const llvm::Constant*>,std::equal_to<const llvm::Constant*>,std::allocator<const llvm::Constant*> >", %"struct.__gnu_cxx::hash_map<const llvm::Value*,int,__gnu_cxx::hash<const llvm::Value*>,std::equal_to<const llvm::Value*>,std::allocator<int> >", i32, i32, i32, i32, i32, i32, i32, i1, i1, i1, %"struct.llvm::MachineFunction"* }
+	%"struct.llvm::MachineFunction" = type { %"struct.llvm::Annotation", ptr, ptr, %"struct.llvm::iplist<llvm::MachineBasicBlock,llvm::ilist_traits<llvm::MachineBasicBlock> >", ptr, ptr, ptr, ptr }
+	%"struct.llvm::MachineFunctionInfo" = type { %"struct.__gnu_cxx::hash_set<const llvm::Constant*,__gnu_cxx::hash<const llvm::Constant*>,std::equal_to<const llvm::Constant*>,std::allocator<const llvm::Constant*> >", %"struct.__gnu_cxx::hash_map<const llvm::Value*,int,__gnu_cxx::hash<const llvm::Value*>,std::equal_to<const llvm::Value*>,std::allocator<int> >", i32, i32, i32, i32, i32, i32, i32, i1, i1, i1, ptr }
 	%"struct.llvm::MachineFunctionPass" = type { %"struct.llvm::FunctionPass" }
-	%"struct.llvm::MachineInstr" = type { i16, i8, %"struct.std::vector<llvm::MachineOperand,std::allocator<llvm::MachineOperand> >", %"struct.llvm::MachineInstr"*, %"struct.llvm::MachineInstr"*, %"struct.llvm::MachineBasicBlock"* }
-	%"struct.llvm::MachineInstrBuilder" = type { %"struct.llvm::MachineInstr"* }
+	%"struct.llvm::MachineInstr" = type { i16, i8, %"struct.std::vector<llvm::MachineOperand,std::allocator<llvm::MachineOperand> >", ptr, ptr, ptr }
+	%"struct.llvm::MachineInstrBuilder" = type { ptr }
 	%"struct.llvm::MachineOperand" = type { %"union.llvm::MachineOperand::._65", i32, i32 }
 	%"struct.llvm::Module" = type opaque
-	%"struct.llvm::PATypeHandle" = type { %"struct.llvm::Type"*, %"struct.llvm::AbstractTypeUser"* }
-	%"struct.llvm::PATypeHolder" = type { %"struct.llvm::Type"* }
-	%"struct.llvm::Pass" = type { i32 (...)**, %"struct.llvm::AbstractTypeUser"*, %"struct.llvm::PassInfo"*, %"struct.std::vector<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> > >" }
-	%"struct.llvm::PassInfo" = type { i8*, i8*, %"struct.std::type_info"*, i8, %"struct.std::vector<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*> >", %"struct.llvm::Pass"* ()*, %"struct.llvm::Pass"* (%"struct.llvm::TargetMachine"*)* }
+	%"struct.llvm::PATypeHandle" = type { ptr, ptr }
+	%"struct.llvm::PATypeHolder" = type { ptr }
+	%"struct.llvm::Pass" = type { ptr, ptr, ptr, %"struct.std::vector<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> > >" }
+	%"struct.llvm::PassInfo" = type { ptr, ptr, ptr, i8, %"struct.std::vector<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*> >", ptr, ptr }
 	%"struct.llvm::SSARegMap" = type opaque
 	%"struct.llvm::SymbolTable" = type opaque
-	%"struct.llvm::SymbolTableListTraits<llvm::Argument,llvm::Function,llvm::Function,llvm::ilist_traits<llvm::Argument> >" = type { %"struct.llvm::Function"*, %"struct.llvm::Function"* }
-	%"struct.llvm::SymbolTableListTraits<llvm::Instruction,llvm::BasicBlock,llvm::Function,llvm::ilist_traits<llvm::Instruction> >" = type { %"struct.llvm::Function"*, %"struct.llvm::BasicBlock"* }
+	%"struct.llvm::SymbolTableListTraits<llvm::Argument,llvm::Function,llvm::Function,llvm::ilist_traits<llvm::Argument> >" = type { ptr, ptr }
+	%"struct.llvm::SymbolTableListTraits<llvm::Instruction,llvm::BasicBlock,llvm::Function,llvm::ilist_traits<llvm::Instruction> >" = type { ptr, ptr }
 	%"struct.llvm::DataLayout" = type { %"struct.llvm::FunctionPass", i1, i8, i8, i8, i8, i8, i8, i8, i8 }
-	%"struct.llvm::TargetFrameInfo" = type { i32 (...)**, i32, i32, i32 }
-	%"struct.llvm::TargetInstrDescriptor" = type { i8*, i32, i32, i32, i1, i32, i32, i32, i32, i32, i32*, i32* }
-	%"struct.llvm::TargetInstrInfo" = type { i32 (...)**, %"struct.llvm::TargetInstrDescriptor"*, i32, i32 }
-	%"struct.llvm::TargetMachine" = type { i32 (...)**, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >", %"struct.llvm::DataLayout", %"struct.llvm::IntrinsicLowering"* }
-	%"struct.llvm::TargetRegClassInfo" = type { i32 (...)**, i32, i32, i32 }
-	%"struct.llvm::TargetRegInfo" = type { i32 (...)**, %"struct.std::vector<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*> >", %"struct.llvm::TargetMachine"* }
-	%"struct.llvm::Type" = type { %"struct.llvm::Value", i32, i32, i1, i32, %"struct.llvm::Type"*, %"struct.std::vector<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle> >" }
-	%"struct.llvm::Use" = type { %"struct.llvm::Value"*, %"struct.llvm::User"*, %"struct.llvm::Use"*, %"struct.llvm::Use"* }
+	%"struct.llvm::TargetFrameInfo" = type { ptr, i32, i32, i32 }
+	%"struct.llvm::TargetInstrDescriptor" = type { ptr, i32, i32, i32, i1, i32, i32, i32, i32, i32, ptr, ptr }
+	%"struct.llvm::TargetInstrInfo" = type { ptr, ptr, i32, i32 }
+	%"struct.llvm::TargetMachine" = type { ptr, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >", %"struct.llvm::DataLayout", ptr }
+	%"struct.llvm::TargetRegClassInfo" = type { ptr, i32, i32, i32 }
+	%"struct.llvm::TargetRegInfo" = type { ptr, %"struct.std::vector<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*> >", ptr }
+	%"struct.llvm::Type" = type { %"struct.llvm::Value", i32, i32, i1, i32, ptr, %"struct.std::vector<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle> >" }
+	%"struct.llvm::Use" = type { ptr, ptr, ptr, ptr }
 	%"struct.llvm::User" = type { %"struct.llvm::Value", %"struct.std::vector<llvm::Use,std::allocator<llvm::Use> >" }
-	%"struct.llvm::Value" = type { i32 (...)**, %"struct.llvm::iplist<llvm::Use,llvm::ilist_traits<llvm::Use> >", %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >", %"struct.llvm::PATypeHolder", i32 }
+	%"struct.llvm::Value" = type { ptr, %"struct.llvm::iplist<llvm::Use,llvm::ilist_traits<llvm::Use> >", %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >", %"struct.llvm::PATypeHolder", i32 }
 	%"struct.llvm::_GLOBAL__N_::InsertPrologEpilogCode" = type { %"struct.llvm::MachineFunctionPass" }
 	%"struct.llvm::ilist<llvm::MachineInstr>" = type { %"struct.llvm::iplist<llvm::MachineInstr,llvm::ilist_traits<llvm::MachineInstr> >" }
-	%"struct.llvm::ilist_iterator<const llvm::MachineBasicBlock>" = type { %"struct.llvm::MachineBasicBlock"* }
+	%"struct.llvm::ilist_iterator<const llvm::MachineBasicBlock>" = type { ptr }
 	%"struct.llvm::ilist_traits<llvm::Argument>" = type { %"struct.llvm::SymbolTableListTraits<llvm::Argument,llvm::Function,llvm::Function,llvm::ilist_traits<llvm::Argument> >" }
 	%"struct.llvm::ilist_traits<llvm::Instruction>" = type { %"struct.llvm::SymbolTableListTraits<llvm::Instruction,llvm::BasicBlock,llvm::Function,llvm::ilist_traits<llvm::Instruction> >" }
-	%"struct.llvm::iplist<llvm::Argument,llvm::ilist_traits<llvm::Argument> >" = type { %"struct.llvm::ilist_traits<llvm::Argument>", %"struct.llvm::Argument"*, %"struct.llvm::Argument"* }
-	%"struct.llvm::iplist<llvm::BasicBlock,llvm::ilist_traits<llvm::BasicBlock> >" = type { %"struct.llvm::ilist_traits<llvm::Argument>", %"struct.llvm::BasicBlock"*, %"struct.llvm::BasicBlock"* }
-	%"struct.llvm::iplist<llvm::Instruction,llvm::ilist_traits<llvm::Instruction> >" = type { %"struct.llvm::ilist_traits<llvm::Instruction>", %"struct.llvm::Instruction"*, %"struct.llvm::Instruction"* }
-	%"struct.llvm::iplist<llvm::MachineBasicBlock,llvm::ilist_traits<llvm::MachineBasicBlock> >" = type { %"struct.llvm::MachineBasicBlock"*, %"struct.llvm::MachineBasicBlock"* }
-	%"struct.llvm::iplist<llvm::MachineInstr,llvm::ilist_traits<llvm::MachineInstr> >" = type { %"struct.llvm::ilist_iterator<const llvm::MachineBasicBlock>", %"struct.llvm::MachineInstr"*, %"struct.llvm::MachineInstr"* }
-	%"struct.llvm::iplist<llvm::Use,llvm::ilist_traits<llvm::Use> >" = type { %"struct.llvm::Use"*, %"struct.llvm::Use"* }
-	%"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*>, true>" = type { %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>"**, %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>"**, %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>"** }
-	%"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int>, true>" = type { %"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >"**, %"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >"**, %"struct.__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >"** }
-	%"struct.std::_Vector_alloc_base<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*>, true>" = type { %"struct.llvm::PassInfo"**, %"struct.llvm::PassInfo"**, %"struct.llvm::PassInfo"** }
-	%"struct.std::_Vector_alloc_base<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*>, true>" = type { %"struct.llvm::TargetFrameInfo"**, %"struct.llvm::TargetFrameInfo"**, %"struct.llvm::TargetFrameInfo"** }
-	%"struct.std::_Vector_alloc_base<llvm::AbstractTypeUser*,std::allocator<llvm::AbstractTypeUser*>, true>" = type { %"struct.llvm::AbstractTypeUser"**, %"struct.llvm::AbstractTypeUser"**, %"struct.llvm::AbstractTypeUser"** }
-	%"struct.std::_Vector_alloc_base<llvm::MachineInstr*,std::allocator<llvm::MachineInstr*>, true>" = type { %"struct.llvm::MachineInstr"**, %"struct.llvm::MachineInstr"**, %"struct.llvm::MachineInstr"** }
-	%"struct.std::_Vector_alloc_base<llvm::MachineOperand,std::allocator<llvm::MachineOperand>, true>" = type { %"struct.llvm::MachineOperand"*, %"struct.llvm::MachineOperand"*, %"struct.llvm::MachineOperand"* }
-	%"struct.std::_Vector_alloc_base<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle>, true>" = type { %"struct.llvm::PATypeHandle"*, %"struct.llvm::PATypeHandle"*, %"struct.llvm::PATypeHandle"* }
-	%"struct.std::_Vector_alloc_base<llvm::Use,std::allocator<llvm::Use>, true>" = type { %"struct.llvm::Use"*, %"struct.llvm::Use"*, %"struct.llvm::Use"* }
-	%"struct.std::_Vector_alloc_base<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> >, true>" = type { %"struct.std::pair<const llvm::PassInfo*,llvm::Pass*>"*, %"struct.std::pair<const llvm::PassInfo*,llvm::Pass*>"*, %"struct.std::pair<const llvm::PassInfo*,llvm::Pass*>"* }
-	%"struct.std::_Vector_base<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*> >" = type { %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*>, true>" }
+	%"struct.llvm::iplist<llvm::Argument,llvm::ilist_traits<llvm::Argument> >" = type { %"struct.llvm::ilist_traits<llvm::Argument>", ptr, ptr }
+	%"struct.llvm::iplist<llvm::BasicBlock,llvm::ilist_traits<llvm::BasicBlock> >" = type { %"struct.llvm::ilist_traits<llvm::Argument>", ptr, ptr }
+	%"struct.llvm::iplist<llvm::Instruction,llvm::ilist_traits<llvm::Instruction> >" = type { %"struct.llvm::ilist_traits<llvm::Instruction>", ptr, ptr }
+	%"struct.llvm::iplist<llvm::MachineBasicBlock,llvm::ilist_traits<llvm::MachineBasicBlock> >" = type { ptr, ptr }
+	%"struct.llvm::iplist<llvm::MachineInstr,llvm::ilist_traits<llvm::MachineInstr> >" = type { %"struct.llvm::ilist_iterator<const llvm::MachineBasicBlock>", ptr, ptr }
+	%"struct.llvm::iplist<llvm::Use,llvm::ilist_traits<llvm::Use> >" = type { ptr, ptr }
+	%"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_nodeptr,std::allocator<const llvm::Constant*>, true>" = type { ptr, ptr, ptr }
+	%"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int>, true>" = type { ptr, ptr, ptr }
+	%"struct.std::_Vector_alloc_base<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*>, true>" = type { ptr, ptr, ptr }
+	%"struct.std::_Vector_alloc_base<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*>, true>" = type { ptr, ptr, ptr }
+	%"struct.std::_Vector_alloc_base<llvm::AbstractTypeUser*,std::allocator<llvm::AbstractTypeUser*>, true>" = type { ptr, ptr, ptr }
+	%"struct.std::_Vector_alloc_base<llvm::MachineInstr*,std::allocator<llvm::MachineInstr*>, true>" = type { ptr, ptr, ptr }
+	%"struct.std::_Vector_alloc_base<llvm::MachineOperand,std::allocator<llvm::MachineOperand>, true>" = type { ptr, ptr, ptr }
+	%"struct.std::_Vector_alloc_base<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle>, true>" = type { ptr, ptr, ptr }
+	%"struct.std::_Vector_alloc_base<llvm::Use,std::allocator<llvm::Use>, true>" = type { ptr, ptr, ptr }
+	%"struct.std::_Vector_alloc_base<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> >, true>" = type { ptr, ptr, ptr }
+	%"struct.std::_Vector_base<__gnu_cxx::_Hashtable_nodeptr,std::allocator<const llvm::Constant*> >" = type { %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_nodeptr,std::allocator<const llvm::Constant*>, true>" }
 	%"struct.std::_Vector_base<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int> >" = type { %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int>, true>" }
 	%"struct.std::_Vector_base<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*> >" = type { %"struct.std::_Vector_alloc_base<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*>, true>" }
 	%"struct.std::_Vector_base<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*> >" = type { %"struct.std::_Vector_alloc_base<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*>, true>" }
@@ -82,11 +82,11 @@
 	%"struct.std::_Vector_base<llvm::Use,std::allocator<llvm::Use> >" = type { %"struct.std::_Vector_alloc_base<llvm::Use,std::allocator<llvm::Use>, true>" }
 	%"struct.std::_Vector_base<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> > >" = type { %"struct.std::_Vector_alloc_base<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> >, true>" }
 	%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" }
-	%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" = type { i8* }
-	%"struct.std::pair<const llvm::PassInfo*,llvm::Pass*>" = type { %"struct.llvm::PassInfo"*, %"struct.llvm::Pass"* }
-	%"struct.std::pair<const llvm::Value* const,int>" = type { %"struct.llvm::Value"*, i32 }
-	%"struct.std::type_info" = type { i32 (...)**, i8* }
-	%"struct.std::vector<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*> >" = type { %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_node<const llvm::Constant*>*,std::allocator<const llvm::Constant*> >" }
+	%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" = type { ptr }
+	%"struct.std::pair<const llvm::PassInfo*,llvm::Pass*>" = type { ptr, ptr }
+	%"struct.std::pair<const llvm::Value* const,int>" = type { ptr, i32 }
+	%"struct.std::type_info" = type { ptr, ptr }
+	%"struct.std::vector<__gnu_cxx::_Hashtable_nodeptr,std::allocator<const llvm::Constant*> >" = type { %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_nodeptr,std::allocator<const llvm::Constant*> >" }
 	%"struct.std::vector<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int> >" = type { %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_node<std::pair<const llvm::Value* const, int> >*,std::allocator<int> >" }
 	%"struct.std::vector<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*> >" = type { %"struct.std::_Vector_base<const llvm::PassInfo*,std::allocator<const llvm::PassInfo*> >" }
 	%"struct.std::vector<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*> >" = type { %"struct.std::_Vector_base<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*> >" }
@@ -96,7 +96,7 @@
 	%"struct.std::vector<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle> >" = type { %"struct.std::_Vector_base<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle> >" }
 	%"struct.std::vector<llvm::Use,std::allocator<llvm::Use> >" = type { %"struct.std::_Vector_base<llvm::Use,std::allocator<llvm::Use> >" }
 	%"struct.std::vector<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> > >" = type { %"struct.std::_Vector_base<std::pair<const llvm::PassInfo*, llvm::Pass*>,std::allocator<std::pair<const llvm::PassInfo*, llvm::Pass*> > >" }
-	%"union.llvm::MachineOperand::._65" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* }
+	%"union.llvm::MachineOperand::._65" = type { ptr }
 
 declare void @_Znwj()
 
@@ -112,26 +112,26 @@ declare void @_ZNK4llvm19MachineInstrBuilder7addSImmEi()
 
 declare i32 @__gxx_personality_v0(...)
 
-define void @_ZN4llvm11_GLOBAL__N_22InsertPrologEpilogCode20runOnMachineFunctionERNS_15MachineFunctionE(%"struct.llvm::MachineFunction"* %F) personality i32 (...)* @__gxx_personality_v0 {
+define void @_ZN4llvm11_GLOBAL__N_22InsertPrologEpilogCode20runOnMachineFunctionERNS_15MachineFunctionE(ptr %F) personality ptr @__gxx_personality_v0 {
 entry:
-	%tmp.8.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
-			to label %invoke_cont.0.i unwind label %invoke_catch.0.i		; <%"struct.llvm::TargetFrameInfo"*> [#uses=0]
+	%tmp.8.i = invoke ptr null( ptr null )
+			to label %invoke_cont.0.i unwind label %invoke_catch.0.i		; <ptr> [#uses=0]
 
 invoke_catch.0.i:		; preds = %invoke_cont.49.i, %invoke_cont.48.i, %invoke_cont.47.i, %invoke_cont.i53.i, %no_exit.i, %invoke_cont.44.i, %invoke_cont.43.i, %invoke_cont.42.i, %invoke_cont.41.i, %invoke_cont.40.i, %invoke_cont.39.i, %invoke_cont.38.i, %invoke_cont.37.i, %then.2.i, %invoke_cont.35.i, %invoke_cont.34.i, %then.1.i, %endif.0.i, %invoke_cont.9.i, %invoke_cont.8.i, %invoke_cont.7.i, %invoke_cont.i.i, %then.0.i, %invoke_cont.4.i, %invoke_cont.3.i, %invoke_cont.2.i, %invoke_cont.1.i, %endif.0.i.i, %tmp.7.i.noexc.i, %invoke_cont.0.i, %entry
-        %exn0.i = landingpad {i8*, i32}
+        %exn0.i = landingpad {ptr, i32}
                  cleanup
 	ret void
 
 invoke_cont.0.i:		; preds = %entry
-	%tmp.7.i1.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
-			to label %tmp.7.i.noexc.i unwind label %invoke_catch.0.i		; <%"struct.llvm::TargetFrameInfo"*> [#uses=2]
+	%tmp.7.i1.i = invoke ptr null( ptr null )
+			to label %tmp.7.i.noexc.i unwind label %invoke_catch.0.i		; <ptr> [#uses=2]
 
 tmp.7.i.noexc.i:		; preds = %invoke_cont.0.i
-	%tmp.17.i2.i = invoke i32 null( %"struct.llvm::TargetFrameInfo"* %tmp.7.i1.i )
+	%tmp.17.i2.i = invoke i32 null( ptr %tmp.7.i1.i )
 			to label %endif.0.i.i unwind label %invoke_catch.0.i		; <i32> [#uses=0]
 
 endif.0.i.i:		; preds = %tmp.7.i.noexc.i
-	%tmp.38.i4.i = invoke i32 null( %"struct.llvm::TargetFrameInfo"* %tmp.7.i1.i )
+	%tmp.38.i4.i = invoke i32 null( ptr %tmp.7.i1.i )
 			to label %tmp.38.i.noexc.i unwind label %invoke_catch.0.i		; <i32> [#uses=0]
 
 tmp.38.i.noexc.i:		; preds = %endif.0.i.i
@@ -141,19 +141,19 @@ then.1.i.i:		; preds = %tmp.38.i.noexc.i
 	ret void
 
 invoke_cont.1.i:		; preds = %tmp.38.i.noexc.i
-	%tmp.21.i = invoke %"struct.llvm::TargetRegInfo"* null( %"struct.llvm::TargetMachine"* null )
-			to label %invoke_cont.2.i unwind label %invoke_catch.0.i		; <%"struct.llvm::TargetRegInfo"*> [#uses=1]
+	%tmp.21.i = invoke ptr null( ptr null )
+			to label %invoke_cont.2.i unwind label %invoke_catch.0.i		; <ptr> [#uses=1]
 
 invoke_cont.2.i:		; preds = %invoke_cont.1.i
-	%tmp.28.i = invoke i32 null( %"struct.llvm::TargetRegInfo"* %tmp.21.i )
+	%tmp.28.i = invoke i32 null( ptr %tmp.21.i )
 			to label %invoke_cont.3.i unwind label %invoke_catch.0.i		; <i32> [#uses=0]
 
 invoke_cont.3.i:		; preds = %invoke_cont.2.i
-	%tmp.36.i = invoke %"struct.llvm::TargetInstrInfo"* null( %"struct.llvm::TargetMachine"* null )
-			to label %invoke_cont.4.i unwind label %invoke_catch.0.i		; <%"struct.llvm::TargetInstrInfo"*> [#uses=1]
+	%tmp.36.i = invoke ptr null( ptr null )
+			to label %invoke_cont.4.i unwind label %invoke_catch.0.i		; <ptr> [#uses=1]
 
 invoke_cont.4.i:		; preds = %invoke_cont.3.i
-	%tmp.43.i = invoke i1 null( %"struct.llvm::TargetInstrInfo"* %tmp.36.i, i16 383, i64 0 )
+	%tmp.43.i = invoke i1 null( ptr %tmp.36.i, i16 383, i64 0 )
 			to label %invoke_cont.5.i unwind label %invoke_catch.0.i		; <i1> [#uses=1]
 
 invoke_cont.5.i:		; preds = %invoke_cont.4.i
@@ -168,7 +168,7 @@ tmp.0.i.noexc.i:		; preds = %then.0.i
 			to label %invoke_cont.i.i unwind label %cond_true.i.i
 
 cond_true.i.i:		; preds = %tmp.0.i.noexc.i
-        %exn.i.i = landingpad {i8*, i32}
+        %exn.i.i = landingpad {ptr, i32}
                  cleanup
 	ret void
 
@@ -203,50 +203,50 @@ then.1.i:		; preds = %invoke_cont.33.i
 			to label %invoke_cont.34.i unwind label %invoke_catch.0.i
 
 invoke_cont.34.i:		; preds = %then.1.i
-	%tmp.121.i = invoke %"struct.llvm::TargetRegInfo"* null( %"struct.llvm::TargetMachine"* null )
-			to label %invoke_cont.35.i unwind label %invoke_catch.0.i		; <%"struct.llvm::TargetRegInfo"*> [#uses=1]
+	%tmp.121.i = invoke ptr null( ptr null )
+			to label %invoke_cont.35.i unwind label %invoke_catch.0.i		; <ptr> [#uses=1]
 
 invoke_cont.35.i:		; preds = %invoke_cont.34.i
-	%tmp.128.i = invoke i32 null( %"struct.llvm::TargetRegInfo"* %tmp.121.i )
+	%tmp.128.i = invoke i32 null( ptr %tmp.121.i )
 			to label %invoke_cont.36.i unwind label %invoke_catch.0.i		; <i32> [#uses=0]
 
 invoke_cont.36.i:		; preds = %invoke_cont.35.i
 	br i1 false, label %then.2.i, label %endif.1.i
 
 then.2.i:		; preds = %invoke_cont.36.i
-	%tmp.140.i = invoke %"struct.llvm::TargetRegInfo"* null( %"struct.llvm::TargetMachine"* null )
-			to label %invoke_cont.37.i unwind label %invoke_catch.0.i		; <%"struct.llvm::TargetRegInfo"*> [#uses=0]
+	%tmp.140.i = invoke ptr null( ptr null )
+			to label %invoke_cont.37.i unwind label %invoke_catch.0.i		; <ptr> [#uses=0]
 
 invoke_cont.37.i:		; preds = %then.2.i
-	%tmp.148.i = invoke %"struct.llvm::TargetRegInfo"* null( %"struct.llvm::TargetMachine"* null )
-			to label %invoke_cont.38.i unwind label %invoke_catch.0.i		; <%"struct.llvm::TargetRegInfo"*> [#uses=1]
+	%tmp.148.i = invoke ptr null( ptr null )
+			to label %invoke_cont.38.i unwind label %invoke_catch.0.i		; <ptr> [#uses=1]
 
 invoke_cont.38.i:		; preds = %invoke_cont.37.i
-	%tmp.155.i = invoke i32 null( %"struct.llvm::TargetRegInfo"* %tmp.148.i, %"struct.llvm::Type"* null, i1 false )
+	%tmp.155.i = invoke i32 null( ptr %tmp.148.i, ptr null, i1 false )
 			to label %invoke_cont.39.i unwind label %invoke_catch.0.i		; <i32> [#uses=0]
 
 invoke_cont.39.i:		; preds = %invoke_cont.38.i
-	%tmp.163.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
-			to label %invoke_cont.40.i unwind label %invoke_catch.0.i		; <%"struct.llvm::TargetFrameInfo"*> [#uses=1]
+	%tmp.163.i = invoke ptr null( ptr null )
+			to label %invoke_cont.40.i unwind label %invoke_catch.0.i		; <ptr> [#uses=1]
 
 invoke_cont.40.i:		; preds = %invoke_cont.39.i
-	%tmp.170.i = invoke i32 null( %"struct.llvm::TargetFrameInfo"* %tmp.163.i )
+	%tmp.170.i = invoke i32 null( ptr %tmp.163.i )
 			to label %invoke_cont.41.i unwind label %invoke_catch.0.i		; <i32> [#uses=0]
 
 invoke_cont.41.i:		; preds = %invoke_cont.40.i
-	%tmp.177.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
-			to label %invoke_cont.42.i unwind label %invoke_catch.0.i		; <%"struct.llvm::TargetFrameInfo"*> [#uses=1]
+	%tmp.177.i = invoke ptr null( ptr null )
+			to label %invoke_cont.42.i unwind label %invoke_catch.0.i		; <ptr> [#uses=1]
 
 invoke_cont.42.i:		; preds = %invoke_cont.41.i
-	%tmp.184.i = invoke i32 null( %"struct.llvm::TargetFrameInfo"* %tmp.177.i )
+	%tmp.184.i = invoke i32 null( ptr %tmp.177.i )
 			to label %invoke_cont.43.i unwind label %invoke_catch.0.i		; <i32> [#uses=1]
 
 invoke_cont.43.i:		; preds = %invoke_cont.42.i
-	%tmp.191.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
-			to label %invoke_cont.44.i unwind label %invoke_catch.0.i		; <%"struct.llvm::TargetFrameInfo"*> [#uses=1]
+	%tmp.191.i = invoke ptr null( ptr null )
+			to label %invoke_cont.44.i unwind label %invoke_catch.0.i		; <ptr> [#uses=1]
 
 invoke_cont.44.i:		; preds = %invoke_cont.43.i
-	%tmp.198.i = invoke i32 null( %"struct.llvm::TargetFrameInfo"* %tmp.191.i, %"struct.llvm::MachineFunction"* %F, i1* null )
+	%tmp.198.i = invoke i32 null( ptr %tmp.191.i, ptr %F, ptr null )
 			to label %invoke_cont.45.i unwind label %invoke_catch.0.i		; <i32> [#uses=0]
 
 invoke_cont.45.i:		; preds = %invoke_cont.44.i
@@ -262,7 +262,7 @@ tmp.0.i.noexc55.i:		; preds = %no_exit.i
 			to label %invoke_cont.i53.i unwind label %cond_true.i52.i
 
 cond_true.i52.i:		; preds = %tmp.0.i.noexc55.i
-        %exn.i52.i = landingpad {i8*, i32}
+        %exn.i52.i = landingpad {ptr, i32}
                  cleanup
 	ret void
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/2005-02-11-InvokeCrash.ll b/llvm/test/Transforms/IndVarSimplify/2005-02-11-InvokeCrash.ll
index 98dd0b87e4047..022d8f9960cb0 100644
--- a/llvm/test/Transforms/IndVarSimplify/2005-02-11-InvokeCrash.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2005-02-11-InvokeCrash.ll
@@ -1,6 +1,6 @@
 ; RUN: opt < %s -passes=indvars -disable-output
 
-define void @_ZN5ArrayISt7complexIdEEC2ERK10dim_vector() personality i32 (...)* @__gxx_personality_v0 {
+define void @_ZN5ArrayISt7complexIdEEC2ERK10dim_vector() personality ptr @__gxx_personality_v0 {
 entry:
         %tmp.7 = invoke i32 @_ZN5ArrayISt7complexIdEE8get_sizeERK10dim_vector( )
                         to label %invoke_cont.0 unwind label %cond_true.1               ; <i32> [#uses=2]
@@ -16,9 +16,9 @@ no_exit.i:              ; preds = %no_exit.i, %invoke_cont.0
         br label %no_exit.i
 
 cond_true.1:            ; preds = %entry
-        %exn = landingpad {i8*, i32}
+        %exn = landingpad {ptr, i32}
                  cleanup
-        resume { i8*, i32 } %exn
+        resume { ptr, i32 } %exn
 }
 
 declare i32 @__gxx_personality_v0(...)

diff  --git a/llvm/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll b/llvm/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll
index 111fbafc0ae3a..c5b838ac97c3e 100644
--- a/llvm/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll
@@ -4,13 +4,13 @@ declare void @q_atomic_increment()
 
 declare void @_Z9qt_assertPKcS0_i()
 
-define void @_ZN13QMetaResourceC1EPKh() personality i32 (...)* @__gxx_personality_v0 {
+define void @_ZN13QMetaResourceC1EPKh() personality ptr @__gxx_personality_v0 {
 entry:
 	invoke void @_Z9qt_assertPKcS0_i( )
 			to label %endif.1 unwind label %then.i.i551
 
 then.i.i551:		; preds = %entry
-        %exn551 = landingpad {i8*, i32}
+        %exn551 = landingpad {ptr, i32}
                  cleanup
 	ret void
 
@@ -22,7 +22,7 @@ then.2:		; preds = %endif.1
 			to label %loopentry.0 unwind label %invoke_catch.6
 
 invoke_catch.6:		; preds = %then.2
-        %exn6 = landingpad {i8*, i32}
+        %exn6 = landingpad {ptr, i32}
                  cleanup
 	ret void
 
@@ -45,7 +45,7 @@ then.4:		; preds = %_ZNK7QString2atEi.exit
 	ret void
 
 endif.4:		; preds = %_ZNK7QString2atEi.exit
-	%tmp.115 = load i8, i8* null		; <i8> [#uses=1]
+	%tmp.115 = load i8, ptr null		; <i8> [#uses=1]
 	br i1 false, label %loopexit.1, label %no_exit.0
 
 no_exit.0:		; preds = %no_exit.0, %endif.4

diff  --git a/llvm/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll b/llvm/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll
index 785493cd14e8c..60782aba6a550 100644
--- a/llvm/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll
@@ -1,14 +1,14 @@
 ; RUN: opt < %s -passes=indvars -disable-output
 
- at fixtab = external global [29 x [29 x [2 x i32]]]               ; <[29 x [29 x [2 x i32]]]*> [#uses=1]
+ at fixtab = external global [29 x [29 x [2 x i32]]]               ; <ptr> [#uses=1]
 
 define void @init_optabs() {
 entry:
         br label %no_exit.0
 
 no_exit.0:              ; preds = %no_exit.0, %entry
-        %p.0.0 = phi i32* [ getelementptr ([29 x [29 x [2 x i32]]], [29 x [29 x [2 x i32]]]* @fixtab, i32 0, i32 0, i32 0, i32 0), %entry ], [ %inc.0, %no_exit.0 ]               ; <i32*> [#uses=1]
-        %inc.0 = getelementptr i32, i32* %p.0.0, i32 1               ; <i32*> [#uses=1]
+        %p.0.0 = phi ptr [ @fixtab, %entry ], [ %inc.0, %no_exit.0 ]               ; <ptr> [#uses=1]
+        %inc.0 = getelementptr i32, ptr %p.0.0, i32 1               ; <ptr> [#uses=1]
         br i1 undef, label %no_exit.0, label %no_exit.1
 
 no_exit.1:              ; preds = %no_exit.0

diff  --git a/llvm/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll b/llvm/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll
index c32bc2ec32fcc..a74201bba9633 100644
--- a/llvm/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll
@@ -6,9 +6,9 @@ endif.0:
 
 no_exit.30:             ; preds = %no_exit.30, %endif.0
         %x.12.0 = phi i32 [ %inc.28, %no_exit.30 ], [ -2, %endif.0 ]            ; <i32> [#uses=1]
-        %tmp.583 = load i16, i16* null               ; <i16> [#uses=1]
+        %tmp.583 = load i16, ptr null               ; <i16> [#uses=1]
         %tmp.584 = zext i16 %tmp.583 to i32             ; <i32> [#uses=1]
-        %tmp.588 = load i32, i32* null               ; <i32> [#uses=1]
+        %tmp.588 = load i32, ptr null               ; <i32> [#uses=1]
         %tmp.589 = mul i32 %tmp.584, %tmp.588           ; <i32> [#uses=1]
         %tmp.591 = add i32 %tmp.589, 0          ; <i32> [#uses=1]
         %inc.28 = add i32 %x.12.0, 1            ; <i32> [#uses=2]

diff  --git a/llvm/test/Transforms/IndVarSimplify/2006-12-10-BitCast.ll b/llvm/test/Transforms/IndVarSimplify/2006-12-10-BitCast.ll
index 1ad0f8da0581a..eaebb41b3dbac 100644
--- a/llvm/test/Transforms/IndVarSimplify/2006-12-10-BitCast.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2006-12-10-BitCast.ll
@@ -1,8 +1,8 @@
 ; RUN: opt < %s -passes=indvars -disable-output
 target datalayout = "e-p:32:32"
 target triple = "i686-apple-darwin8"
-	%struct.vorbis_dsp_state = type { i32, %struct.vorbis_info*, float**, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* }
-	%struct.vorbis_info = type { i32, i32, i32, i32, i32, i32, i32, i8* }
+	%struct.vorbis_dsp_state = type { i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, ptr }
+	%struct.vorbis_info = type { i32, i32, i32, i32, i32, i32, i32, ptr }
 
 define void @_ve_envelope_search() {
 entry:

diff  --git a/llvm/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll b/llvm/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll
index d5c1fdb2b95e7..02f0fe11058b6 100644
--- a/llvm/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll
@@ -3,8 +3,8 @@
 
 target datalayout = "e-p:32:32"
 target triple = "i686-apple-darwin8"
- at foo = internal constant [5 x i8] c"\00abc\00"		; <[5 x i8]*> [#uses=1]
- at str = internal constant [4 x i8] c"%d\0A\00"		; <[4 x i8]*> [#uses=1]
+ at foo = internal constant [5 x i8] c"\00abc\00"		; <ptr> [#uses=1]
+ at str = internal constant [4 x i8] c"%d\0A\00"		; <ptr> [#uses=1]
 
 
 define i32 @test(i32 %J) {
@@ -26,8 +26,8 @@ cond_true:		; preds = %bb2
 	br label %bb
 
 cond_next:		; preds = %bb2
-	%tmp2 = getelementptr [5 x i8], [5 x i8]* @foo, i32 0, i32 %i.0		; <i8*> [#uses=1]
-	%tmp3 = load i8, i8* %tmp2		; <i8> [#uses=1]
+	%tmp2 = getelementptr [5 x i8], ptr @foo, i32 0, i32 %i.0		; <ptr> [#uses=1]
+	%tmp3 = load i8, ptr %tmp2		; <i8> [#uses=1]
 	%tmp5 = icmp eq i8 %tmp3, 0		; <i1> [#uses=1]
 	br i1 %tmp5, label %bb6, label %bb
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll b/llvm/test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll
index a5f4d3cbf3f44..41377adc72e87 100644
--- a/llvm/test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll
@@ -1,17 +1,17 @@
 ; RUN: opt < %s -passes=indvars -disable-output
 ; PR1487
 
-	%struct.AVClass = type { i8*, i8* (i8*)*, %struct.AVOption* }
-	%struct.AVCodec = type { i8*, i32, i32, i32, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32, i8*)*, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32*, i8*, i32)*, i32, %struct.AVCodec*, void (%struct.AVCodecContext*)*, %struct.AVCodecTag*, i32* }
-	%struct.AVCodecContext = type { %struct.AVClass*, i32, i32, i32, i32, i32, i8*, i32, %struct.AVCodecTag, i32, i32, i32, i32, i32, void (%struct.AVCodecContext*, %struct.AVFrame*, i32*, i32, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, float, float, i32, i32, i32, i32, float, i32, i32, i32, %struct.AVCodec*, i8*, i32, i32, void (%struct.AVCodecContext*, i8*, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, [32 x i8], i32, i32, i32, i32, i32, i32, i32, float, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, void (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i8*, i8*, float, float, i32, %struct.RcOverride*, i32, i8*, i32, i32, i32, float, float, float, float, i32, float, float, float, float, float, i32, i32, i32, i32*, i32, i32, i32, i32, %struct.AVCodecTag, %struct.AVFrame*, i32, i32, [4 x i64], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32*)*, i32, i32, i32, i32, i32, i32, i8*, i32, i32, i32, i32, i32, i32, i16*, i16*, i32, i32, i32, i32, %struct.AVPaletteControl*, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32 (%struct.AVCodecContext*, i8*)*, i8**, i32*, i32)*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
+	%struct.AVClass = type { ptr, ptr, ptr }
+	%struct.AVCodec = type { ptr, i32, i32, i32, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr }
+	%struct.AVCodecContext = type { ptr, i32, i32, i32, i32, i32, ptr, i32, %struct.AVCodecTag, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, float, float, i32, i32, i32, i32, float, i32, i32, i32, ptr, ptr, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, [32 x i8], i32, i32, i32, i32, i32, i32, i32, float, i32, ptr, ptr, i32, i32, i32, i32, ptr, ptr, float, float, i32, ptr, i32, ptr, i32, i32, i32, float, float, float, float, i32, float, float, float, float, float, i32, i32, i32, ptr, i32, i32, i32, i32, %struct.AVCodecTag, ptr, i32, i32, [4 x i64], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, i32, i32, ptr, i32, ptr, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
 	%struct.AVCodecTag = type { i32, i32 }
-	%struct.AVFrame = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*] }
-	%struct.AVOption = type { i8*, i8*, i32, i32, double, double, double, i32, i8* }
+	%struct.AVFrame = type { [4 x ptr], [4 x i32], [4 x ptr], i32, i32, i64, i32, i32, i32, i32, i32, ptr, i32, ptr, [2 x ptr], ptr, i8, ptr, [4 x i64], i32, i32, i32, i32, i32, ptr, i32, i32, ptr, [2 x ptr] }
+	%struct.AVOption = type { ptr, ptr, i32, i32, double, double, double, i32, ptr }
 	%struct.AVPaletteControl = type { i32, [256 x i32] }
 	%struct.AVPanScan = type { i32, i32, i32, [3 x [2 x i16]] }
 	%struct.RcOverride = type { i32, i32, i32, float }
 
-define i32 @smc_decode_frame(%struct.AVCodecContext* %avctx, i8* %data, i32* %data_size, i8* %buf, i32 %buf_size) {
+define i32 @smc_decode_frame(ptr %avctx, ptr %data, ptr %data_size, ptr %buf, i32 %buf_size) {
 entry:
 	br i1 false, label %cond_next, label %cond_true
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll b/llvm/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll
index 49e4cbddde96f..9f66bd3ab3f8e 100644
--- a/llvm/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll
@@ -8,35 +8,35 @@ target datalayout = "n8:16:32:64"
 	%struct.App1Marker = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }>
 	%struct.ComponentInstanceRecord = type <{ [1 x i32] }>
 	%struct.DCPredictors = type { [5 x i16] }
-	%struct.DecodeTable = type { i16, i16, i16, i16, i8**, i8** }
-	%struct.ICMDataProcRecord = type <{ i16 (i8**, i32, i32)*, i32 }>
-	%struct.JPEGBitStream = type { i8*, i32, i32, i32, i32, i32, %struct.App1Marker*, i8*, i32, i16, i16, i32 }
-	%struct.JPEGGlobals = type { [2048 x i8], %struct.JPEGBitStream, i8*, i32, i32, %struct.ComponentInstanceRecord*, %struct.ComponentInstanceRecord*, i32, %struct.OpaqueQTMLMutex*, %struct.Rect, i32, i32, %struct.SharedGlobals, %struct.DCPredictors, i8, i8, void (i8*, i16**, i32, %struct.YUVGeneralParams*)*, %struct.YUVGeneralParams, i16, i16, i32, [5 x i16*], [5 x %struct.DecodeTable*], [5 x %struct.DecodeTable*], [5 x i8], [5 x i8], [4 x [65 x i16]], [4 x %struct.DecodeTable], [4 x %struct.DecodeTable], [4 x i8*], [4 x i8*], i16, i16, i32, i8**, i8**, i8**, i8**, i8**, i8**, i8**, i8**, i8**, i8**, [18 x i8], [18 x i8], [18 x i8], [18 x i8], i32, i32, i8**, i8**, i8, i8, i8, i8, i16, i16, %struct.App1Marker*, i8, i8, i8, i8, i32**, i8*, i16*, i8*, i16*, i8, [3 x i8], i32, [3 x i32], [3 x i32], [3 x i32], [3 x i32], [3 x i32], [3 x i16*], [3 x i16*], [3 x i8**], [3 x %struct.DecodeTable*], [3 x %struct.DecodeTable*], [3 x i32], i32, [3 x i16*], i32, i32, i32, [3 x i32], i8, i8, i8, i8, %struct.ICMDataProcRecord*, i32, i32, i8**, i8**, i8**, i8**, i32, i32, i8*, i32, i32, i16*, i16*, i8*, i32, i32, i32, i32, i32, i32, i32, [16 x <2 x i64>], [1280 x i8], i8 }
+	%struct.DecodeTable = type { i16, i16, i16, i16, ptr, ptr }
+	%struct.ICMDataProcRecord = type <{ ptr, i32 }>
+	%struct.JPEGBitStream = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, i32, i16, i16, i32 }
+	%struct.JPEGGlobals = type { [2048 x i8], %struct.JPEGBitStream, ptr, i32, i32, ptr, ptr, i32, ptr, %struct.Rect, i32, i32, %struct.SharedGlobals, %struct.DCPredictors, i8, i8, ptr, %struct.YUVGeneralParams, i16, i16, i32, [5 x ptr], [5 x ptr], [5 x ptr], [5 x i8], [5 x i8], [4 x [65 x i16]], [4 x %struct.DecodeTable], [4 x %struct.DecodeTable], [4 x ptr], [4 x ptr], i16, i16, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [18 x i8], [18 x i8], [18 x i8], [18 x i8], i32, i32, ptr, ptr, i8, i8, i8, i8, i16, i16, ptr, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, i8, [3 x i8], i32, [3 x i32], [3 x i32], [3 x i32], [3 x i32], [3 x i32], [3 x ptr], [3 x ptr], [3 x ptr], [3 x ptr], [3 x ptr], [3 x i32], i32, [3 x ptr], i32, i32, i32, [3 x i32], i8, i8, i8, i8, ptr, i32, i32, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, [16 x <2 x i64>], [1280 x i8], i8 }
 	%struct.OpaqueQTMLMutex = type opaque
 	%struct.Rect = type { i16, i16, i16, i16 }
 	%struct.SharedDGlobals = type { %struct.DecodeTable, %struct.DecodeTable, %struct.DecodeTable, %struct.DecodeTable }
-	%struct.SharedEGlobals = type { i8**, i8**, i8**, i8** }
-	%struct.SharedGlobals = type { %struct.SharedEGlobals*, %struct.SharedDGlobals* }
-	%struct.YUVGeneralParams = type { i16*, i8*, i8*, i8*, i8*, i8*, void (i8*, i16**, i32, %struct.YUVGeneralParams*)*, i16, i16, i16, [6 x i8], void (i8*, i16**, i32, %struct.YUVGeneralParams*)*, i16, i16 }
- at llvm.used = appending global [1 x i8*] [ i8* bitcast (i16 (%struct.JPEGGlobals*)* @ExtractBufferedBlocksIgnored to i8*) ], section "llvm.metadata"		; <[1 x i8*]*> [#uses=0]
+	%struct.SharedEGlobals = type { ptr, ptr, ptr, ptr }
+	%struct.SharedGlobals = type { ptr, ptr }
+	%struct.YUVGeneralParams = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i16, i16, i16, [6 x i8], ptr, i16, i16 }
+ at llvm.used = appending global [1 x ptr] [ ptr @ExtractBufferedBlocksIgnored ], section "llvm.metadata"		; <ptr> [#uses=0]
 
-define signext i16 @ExtractBufferedBlocksIgnored(%struct.JPEGGlobals* %globp)  nounwind {
+define signext i16 @ExtractBufferedBlocksIgnored(ptr %globp)  nounwind {
 ; CHECK-LABEL: @ExtractBufferedBlocksIgnored(
 ; CHECK: sext
 ; CHECK-NOT: sext
 entry:
-	%tmp4311 = getelementptr %struct.JPEGGlobals, %struct.JPEGGlobals* %globp, i32 0, i32 70		; <i32*> [#uses=1]
-	%tmp4412 = load i32, i32* %tmp4311, align 16		; <i32> [#uses=2]
+	%tmp4311 = getelementptr %struct.JPEGGlobals, ptr %globp, i32 0, i32 70		; <ptr> [#uses=1]
+	%tmp4412 = load i32, ptr %tmp4311, align 16		; <i32> [#uses=2]
 	%tmp4613 = icmp sgt i32 %tmp4412, 0		; <i1> [#uses=1]
 	br i1 %tmp4613, label %bb, label %bb49
 
 bb:		; preds = %bb28, %entry
 	%component.09 = phi i16 [ 0, %entry ], [ %tmp37, %bb28 ]		; <i16> [#uses=2]
 	%tmp12 = sext i16 %component.09 to i32		; <i32> [#uses=2]
-	%tmp6 = getelementptr %struct.JPEGGlobals, %struct.JPEGGlobals* %globp, i32 0, i32 77, i32 %tmp12		; <i16**> [#uses=2]
-	%tmp7 = load i16*, i16** %tmp6, align 4		; <i16*> [#uses=2]
-	%tmp235 = getelementptr %struct.JPEGGlobals, %struct.JPEGGlobals* %globp, i32 0, i32 71, i32 %tmp12		; <i32*> [#uses=1]
-	%tmp246 = load i32, i32* %tmp235, align 4		; <i32> [#uses=2]
+	%tmp6 = getelementptr %struct.JPEGGlobals, ptr %globp, i32 0, i32 77, i32 %tmp12		; <ptr> [#uses=2]
+	%tmp7 = load ptr, ptr %tmp6, align 4		; <ptr> [#uses=2]
+	%tmp235 = getelementptr %struct.JPEGGlobals, ptr %globp, i32 0, i32 71, i32 %tmp12		; <ptr> [#uses=1]
+	%tmp246 = load i32, ptr %tmp235, align 4		; <i32> [#uses=2]
 	%tmp267 = icmp sgt i32 %tmp246, 0		; <i1> [#uses=1]
 	br i1 %tmp267, label %bb8, label %bb28
 
@@ -44,7 +44,7 @@ bb8:		; preds = %bb8, %bb
 	%indvar = phi i32 [ 0, %bb ], [ %indvar.next2, %bb8 ]		; <i32> [#uses=3]
 	%theDCTBufferIter.01.rec = shl i32 %indvar, 6		; <i32> [#uses=1]
 	%tmp10.rec = add i32 %theDCTBufferIter.01.rec, 64		; <i32> [#uses=1]
-	%tmp10 = getelementptr i16, i16* %tmp7, i32 %tmp10.rec		; <i16*> [#uses=1]
+	%tmp10 = getelementptr i16, ptr %tmp7, i32 %tmp10.rec		; <ptr> [#uses=1]
 	%i.02 = trunc i32 %indvar to i16		; <i16> [#uses=1]
 	%tmp13 = add i16 %i.02, 1		; <i16> [#uses=1]
 	%phitmp = sext i16 %tmp13 to i32		; <i32> [#uses=1]
@@ -53,8 +53,8 @@ bb8:		; preds = %bb8, %bb
 	br i1 %tmp26, label %bb8, label %bb28
 
 bb28:		; preds = %bb8, %bb
-	%theDCTBufferIter.0.lcssa = phi i16* [ %tmp7, %bb ], [ %tmp10, %bb8 ]		; <i16*> [#uses=1]
-	store i16* %theDCTBufferIter.0.lcssa, i16** %tmp6, align 4
+	%theDCTBufferIter.0.lcssa = phi ptr [ %tmp7, %bb ], [ %tmp10, %bb8 ]		; <ptr> [#uses=1]
+	store ptr %theDCTBufferIter.0.lcssa, ptr %tmp6, align 4
 	%tmp37 = add i16 %component.09, 1		; <i16> [#uses=2]
 	%phitmp15 = sext i16 %tmp37 to i32		; <i32> [#uses=1]
 	%tmp46 = icmp slt i32 %phitmp15, 42		; <i1> [#uses=1]

diff  --git a/llvm/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll b/llvm/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll
index e6c5d38b24746..607f879fb4e13 100644
--- a/llvm/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll
@@ -1,14 +1,14 @@
 ; RUN: opt < %s -passes=indvars
 ; PR2857
 
- at foo = external global i32		; <i32*> [#uses=1]
+ at foo = external global i32		; <ptr> [#uses=1]
 
 define void @test(i32 %n, i32 %arg) {
 entry:
 	br i1 false, label %bb.nph, label %return
 
 bb.nph:		; preds = %entry
-	%0 = load i32, i32* @foo, align 4		; <i32> [#uses=1]
+	%0 = load i32, ptr @foo, align 4		; <i32> [#uses=1]
 	%1 = sext i32 %0 to i64		; <i64> [#uses=1]
 	br label %bb
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/2009-05-24-useafterfree.ll b/llvm/test/Transforms/IndVarSimplify/2009-05-24-useafterfree.ll
index 222a08171aa86..a4257482668f9 100644
--- a/llvm/test/Transforms/IndVarSimplify/2009-05-24-useafterfree.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2009-05-24-useafterfree.ll
@@ -3,7 +3,7 @@
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
 target triple = "i386-pc-linux-gnu"
 
-define void @0(i32*, i32*, i32, i32) nounwind {
+define void @0(ptr, ptr, i32, i32) nounwind {
 	br i1 false, label %bb.nph1.preheader, label %.outer._crit_edge
 
 bb.nph1.preheader:		; preds = %4

diff  --git a/llvm/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll b/llvm/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll
index bf2dc7ecc9ddb..e248e287ddaa8 100644
--- a/llvm/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll
@@ -3,7 +3,7 @@
 ; From ffbench.
 
 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-n8:16:32:64"
-define internal double @fourn(double* %data, i32 %x, i32 %y, i32 %n) nounwind {
+define internal double @fourn(ptr %data, i32 %x, i32 %y, i32 %n) nounwind {
 ; CHECK: entry:
 ; CHECK: sext
 ; CHECK: sext
@@ -17,8 +17,8 @@ for.body:
   %i2.115 = phi i32 [ 0, %entry ], [ %add249, %for.body ]
   %add174 = add nsw i32 %i2.115, %x
   %idxprom177 = sext i32 %add174 to i64
-  %arrayidx179 = getelementptr inbounds double, double* %data, i64 %idxprom177
-  %tmp180 = load double, double* %arrayidx179, align 8
+  %arrayidx179 = getelementptr inbounds double, ptr %data, i64 %idxprom177
+  %tmp180 = load double, ptr %arrayidx179, align 8
   %add249 = add nsw i32 %i2.115, %y
   %cmp168 = icmp sgt i32 %add249, %n
   br i1 %cmp168, label %exit, label %for.body

diff  --git a/llvm/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll b/llvm/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
index 1ada3584ab6fc..cb0be523c7095 100644
--- a/llvm/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
@@ -7,24 +7,24 @@
 ; Test LinearFunctionTestReplace of a pointer-type loop counter. Note
 ; that BECount may or may not be a pointer type. A pointer type
 ; BECount doesn't really make sense, but that's what falls out of
-; SCEV. Since it's an i8*, it has unit stride so we never adjust the
+; SCEV. Since it's an ptr, it has unit stride so we never adjust the
 ; SCEV expression in a way that would convert it to an integer type.
 
-define i8 @testnullptrptr(i8* %buf, i8* %end) nounwind {
+define i8 @testnullptrptr(ptr %buf, ptr %end) nounwind {
 ; PTR64-LABEL: @testnullptrptr(
-; PTR64-NEXT:    [[END1:%.*]] = ptrtoint i8* [[END:%.*]] to i64
+; PTR64-NEXT:    [[END1:%.*]] = ptrtoint ptr [[END:%.*]] to i64
 ; PTR64-NEXT:    br label [[LOOPGUARD:%.*]]
 ; PTR64:       loopguard:
-; PTR64-NEXT:    [[GUARD:%.*]] = icmp ult i8* null, [[END]]
+; PTR64-NEXT:    [[GUARD:%.*]] = icmp ult ptr null, [[END]]
 ; PTR64-NEXT:    br i1 [[GUARD]], label [[PREHEADER:%.*]], label [[EXIT:%.*]]
 ; PTR64:       preheader:
-; PTR64-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, i8* null, i64 [[END1]]
+; PTR64-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, ptr null, i64 [[END1]]
 ; PTR64-NEXT:    br label [[LOOP:%.*]]
 ; PTR64:       loop:
-; PTR64-NEXT:    [[P_01_US_US:%.*]] = phi i8* [ null, [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
-; PTR64-NEXT:    [[GEP]] = getelementptr inbounds i8, i8* [[P_01_US_US]], i64 1
-; PTR64-NEXT:    [[SNEXT:%.*]] = load i8, i8* [[GEP]], align 1
-; PTR64-NEXT:    [[EXITCOND:%.*]] = icmp ne i8* [[GEP]], [[SCEVGEP]]
+; PTR64-NEXT:    [[P_01_US_US:%.*]] = phi ptr [ null, [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
+; PTR64-NEXT:    [[GEP]] = getelementptr inbounds i8, ptr [[P_01_US_US]], i64 1
+; PTR64-NEXT:    [[SNEXT:%.*]] = load i8, ptr [[GEP]], align 1
+; PTR64-NEXT:    [[EXITCOND:%.*]] = icmp ne ptr [[GEP]], [[SCEVGEP]]
 ; PTR64-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
 ; PTR64:       exit.loopexit:
 ; PTR64-NEXT:    [[SNEXT_LCSSA:%.*]] = phi i8 [ [[SNEXT]], [[LOOP]] ]
@@ -34,19 +34,19 @@ define i8 @testnullptrptr(i8* %buf, i8* %end) nounwind {
 ; PTR64-NEXT:    ret i8 [[RET]]
 ;
 ; PTR32-LABEL: @testnullptrptr(
-; PTR32-NEXT:    [[END1:%.*]] = ptrtoint i8* [[END:%.*]] to i32
+; PTR32-NEXT:    [[END1:%.*]] = ptrtoint ptr [[END:%.*]] to i32
 ; PTR32-NEXT:    br label [[LOOPGUARD:%.*]]
 ; PTR32:       loopguard:
-; PTR32-NEXT:    [[GUARD:%.*]] = icmp ult i8* null, [[END]]
+; PTR32-NEXT:    [[GUARD:%.*]] = icmp ult ptr null, [[END]]
 ; PTR32-NEXT:    br i1 [[GUARD]], label [[PREHEADER:%.*]], label [[EXIT:%.*]]
 ; PTR32:       preheader:
-; PTR32-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, i8* null, i32 [[END1]]
+; PTR32-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, ptr null, i32 [[END1]]
 ; PTR32-NEXT:    br label [[LOOP:%.*]]
 ; PTR32:       loop:
-; PTR32-NEXT:    [[P_01_US_US:%.*]] = phi i8* [ null, [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
-; PTR32-NEXT:    [[GEP]] = getelementptr inbounds i8, i8* [[P_01_US_US]], i64 1
-; PTR32-NEXT:    [[SNEXT:%.*]] = load i8, i8* [[GEP]], align 1
-; PTR32-NEXT:    [[EXITCOND:%.*]] = icmp ne i8* [[GEP]], [[SCEVGEP]]
+; PTR32-NEXT:    [[P_01_US_US:%.*]] = phi ptr [ null, [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
+; PTR32-NEXT:    [[GEP]] = getelementptr inbounds i8, ptr [[P_01_US_US]], i64 1
+; PTR32-NEXT:    [[SNEXT:%.*]] = load i8, ptr [[GEP]], align 1
+; PTR32-NEXT:    [[EXITCOND:%.*]] = icmp ne ptr [[GEP]], [[SCEVGEP]]
 ; PTR32-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
 ; PTR32:       exit.loopexit:
 ; PTR32-NEXT:    [[SNEXT_LCSSA:%.*]] = phi i8 [ [[SNEXT]], [[LOOP]] ]
@@ -58,18 +58,18 @@ define i8 @testnullptrptr(i8* %buf, i8* %end) nounwind {
   br label %loopguard
 
 loopguard:
-  %guard = icmp ult i8* null, %end
+  %guard = icmp ult ptr null, %end
   br i1 %guard, label %preheader, label %exit
 
 preheader:
   br label %loop
 
 loop:
-  %p.01.us.us = phi i8* [ null, %preheader ], [ %gep, %loop ]
+  %p.01.us.us = phi ptr [ null, %preheader ], [ %gep, %loop ]
   %s = phi i8 [0, %preheader], [%snext, %loop]
-  %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1
-  %snext = load i8, i8* %gep
-  %cmp = icmp ult i8* %gep, %end
+  %gep = getelementptr inbounds i8, ptr %p.01.us.us, i64 1
+  %snext = load i8, ptr %gep
+  %cmp = icmp ult ptr %gep, %end
   br i1 %cmp, label %loop, label %exit
 
 exit:
@@ -77,23 +77,23 @@ exit:
   ret i8 %ret
 }
 
-define i8 @testptrptr(i8* %buf, i8* %end) nounwind {
+define i8 @testptrptr(ptr %buf, ptr %end) nounwind {
 ; PTR64-LABEL: @testptrptr(
-; PTR64-NEXT:    [[BUF2:%.*]] = ptrtoint i8* [[BUF:%.*]] to i64
-; PTR64-NEXT:    [[END1:%.*]] = ptrtoint i8* [[END:%.*]] to i64
+; PTR64-NEXT:    [[BUF2:%.*]] = ptrtoint ptr [[BUF:%.*]] to i64
+; PTR64-NEXT:    [[END1:%.*]] = ptrtoint ptr [[END:%.*]] to i64
 ; PTR64-NEXT:    br label [[LOOPGUARD:%.*]]
 ; PTR64:       loopguard:
-; PTR64-NEXT:    [[GUARD:%.*]] = icmp ult i8* [[BUF]], [[END]]
+; PTR64-NEXT:    [[GUARD:%.*]] = icmp ult ptr [[BUF]], [[END]]
 ; PTR64-NEXT:    br i1 [[GUARD]], label [[PREHEADER:%.*]], label [[EXIT:%.*]]
 ; PTR64:       preheader:
 ; PTR64-NEXT:    [[TMP1:%.*]] = sub i64 [[END1]], [[BUF2]]
-; PTR64-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, i8* [[BUF]], i64 [[TMP1]]
+; PTR64-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, ptr [[BUF]], i64 [[TMP1]]
 ; PTR64-NEXT:    br label [[LOOP:%.*]]
 ; PTR64:       loop:
-; PTR64-NEXT:    [[P_01_US_US:%.*]] = phi i8* [ [[BUF]], [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
-; PTR64-NEXT:    [[GEP]] = getelementptr inbounds i8, i8* [[P_01_US_US]], i64 1
-; PTR64-NEXT:    [[SNEXT:%.*]] = load i8, i8* [[GEP]], align 1
-; PTR64-NEXT:    [[EXITCOND:%.*]] = icmp ne i8* [[GEP]], [[SCEVGEP]]
+; PTR64-NEXT:    [[P_01_US_US:%.*]] = phi ptr [ [[BUF]], [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
+; PTR64-NEXT:    [[GEP]] = getelementptr inbounds i8, ptr [[P_01_US_US]], i64 1
+; PTR64-NEXT:    [[SNEXT:%.*]] = load i8, ptr [[GEP]], align 1
+; PTR64-NEXT:    [[EXITCOND:%.*]] = icmp ne ptr [[GEP]], [[SCEVGEP]]
 ; PTR64-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
 ; PTR64:       exit.loopexit:
 ; PTR64-NEXT:    [[SNEXT_LCSSA:%.*]] = phi i8 [ [[SNEXT]], [[LOOP]] ]
@@ -103,21 +103,21 @@ define i8 @testptrptr(i8* %buf, i8* %end) nounwind {
 ; PTR64-NEXT:    ret i8 [[RET]]
 ;
 ; PTR32-LABEL: @testptrptr(
-; PTR32-NEXT:    [[BUF2:%.*]] = ptrtoint i8* [[BUF:%.*]] to i32
-; PTR32-NEXT:    [[END1:%.*]] = ptrtoint i8* [[END:%.*]] to i32
+; PTR32-NEXT:    [[BUF2:%.*]] = ptrtoint ptr [[BUF:%.*]] to i32
+; PTR32-NEXT:    [[END1:%.*]] = ptrtoint ptr [[END:%.*]] to i32
 ; PTR32-NEXT:    br label [[LOOPGUARD:%.*]]
 ; PTR32:       loopguard:
-; PTR32-NEXT:    [[GUARD:%.*]] = icmp ult i8* [[BUF]], [[END]]
+; PTR32-NEXT:    [[GUARD:%.*]] = icmp ult ptr [[BUF]], [[END]]
 ; PTR32-NEXT:    br i1 [[GUARD]], label [[PREHEADER:%.*]], label [[EXIT:%.*]]
 ; PTR32:       preheader:
 ; PTR32-NEXT:    [[TMP1:%.*]] = sub i32 [[END1]], [[BUF2]]
-; PTR32-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, i8* [[BUF]], i32 [[TMP1]]
+; PTR32-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, ptr [[BUF]], i32 [[TMP1]]
 ; PTR32-NEXT:    br label [[LOOP:%.*]]
 ; PTR32:       loop:
-; PTR32-NEXT:    [[P_01_US_US:%.*]] = phi i8* [ [[BUF]], [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
-; PTR32-NEXT:    [[GEP]] = getelementptr inbounds i8, i8* [[P_01_US_US]], i64 1
-; PTR32-NEXT:    [[SNEXT:%.*]] = load i8, i8* [[GEP]], align 1
-; PTR32-NEXT:    [[EXITCOND:%.*]] = icmp ne i8* [[GEP]], [[SCEVGEP]]
+; PTR32-NEXT:    [[P_01_US_US:%.*]] = phi ptr [ [[BUF]], [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
+; PTR32-NEXT:    [[GEP]] = getelementptr inbounds i8, ptr [[P_01_US_US]], i64 1
+; PTR32-NEXT:    [[SNEXT:%.*]] = load i8, ptr [[GEP]], align 1
+; PTR32-NEXT:    [[EXITCOND:%.*]] = icmp ne ptr [[GEP]], [[SCEVGEP]]
 ; PTR32-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
 ; PTR32:       exit.loopexit:
 ; PTR32-NEXT:    [[SNEXT_LCSSA:%.*]] = phi i8 [ [[SNEXT]], [[LOOP]] ]
@@ -129,18 +129,18 @@ define i8 @testptrptr(i8* %buf, i8* %end) nounwind {
   br label %loopguard
 
 loopguard:
-  %guard = icmp ult i8* %buf, %end
+  %guard = icmp ult ptr %buf, %end
   br i1 %guard, label %preheader, label %exit
 
 preheader:
   br label %loop
 
 loop:
-  %p.01.us.us = phi i8* [ %buf, %preheader ], [ %gep, %loop ]
+  %p.01.us.us = phi ptr [ %buf, %preheader ], [ %gep, %loop ]
   %s = phi i8 [0, %preheader], [%snext, %loop]
-  %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1
-  %snext = load i8, i8* %gep
-  %cmp = icmp ult i8* %gep, %end
+  %gep = getelementptr inbounds i8, ptr %p.01.us.us, i64 1
+  %snext = load i8, ptr %gep
+  %cmp = icmp ult ptr %gep, %end
   br i1 %cmp, label %loop, label %exit
 
 exit:
@@ -148,12 +148,12 @@ exit:
   ret i8 %ret
 }
 
-define i8 @testnullptrint(i8* %buf, i8* %end) nounwind {
+define i8 @testnullptrint(ptr %buf, ptr %end) nounwind {
 ; PTR64-LABEL: @testnullptrint(
 ; PTR64-NEXT:    br label [[LOOPGUARD:%.*]]
 ; PTR64:       loopguard:
-; PTR64-NEXT:    [[BI:%.*]] = ptrtoint i8* [[BUF:%.*]] to i32
-; PTR64-NEXT:    [[EI:%.*]] = ptrtoint i8* [[END:%.*]] to i32
+; PTR64-NEXT:    [[BI:%.*]] = ptrtoint ptr [[BUF:%.*]] to i32
+; PTR64-NEXT:    [[EI:%.*]] = ptrtoint ptr [[END:%.*]] to i32
 ; PTR64-NEXT:    [[CNT:%.*]] = sub i32 [[EI]], [[BI]]
 ; PTR64-NEXT:    [[GUARD:%.*]] = icmp ult i32 0, [[CNT]]
 ; PTR64-NEXT:    br i1 [[GUARD]], label [[PREHEADER:%.*]], label [[EXIT:%.*]]
@@ -162,13 +162,13 @@ define i8 @testnullptrint(i8* %buf, i8* %end) nounwind {
 ; PTR64-NEXT:    [[TMP2:%.*]] = sub i32 [[TMP1]], [[BI]]
 ; PTR64-NEXT:    [[TMP3:%.*]] = zext i32 [[TMP2]] to i64
 ; PTR64-NEXT:    [[TMP4:%.*]] = add nuw nsw i64 [[TMP3]], 1
-; PTR64-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, i8* null, i64 [[TMP4]]
+; PTR64-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, ptr null, i64 [[TMP4]]
 ; PTR64-NEXT:    br label [[LOOP:%.*]]
 ; PTR64:       loop:
-; PTR64-NEXT:    [[P_01_US_US:%.*]] = phi i8* [ null, [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
-; PTR64-NEXT:    [[GEP]] = getelementptr inbounds i8, i8* [[P_01_US_US]], i64 1
-; PTR64-NEXT:    [[SNEXT:%.*]] = load i8, i8* [[GEP]], align 1
-; PTR64-NEXT:    [[EXITCOND:%.*]] = icmp ne i8* [[GEP]], [[SCEVGEP]]
+; PTR64-NEXT:    [[P_01_US_US:%.*]] = phi ptr [ null, [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
+; PTR64-NEXT:    [[GEP]] = getelementptr inbounds i8, ptr [[P_01_US_US]], i64 1
+; PTR64-NEXT:    [[SNEXT:%.*]] = load i8, ptr [[GEP]], align 1
+; PTR64-NEXT:    [[EXITCOND:%.*]] = icmp ne ptr [[GEP]], [[SCEVGEP]]
 ; PTR64-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
 ; PTR64:       exit.loopexit:
 ; PTR64-NEXT:    [[SNEXT_LCSSA:%.*]] = phi i8 [ [[SNEXT]], [[LOOP]] ]
@@ -180,19 +180,19 @@ define i8 @testnullptrint(i8* %buf, i8* %end) nounwind {
 ; PTR32-LABEL: @testnullptrint(
 ; PTR32-NEXT:    br label [[LOOPGUARD:%.*]]
 ; PTR32:       loopguard:
-; PTR32-NEXT:    [[BI:%.*]] = ptrtoint i8* [[BUF:%.*]] to i32
-; PTR32-NEXT:    [[EI:%.*]] = ptrtoint i8* [[END:%.*]] to i32
+; PTR32-NEXT:    [[BI:%.*]] = ptrtoint ptr [[BUF:%.*]] to i32
+; PTR32-NEXT:    [[EI:%.*]] = ptrtoint ptr [[END:%.*]] to i32
 ; PTR32-NEXT:    [[CNT:%.*]] = sub i32 [[EI]], [[BI]]
 ; PTR32-NEXT:    [[GUARD:%.*]] = icmp ult i32 0, [[CNT]]
 ; PTR32-NEXT:    br i1 [[GUARD]], label [[PREHEADER:%.*]], label [[EXIT:%.*]]
 ; PTR32:       preheader:
-; PTR32-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, i8* null, i32 [[CNT]]
+; PTR32-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, ptr null, i32 [[CNT]]
 ; PTR32-NEXT:    br label [[LOOP:%.*]]
 ; PTR32:       loop:
-; PTR32-NEXT:    [[P_01_US_US:%.*]] = phi i8* [ null, [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
-; PTR32-NEXT:    [[GEP]] = getelementptr inbounds i8, i8* [[P_01_US_US]], i64 1
-; PTR32-NEXT:    [[SNEXT:%.*]] = load i8, i8* [[GEP]], align 1
-; PTR32-NEXT:    [[EXITCOND:%.*]] = icmp ne i8* [[GEP]], [[SCEVGEP]]
+; PTR32-NEXT:    [[P_01_US_US:%.*]] = phi ptr [ null, [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
+; PTR32-NEXT:    [[GEP]] = getelementptr inbounds i8, ptr [[P_01_US_US]], i64 1
+; PTR32-NEXT:    [[SNEXT:%.*]] = load i8, ptr [[GEP]], align 1
+; PTR32-NEXT:    [[EXITCOND:%.*]] = icmp ne ptr [[GEP]], [[SCEVGEP]]
 ; PTR32-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
 ; PTR32:       exit.loopexit:
 ; PTR32-NEXT:    [[SNEXT_LCSSA:%.*]] = phi i8 [ [[SNEXT]], [[LOOP]] ]
@@ -204,8 +204,8 @@ define i8 @testnullptrint(i8* %buf, i8* %end) nounwind {
   br label %loopguard
 
 loopguard:
-  %bi = ptrtoint i8* %buf to i32
-  %ei = ptrtoint i8* %end to i32
+  %bi = ptrtoint ptr %buf to i32
+  %ei = ptrtoint ptr %end to i32
   %cnt = sub i32 %ei, %bi
   %guard = icmp ult i32 0, %cnt
   br i1 %guard, label %preheader, label %exit
@@ -214,11 +214,11 @@ preheader:
   br label %loop
 
 loop:
-  %p.01.us.us = phi i8* [ null, %preheader ], [ %gep, %loop ]
+  %p.01.us.us = phi ptr [ null, %preheader ], [ %gep, %loop ]
   %iv = phi i32 [ 0, %preheader ], [ %ivnext, %loop ]
   %s = phi i8 [0, %preheader], [%snext, %loop]
-  %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1
-  %snext = load i8, i8* %gep
+  %gep = getelementptr inbounds i8, ptr %p.01.us.us, i64 1
+  %snext = load i8, ptr %gep
   %ivnext = add i32 %iv, 1
   %cmp = icmp ult i32 %ivnext, %cnt
   br i1 %cmp, label %loop, label %exit
@@ -228,22 +228,22 @@ exit:
   ret i8 %ret
 }
 
-define i8 @testptrint(i8* %buf, i8* %end) nounwind {
+define i8 @testptrint(ptr %buf, ptr %end) nounwind {
 ; PTR64-LABEL: @testptrint(
 ; PTR64-NEXT:    br label [[LOOPGUARD:%.*]]
 ; PTR64:       loopguard:
-; PTR64-NEXT:    [[BI:%.*]] = ptrtoint i8* [[BUF:%.*]] to i32
-; PTR64-NEXT:    [[EI:%.*]] = ptrtoint i8* [[END:%.*]] to i32
+; PTR64-NEXT:    [[BI:%.*]] = ptrtoint ptr [[BUF:%.*]] to i32
+; PTR64-NEXT:    [[EI:%.*]] = ptrtoint ptr [[END:%.*]] to i32
 ; PTR64-NEXT:    [[CNT:%.*]] = sub i32 [[EI]], [[BI]]
 ; PTR64-NEXT:    [[GUARD:%.*]] = icmp ult i32 [[BI]], [[CNT]]
 ; PTR64-NEXT:    br i1 [[GUARD]], label [[PREHEADER:%.*]], label [[EXIT:%.*]]
 ; PTR64:       preheader:
 ; PTR64-NEXT:    br label [[LOOP:%.*]]
 ; PTR64:       loop:
-; PTR64-NEXT:    [[P_01_US_US:%.*]] = phi i8* [ [[BUF]], [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
+; PTR64-NEXT:    [[P_01_US_US:%.*]] = phi ptr [ [[BUF]], [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
 ; PTR64-NEXT:    [[IV:%.*]] = phi i32 [ [[BI]], [[PREHEADER]] ], [ [[IVNEXT:%.*]], [[LOOP]] ]
-; PTR64-NEXT:    [[GEP]] = getelementptr inbounds i8, i8* [[P_01_US_US]], i64 1
-; PTR64-NEXT:    [[SNEXT:%.*]] = load i8, i8* [[GEP]], align 1
+; PTR64-NEXT:    [[GEP]] = getelementptr inbounds i8, ptr [[P_01_US_US]], i64 1
+; PTR64-NEXT:    [[SNEXT:%.*]] = load i8, ptr [[GEP]], align 1
 ; PTR64-NEXT:    [[IVNEXT]] = add nuw i32 [[IV]], 1
 ; PTR64-NEXT:    [[EXITCOND:%.*]] = icmp ne i32 [[IVNEXT]], [[CNT]]
 ; PTR64-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
@@ -257,18 +257,18 @@ define i8 @testptrint(i8* %buf, i8* %end) nounwind {
 ; PTR32-LABEL: @testptrint(
 ; PTR32-NEXT:    br label [[LOOPGUARD:%.*]]
 ; PTR32:       loopguard:
-; PTR32-NEXT:    [[BI:%.*]] = ptrtoint i8* [[BUF:%.*]] to i32
-; PTR32-NEXT:    [[EI:%.*]] = ptrtoint i8* [[END:%.*]] to i32
+; PTR32-NEXT:    [[BI:%.*]] = ptrtoint ptr [[BUF:%.*]] to i32
+; PTR32-NEXT:    [[EI:%.*]] = ptrtoint ptr [[END:%.*]] to i32
 ; PTR32-NEXT:    [[CNT:%.*]] = sub i32 [[EI]], [[BI]]
 ; PTR32-NEXT:    [[GUARD:%.*]] = icmp ult i32 [[BI]], [[CNT]]
 ; PTR32-NEXT:    br i1 [[GUARD]], label [[PREHEADER:%.*]], label [[EXIT:%.*]]
 ; PTR32:       preheader:
 ; PTR32-NEXT:    br label [[LOOP:%.*]]
 ; PTR32:       loop:
-; PTR32-NEXT:    [[P_01_US_US:%.*]] = phi i8* [ [[BUF]], [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
+; PTR32-NEXT:    [[P_01_US_US:%.*]] = phi ptr [ [[BUF]], [[PREHEADER]] ], [ [[GEP:%.*]], [[LOOP]] ]
 ; PTR32-NEXT:    [[IV:%.*]] = phi i32 [ [[BI]], [[PREHEADER]] ], [ [[IVNEXT:%.*]], [[LOOP]] ]
-; PTR32-NEXT:    [[GEP]] = getelementptr inbounds i8, i8* [[P_01_US_US]], i64 1
-; PTR32-NEXT:    [[SNEXT:%.*]] = load i8, i8* [[GEP]], align 1
+; PTR32-NEXT:    [[GEP]] = getelementptr inbounds i8, ptr [[P_01_US_US]], i64 1
+; PTR32-NEXT:    [[SNEXT:%.*]] = load i8, ptr [[GEP]], align 1
 ; PTR32-NEXT:    [[IVNEXT]] = add nuw i32 [[IV]], 1
 ; PTR32-NEXT:    [[EXITCOND:%.*]] = icmp ne i32 [[IVNEXT]], [[CNT]]
 ; PTR32-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
@@ -282,8 +282,8 @@ define i8 @testptrint(i8* %buf, i8* %end) nounwind {
   br label %loopguard
 
 loopguard:
-  %bi = ptrtoint i8* %buf to i32
-  %ei = ptrtoint i8* %end to i32
+  %bi = ptrtoint ptr %buf to i32
+  %ei = ptrtoint ptr %end to i32
   %cnt = sub i32 %ei, %bi
   %guard = icmp ult i32 %bi, %cnt
   br i1 %guard, label %preheader, label %exit
@@ -292,11 +292,11 @@ preheader:
   br label %loop
 
 loop:
-  %p.01.us.us = phi i8* [ %buf, %preheader ], [ %gep, %loop ]
+  %p.01.us.us = phi ptr [ %buf, %preheader ], [ %gep, %loop ]
   %iv = phi i32 [ %bi, %preheader ], [ %ivnext, %loop ]
   %s = phi i8 [0, %preheader], [%snext, %loop]
-  %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1
-  %snext = load i8, i8* %gep
+  %gep = getelementptr inbounds i8, ptr %p.01.us.us, i64 1
+  %snext = load i8, ptr %gep
   %ivnext = add i32 %iv, 1
   %cmp = icmp ult i32 %ivnext, %cnt
   br i1 %cmp, label %loop, label %exit
@@ -307,13 +307,13 @@ exit:
 }
 
 ; IV and BECount have two 
diff erent pointer types here.
-define void @testnullptr([512 x i8]* %base) nounwind {
+define void @testnullptr(ptr %base) nounwind {
 ; PTR64-LABEL: @testnullptr(
 ; PTR64-NEXT:  entry:
-; PTR64-NEXT:    [[ADD_PTR1603:%.*]] = getelementptr [512 x i8], [512 x i8]* [[BASE:%.*]], i64 0, i64 512
+; PTR64-NEXT:    [[ADD_PTR1603:%.*]] = getelementptr [512 x i8], ptr [[BASE:%.*]], i64 0, i64 512
 ; PTR64-NEXT:    br label [[PREHEADER:%.*]]
 ; PTR64:       preheader:
-; PTR64-NEXT:    [[CMP1604192:%.*]] = icmp ult i8* undef, [[ADD_PTR1603]]
+; PTR64-NEXT:    [[CMP1604192:%.*]] = icmp ult ptr undef, [[ADD_PTR1603]]
 ; PTR64-NEXT:    br i1 [[CMP1604192]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_END1609:%.*]]
 ; PTR64:       for.body.preheader:
 ; PTR64-NEXT:    br label [[FOR_BODY:%.*]]
@@ -326,10 +326,10 @@ define void @testnullptr([512 x i8]* %base) nounwind {
 ;
 ; PTR32-LABEL: @testnullptr(
 ; PTR32-NEXT:  entry:
-; PTR32-NEXT:    [[ADD_PTR1603:%.*]] = getelementptr [512 x i8], [512 x i8]* [[BASE:%.*]], i64 0, i64 512
+; PTR32-NEXT:    [[ADD_PTR1603:%.*]] = getelementptr [512 x i8], ptr [[BASE:%.*]], i64 0, i64 512
 ; PTR32-NEXT:    br label [[PREHEADER:%.*]]
 ; PTR32:       preheader:
-; PTR32-NEXT:    [[CMP1604192:%.*]] = icmp ult i8* undef, [[ADD_PTR1603]]
+; PTR32-NEXT:    [[CMP1604192:%.*]] = icmp ult ptr undef, [[ADD_PTR1603]]
 ; PTR32-NEXT:    br i1 [[CMP1604192]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_END1609:%.*]]
 ; PTR32:       for.body.preheader:
 ; PTR32-NEXT:    br label [[FOR_BODY:%.*]]
@@ -341,17 +341,17 @@ define void @testnullptr([512 x i8]* %base) nounwind {
 ; PTR32-NEXT:    unreachable
 ;
 entry:
-  %add.ptr1603 = getelementptr [512 x i8], [512 x i8]* %base, i64 0, i64 512
+  %add.ptr1603 = getelementptr [512 x i8], ptr %base, i64 0, i64 512
   br label %preheader
 
 preheader:
-  %cmp1604192 = icmp ult i8* undef, %add.ptr1603
+  %cmp1604192 = icmp ult ptr undef, %add.ptr1603
   br i1 %cmp1604192, label %for.body, label %for.end1609
 
 for.body:
-  %r.17193 = phi i8* [ %incdec.ptr1608, %for.body ], [ null, %preheader ]
-  %incdec.ptr1608 = getelementptr i8, i8* %r.17193, i64 1
-  %cmp1604 = icmp ult i8* %incdec.ptr1608, %add.ptr1603
+  %r.17193 = phi ptr [ %incdec.ptr1608, %for.body ], [ null, %preheader ]
+  %incdec.ptr1608 = getelementptr i8, ptr %r.17193, i64 1
+  %cmp1604 = icmp ult ptr %incdec.ptr1608, %add.ptr1603
   br i1 %cmp1604, label %for.body, label %for.end1609
 
 for.end1609:

diff  --git a/llvm/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll b/llvm/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll
index a53df53b8e6b2..3e660bd6f2d20 100644
--- a/llvm/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll
+++ b/llvm/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll
@@ -6,27 +6,27 @@
 ; folded away aggressively if spelled out in IR directly.
 ; PR 20093
 
- at c = external global i32**, align 8
+ at c = external global ptr, align 8
 
 define void @test1() {
 entry:
   br i1 undef, label %for.end12, label %for.cond.preheader
 
 for.cond.preheader:                               ; preds = %entry
-  %0 = load i32**, i32*** @c, align 8
-  %1 = load i32*, i32** %0, align 8
-  %2 = load i32, i32* %1, align 4
+  %0 = load ptr, ptr @c, align 8
+  %1 = load ptr, ptr %0, align 8
+  %2 = load i32, ptr %1, align 4
   br label %for.body
 
 for.body:                                         ; preds = %for.cond.backedge, %for.body9.us, %for.cond.preheader
-  %3 = phi i32* [ %1, %for.cond.preheader ], [ %3, %for.cond.backedge ], [ %6, %for.body9.us ]
+  %3 = phi ptr [ %1, %for.cond.preheader ], [ %3, %for.cond.backedge ], [ %6, %for.body9.us ]
   %4 = phi i32 [ %2, %for.cond.preheader ], [ undef, %for.cond.backedge ], [ %7, %for.body9.us ]
   %i.024 = phi i32 [ 0, %for.cond.preheader ], [ %inc, %for.cond.backedge ], [ 0, %for.body9.us ]
   %tobool1 = icmp eq i32 %4, 0
   br i1 %tobool1, label %if.end, label %for.cond.backedge
 
 if.end:                                           ; preds = %for.body
-  %5 = load i32, i32* %3, align 4
+  %5 = load i32, ptr %3, align 4
   %tobool4 = icmp eq i32 %5, 0
   br i1 %tobool4, label %for.cond3, label %for.body9.preheader
 
@@ -35,8 +35,8 @@ for.body9.preheader:                              ; preds = %if.end
   br i1 %tobool8, label %for.body9.us, label %for.body9
 
 for.body9.us:                                     ; preds = %for.body9.preheader
-  %6 = load i32*, i32** undef, align 8
-  %7 = load i32, i32* %6, align 4
+  %6 = load ptr, ptr undef, align 8
+  %7 = load i32, ptr %6, align 4
   br label %for.body
 
 for.cond3:                                        ; preds = %for.cond3, %if.end

diff  --git a/llvm/test/Transforms/IndVarSimplify/AMDGPU/no-widen-to-i64.ll b/llvm/test/Transforms/IndVarSimplify/AMDGPU/no-widen-to-i64.ll
index c537a912c8bfe..5118d95ab633c 100644
--- a/llvm/test/Transforms/IndVarSimplify/AMDGPU/no-widen-to-i64.ll
+++ b/llvm/test/Transforms/IndVarSimplify/AMDGPU/no-widen-to-i64.ll
@@ -14,7 +14,7 @@ target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:3
 ; CHECK-LABEL: @indvar_32_bit(
 ; CHECK-NOT: sext i32
 ; CHECK: phi i32
-define amdgpu_kernel void @indvar_32_bit(i32 %n, i32* nocapture %output) {
+define amdgpu_kernel void @indvar_32_bit(i32 %n, ptr nocapture %output) {
 entry:
   %cmp5 = icmp sgt i32 %n, 0
   br i1 %cmp5, label %for.body.preheader, label %for.end
@@ -26,8 +26,8 @@ for.body:                                         ; preds = %for.body.preheader,
   %i.06 = phi i32 [ 0, %for.body.preheader ], [ %add, %for.body ]
   %mul = mul nsw i32 %i.06, %i.06
   %tmp0 = sext i32 %i.06 to i64
-  %arrayidx = getelementptr inbounds i32, i32* %output, i64 %tmp0
-  store i32 %mul, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %output, i64 %tmp0
+  store i32 %mul, ptr %arrayidx, align 4
   %add = add nsw i32 %i.06, 3
   %cmp = icmp slt i32 %add, %n
   br i1 %cmp, label %for.body, label %for.end.loopexit
@@ -46,7 +46,7 @@ for.end:                                          ; preds = %for.end.loopexit, %
 ; CHECK-NOT: ashr i64
 ; CHECK-NOT: mul nsw i64
 ; CHECK-NOT: add nsw i64
-define amdgpu_kernel void @no_promote_i32(i32 addrspace(1)* %out, i32 %a, i32 %b) {
+define amdgpu_kernel void @no_promote_i32(ptr addrspace(1) %out, i32 %a, i32 %b) {
 entry:
   br label %for.body
 
@@ -58,8 +58,8 @@ for.body:
   %mul = mul nsw i32 %shr, %a
   %add = add nsw i32 %mul, %b
   %tmp1 = sext i32 %add to i64
-  %arrayidx1 = getelementptr inbounds i32, i32 addrspace(1)* %out, i64 %tmp1
-  store i32 %tmp0, i32 addrspace(1)* %arrayidx1, align 4
+  %arrayidx1 = getelementptr inbounds i32, ptr addrspace(1) %out, i64 %tmp1
+  store i32 %tmp0, ptr addrspace(1) %arrayidx1, align 4
   %inc.i = add nsw i32 %inc, 1
   %cmp = icmp slt i32 %inc.i, 16
   br i1 %cmp, label %for.body, label %for.end
@@ -72,7 +72,7 @@ for.end:
 ; be legalized anyway.
 
 ; CHECK-LABEL: @indvar_48_bit(
-define amdgpu_kernel void @indvar_48_bit(i48 %n, i48* nocapture %output) {
+define amdgpu_kernel void @indvar_48_bit(i48 %n, ptr nocapture %output) {
 entry:
   %cmp5 = icmp sgt i48 %n, 0
   br i1 %cmp5, label %for.body.preheader, label %for.end
@@ -84,8 +84,8 @@ for.body:                                         ; preds = %for.body.preheader,
   %i.06 = phi i48 [ 0, %for.body.preheader ], [ %add, %for.body ]
   %mul = mul nsw i48 %i.06, %i.06
   %tmp0 = sext i48 %i.06 to i64
-  %arrayidx = getelementptr inbounds i48, i48* %output, i64 %tmp0
-  store i48 %mul, i48* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i48, ptr %output, i64 %tmp0
+  store i48 %mul, ptr %arrayidx, align 4
   %add = add nsw i48 %i.06, 3
   %cmp = icmp slt i48 %add, %n
   br i1 %cmp, label %for.body, label %for.end.loopexit

diff  --git a/llvm/test/Transforms/IndVarSimplify/D108043.ll b/llvm/test/Transforms/IndVarSimplify/D108043.ll
index 452c391251fd4..ca5d2a6d307dd 100644
--- a/llvm/test/Transforms/IndVarSimplify/D108043.ll
+++ b/llvm/test/Transforms/IndVarSimplify/D108043.ll
@@ -2,14 +2,14 @@
 ; RUN: opt -passes=indvars -S %s | FileCheck %s
 
 @g_2168 = external global [4 x [6 x i32]], align 16
- at g_1150 = external global i32*, align 8
+ at g_1150 = external global ptr, align 8
 
 define internal fastcc void @func_2() unnamed_addr {
 ; CHECK-LABEL: @func_2(
 ; CHECK-NEXT:  lbl_2898.preheader:
 ; CHECK-NEXT:    br label [[LBL_2898:%.*]]
 ; CHECK:       lbl_2898.loopexit:
-; CHECK-NEXT:    store i32* getelementptr inbounds ([4 x [6 x i32]], [4 x [6 x i32]]* @g_2168, i64 0, i64 3, i64 1), i32** @g_1150, align 8
+; CHECK-NEXT:    store ptr getelementptr (i8, ptr @g_2168, i64 76), ptr @g_1150, align 8
 ; CHECK-NEXT:    br label [[LBL_2898]]
 ; CHECK:       lbl_2898:
 ; CHECK-NEXT:    br label [[FOR_COND884:%.*]]
@@ -30,16 +30,16 @@ lbl_2898.preheader:
   br label %lbl_2898
 
 lbl_2898.loopexit:
-  %.lcssa = phi i32* [ %0, %for.cond884 ]
-  store i32* %.lcssa, i32** @g_1150, align 8
+  %.lcssa = phi ptr [ %0, %for.cond884 ]
+  store ptr %.lcssa, ptr @g_1150, align 8
   br label %lbl_2898
 
 lbl_2898:
-  %g_1150.promoted = load i32*, i32** @g_1150, align 8
+  %g_1150.promoted = load ptr, ptr @g_1150, align 8
   br label %for.cond884
 
 for.cond884:
-  %0 = phi i32* [ getelementptr inbounds ([4 x [6 x i32]], [4 x [6 x i32]]* @g_2168, i64 0, i64 3, i64 1), %for.end987 ], [ %g_1150.promoted, %lbl_2898 ]
+  %0 = phi ptr [ getelementptr inbounds ([4 x [6 x i32]], ptr @g_2168, i64 0, i64 3, i64 1), %for.end987 ], [ %g_1150.promoted, %lbl_2898 ]
   %storemerge9 = phi i16 [ %add990, %for.end987 ], [ 0, %lbl_2898 ]
   %cmp886 = icmp slt i16 %storemerge9, 3
   br i1 %cmp886, label %for.body888, label %lbl_2898.loopexit

diff  --git a/llvm/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll b/llvm/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll
index 9ba2ed0197979..2644f0676def4 100644
--- a/llvm/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll
+++ b/llvm/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll
@@ -9,7 +9,7 @@ target triple = "nvptx64-unknown-unknown"
 ; variables to 64-bit integers even though i64 is a legal type in the 64-bit
 ; PTX ISA.
 
-define void @indvar_32_bit(i32 %n, i32* nocapture %output) {
+define void @indvar_32_bit(i32 %n, ptr nocapture %output) {
 ; CHECK-LABEL: @indvar_32_bit
 entry:
   %cmp5 = icmp sgt i32 %n, 0
@@ -23,8 +23,8 @@ for.body:                                         ; preds = %for.body.preheader,
 ; CHECK: phi i32
   %mul = mul nsw i32 %i.06, %i.06
   %0 = sext i32 %i.06 to i64
-  %arrayidx = getelementptr inbounds i32, i32* %output, i64 %0
-  store i32 %mul, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %output, i64 %0
+  store i32 %mul, ptr %arrayidx, align 4
   %add = add nsw i32 %i.06, 3
   %cmp = icmp slt i32 %add, %n
   br i1 %cmp, label %for.body, label %for.end.loopexit

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/2009-04-14-shorten_iv_vars.ll b/llvm/test/Transforms/IndVarSimplify/X86/2009-04-14-shorten_iv_vars.ll
index 3aff3e1046d75..50e9aeb7afb39 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/2009-04-14-shorten_iv_vars.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/2009-04-14-shorten_iv_vars.ll
@@ -2,12 +2,12 @@
 ; ModuleID = '<stdin>'
 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-n32:64"
 target triple = "x86_64-apple-darwin9.6"
- at a = external global i32*		; <i32**> [#uses=3]
- at b = external global i32*		; <i32**> [#uses=3]
- at c = external global i32*		; <i32**> [#uses=3]
- at d = external global i32*		; <i32**> [#uses=3]
- at e = external global i32*		; <i32**> [#uses=3]
- at f = external global i32*		; <i32**> [#uses=3]
+ at a = external global ptr		; <ptr> [#uses=3]
+ at b = external global ptr		; <ptr> [#uses=3]
+ at c = external global ptr		; <ptr> [#uses=3]
+ at d = external global ptr		; <ptr> [#uses=3]
+ at e = external global ptr		; <ptr> [#uses=3]
+ at f = external global ptr		; <ptr> [#uses=3]
 
 define void @foo() nounwind {
 ; CHECK-LABEL: @foo(
@@ -17,96 +17,96 @@ bb1.thread:
 
 bb1:		; preds = %bb1, %bb1.thread
 	%i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %84, %bb1 ]		; <i32> [#uses=19]
-	%0 = load i32*, i32** @a, align 8		; <i32*> [#uses=1]
-	%1 = load i32*, i32** @b, align 8		; <i32*> [#uses=1]
+	%0 = load ptr, ptr @a, align 8		; <ptr> [#uses=1]
+	%1 = load ptr, ptr @b, align 8		; <ptr> [#uses=1]
 	%2 = sext i32 %i.0.reg2mem.0 to i64		; <i64> [#uses=1]
-	%3 = getelementptr i32, i32* %1, i64 %2		; <i32*> [#uses=1]
-	%4 = load i32, i32* %3, align 1		; <i32> [#uses=1]
-	%5 = load i32*, i32** @c, align 8		; <i32*> [#uses=1]
+	%3 = getelementptr i32, ptr %1, i64 %2		; <ptr> [#uses=1]
+	%4 = load i32, ptr %3, align 1		; <i32> [#uses=1]
+	%5 = load ptr, ptr @c, align 8		; <ptr> [#uses=1]
 	%6 = sext i32 %i.0.reg2mem.0 to i64		; <i64> [#uses=1]
-	%7 = getelementptr i32, i32* %5, i64 %6		; <i32*> [#uses=1]
-	%8 = load i32, i32* %7, align 1		; <i32> [#uses=1]
+	%7 = getelementptr i32, ptr %5, i64 %6		; <ptr> [#uses=1]
+	%8 = load i32, ptr %7, align 1		; <i32> [#uses=1]
 	%9 = add i32 %8, %4		; <i32> [#uses=1]
 	%10 = sext i32 %i.0.reg2mem.0 to i64		; <i64> [#uses=1]
-	%11 = getelementptr i32, i32* %0, i64 %10		; <i32*> [#uses=1]
-	store i32 %9, i32* %11, align 1
-	%12 = load i32*, i32** @a, align 8		; <i32*> [#uses=1]
+	%11 = getelementptr i32, ptr %0, i64 %10		; <ptr> [#uses=1]
+	store i32 %9, ptr %11, align 1
+	%12 = load ptr, ptr @a, align 8		; <ptr> [#uses=1]
 	%13 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
-	%14 = load i32*, i32** @b, align 8		; <i32*> [#uses=1]
+	%14 = load ptr, ptr @b, align 8		; <ptr> [#uses=1]
 	%15 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%16 = sext i32 %15 to i64		; <i64> [#uses=1]
-	%17 = getelementptr i32, i32* %14, i64 %16		; <i32*> [#uses=1]
-	%18 = load i32, i32* %17, align 1		; <i32> [#uses=1]
-	%19 = load i32*, i32** @c, align 8		; <i32*> [#uses=1]
+	%17 = getelementptr i32, ptr %14, i64 %16		; <ptr> [#uses=1]
+	%18 = load i32, ptr %17, align 1		; <i32> [#uses=1]
+	%19 = load ptr, ptr @c, align 8		; <ptr> [#uses=1]
 	%20 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%21 = sext i32 %20 to i64		; <i64> [#uses=1]
-	%22 = getelementptr i32, i32* %19, i64 %21		; <i32*> [#uses=1]
-	%23 = load i32, i32* %22, align 1		; <i32> [#uses=1]
+	%22 = getelementptr i32, ptr %19, i64 %21		; <ptr> [#uses=1]
+	%23 = load i32, ptr %22, align 1		; <i32> [#uses=1]
 	%24 = add i32 %23, %18		; <i32> [#uses=1]
 	%25 = sext i32 %13 to i64		; <i64> [#uses=1]
-	%26 = getelementptr i32, i32* %12, i64 %25		; <i32*> [#uses=1]
-	store i32 %24, i32* %26, align 1
-	%27 = load i32*, i32** @a, align 8		; <i32*> [#uses=1]
+	%26 = getelementptr i32, ptr %12, i64 %25		; <ptr> [#uses=1]
+	store i32 %24, ptr %26, align 1
+	%27 = load ptr, ptr @a, align 8		; <ptr> [#uses=1]
 	%28 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
-	%29 = load i32*, i32** @b, align 8		; <i32*> [#uses=1]
+	%29 = load ptr, ptr @b, align 8		; <ptr> [#uses=1]
 	%30 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%31 = sext i32 %30 to i64		; <i64> [#uses=1]
-	%32 = getelementptr i32, i32* %29, i64 %31		; <i32*> [#uses=1]
-	%33 = load i32, i32* %32, align 1		; <i32> [#uses=1]
-	%34 = load i32*, i32** @c, align 8		; <i32*> [#uses=1]
+	%32 = getelementptr i32, ptr %29, i64 %31		; <ptr> [#uses=1]
+	%33 = load i32, ptr %32, align 1		; <i32> [#uses=1]
+	%34 = load ptr, ptr @c, align 8		; <ptr> [#uses=1]
 	%35 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%36 = sext i32 %35 to i64		; <i64> [#uses=1]
-	%37 = getelementptr i32, i32* %34, i64 %36		; <i32*> [#uses=1]
-	%38 = load i32, i32* %37, align 1		; <i32> [#uses=1]
+	%37 = getelementptr i32, ptr %34, i64 %36		; <ptr> [#uses=1]
+	%38 = load i32, ptr %37, align 1		; <i32> [#uses=1]
 	%39 = add i32 %38, %33		; <i32> [#uses=1]
 	%40 = sext i32 %28 to i64		; <i64> [#uses=1]
-	%41 = getelementptr i32, i32* %27, i64 %40		; <i32*> [#uses=1]
-	store i32 %39, i32* %41, align 1
-	%42 = load i32*, i32** @d, align 8		; <i32*> [#uses=1]
-	%43 = load i32*, i32** @e, align 8		; <i32*> [#uses=1]
+	%41 = getelementptr i32, ptr %27, i64 %40		; <ptr> [#uses=1]
+	store i32 %39, ptr %41, align 1
+	%42 = load ptr, ptr @d, align 8		; <ptr> [#uses=1]
+	%43 = load ptr, ptr @e, align 8		; <ptr> [#uses=1]
 	%44 = sext i32 %i.0.reg2mem.0 to i64		; <i64> [#uses=1]
-	%45 = getelementptr i32, i32* %43, i64 %44		; <i32*> [#uses=1]
-	%46 = load i32, i32* %45, align 1		; <i32> [#uses=1]
-	%47 = load i32*, i32** @f, align 8		; <i32*> [#uses=1]
+	%45 = getelementptr i32, ptr %43, i64 %44		; <ptr> [#uses=1]
+	%46 = load i32, ptr %45, align 1		; <i32> [#uses=1]
+	%47 = load ptr, ptr @f, align 8		; <ptr> [#uses=1]
 	%48 = sext i32 %i.0.reg2mem.0 to i64		; <i64> [#uses=1]
-	%49 = getelementptr i32, i32* %47, i64 %48		; <i32*> [#uses=1]
-	%50 = load i32, i32* %49, align 1		; <i32> [#uses=1]
+	%49 = getelementptr i32, ptr %47, i64 %48		; <ptr> [#uses=1]
+	%50 = load i32, ptr %49, align 1		; <i32> [#uses=1]
 	%51 = add i32 %50, %46		; <i32> [#uses=1]
 	%52 = sext i32 %i.0.reg2mem.0 to i64		; <i64> [#uses=1]
-	%53 = getelementptr i32, i32* %42, i64 %52		; <i32*> [#uses=1]
-	store i32 %51, i32* %53, align 1
-	%54 = load i32*, i32** @d, align 8		; <i32*> [#uses=1]
+	%53 = getelementptr i32, ptr %42, i64 %52		; <ptr> [#uses=1]
+	store i32 %51, ptr %53, align 1
+	%54 = load ptr, ptr @d, align 8		; <ptr> [#uses=1]
 	%55 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
-	%56 = load i32*, i32** @e, align 8		; <i32*> [#uses=1]
+	%56 = load ptr, ptr @e, align 8		; <ptr> [#uses=1]
 	%57 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%58 = sext i32 %57 to i64		; <i64> [#uses=1]
-	%59 = getelementptr i32, i32* %56, i64 %58		; <i32*> [#uses=1]
-	%60 = load i32, i32* %59, align 1		; <i32> [#uses=1]
-	%61 = load i32*, i32** @f, align 8		; <i32*> [#uses=1]
+	%59 = getelementptr i32, ptr %56, i64 %58		; <ptr> [#uses=1]
+	%60 = load i32, ptr %59, align 1		; <i32> [#uses=1]
+	%61 = load ptr, ptr @f, align 8		; <ptr> [#uses=1]
 	%62 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%63 = sext i32 %62 to i64		; <i64> [#uses=1]
-	%64 = getelementptr i32, i32* %61, i64 %63		; <i32*> [#uses=1]
-	%65 = load i32, i32* %64, align 1		; <i32> [#uses=1]
+	%64 = getelementptr i32, ptr %61, i64 %63		; <ptr> [#uses=1]
+	%65 = load i32, ptr %64, align 1		; <i32> [#uses=1]
 	%66 = add i32 %65, %60		; <i32> [#uses=1]
 	%67 = sext i32 %55 to i64		; <i64> [#uses=1]
-	%68 = getelementptr i32, i32* %54, i64 %67		; <i32*> [#uses=1]
-	store i32 %66, i32* %68, align 1
-	%69 = load i32*, i32** @d, align 8		; <i32*> [#uses=1]
+	%68 = getelementptr i32, ptr %54, i64 %67		; <ptr> [#uses=1]
+	store i32 %66, ptr %68, align 1
+	%69 = load ptr, ptr @d, align 8		; <ptr> [#uses=1]
 	%70 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
-	%71 = load i32*, i32** @e, align 8		; <i32*> [#uses=1]
+	%71 = load ptr, ptr @e, align 8		; <ptr> [#uses=1]
 	%72 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%73 = sext i32 %72 to i64		; <i64> [#uses=1]
-	%74 = getelementptr i32, i32* %71, i64 %73		; <i32*> [#uses=1]
-	%75 = load i32, i32* %74, align 1		; <i32> [#uses=1]
-	%76 = load i32*, i32** @f, align 8		; <i32*> [#uses=1]
+	%74 = getelementptr i32, ptr %71, i64 %73		; <ptr> [#uses=1]
+	%75 = load i32, ptr %74, align 1		; <i32> [#uses=1]
+	%76 = load ptr, ptr @f, align 8		; <ptr> [#uses=1]
 	%77 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%78 = sext i32 %77 to i64		; <i64> [#uses=1]
-	%79 = getelementptr i32, i32* %76, i64 %78		; <i32*> [#uses=1]
-	%80 = load i32, i32* %79, align 1		; <i32> [#uses=1]
+	%79 = getelementptr i32, ptr %76, i64 %78		; <ptr> [#uses=1]
+	%80 = load i32, ptr %79, align 1		; <i32> [#uses=1]
 	%81 = add i32 %80, %75		; <i32> [#uses=1]
 	%82 = sext i32 %70 to i64		; <i64> [#uses=1]
-	%83 = getelementptr i32, i32* %69, i64 %82		; <i32*> [#uses=1]
-	store i32 %81, i32* %83, align 1
+	%83 = getelementptr i32, ptr %69, i64 %82		; <ptr> [#uses=1]
+	store i32 %81, ptr %83, align 1
 	%84 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=2]
 	%85 = icmp sgt i32 %84, 23646		; <i1> [#uses=1]
 	br i1 %85, label %return, label %bb1

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/2009-04-15-shorten-iv-vars-2.ll b/llvm/test/Transforms/IndVarSimplify/X86/2009-04-15-shorten-iv-vars-2.ll
index 1e98a65fbe828..b837b59dbc9fc 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/2009-04-15-shorten-iv-vars-2.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/2009-04-15-shorten-iv-vars-2.ll
@@ -15,13 +15,13 @@
 ;}
 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-n32:64"
 target triple = "x86_64-apple-darwin9.6"
- at a = external global i32*		; <i32**> [#uses=3]
- at b = external global i32*		; <i32**> [#uses=3]
- at c = external global i32*		; <i32**> [#uses=3]
- at d = external global i32*		; <i32**> [#uses=3]
- at e = external global i32*		; <i32**> [#uses=3]
- at f = external global i32*		; <i32**> [#uses=3]
- at K = external global [256 x i32]		; <[256 x i32]*> [#uses=3]
+ at a = external global ptr		; <ptr> [#uses=3]
+ at b = external global ptr		; <ptr> [#uses=3]
+ at c = external global ptr		; <ptr> [#uses=3]
+ at d = external global ptr		; <ptr> [#uses=3]
+ at e = external global ptr		; <ptr> [#uses=3]
+ at f = external global ptr		; <ptr> [#uses=3]
+ at K = external global [256 x i32]		; <ptr> [#uses=3]
 
 define void @foo() nounwind {
 ; CHECK-LABEL: @foo(
@@ -32,128 +32,128 @@ bb1.thread:
 
 bb1:		; preds = %bb1, %bb1.thread
 	%i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %116, %bb1 ]		; <i32> [#uses=22]
-	%0 = load i32*, i32** @a, align 8		; <i32*> [#uses=1]
+	%0 = load ptr, ptr @a, align 8		; <ptr> [#uses=1]
 	%1 = and i32 %i.0.reg2mem.0, 15		; <i32> [#uses=1]
-	%2 = load i32*, i32** @b, align 8		; <i32*> [#uses=1]
+	%2 = load ptr, ptr @b, align 8		; <ptr> [#uses=1]
 	%3 = and i32 %i.0.reg2mem.0, 15		; <i32> [#uses=1]
 	%4 = zext i32 %3 to i64		; <i64> [#uses=1]
-	%5 = getelementptr i32, i32* %2, i64 %4		; <i32*> [#uses=1]
-	%6 = load i32, i32* %5, align 1		; <i32> [#uses=1]
-	%7 = load i32*, i32** @c, align 8		; <i32*> [#uses=1]
+	%5 = getelementptr i32, ptr %2, i64 %4		; <ptr> [#uses=1]
+	%6 = load i32, ptr %5, align 1		; <i32> [#uses=1]
+	%7 = load ptr, ptr @c, align 8		; <ptr> [#uses=1]
 	%8 = and i32 %i.0.reg2mem.0, 15		; <i32> [#uses=1]
 	%9 = zext i32 %8 to i64		; <i64> [#uses=1]
-	%10 = getelementptr i32, i32* %7, i64 %9		; <i32*> [#uses=1]
-	%11 = load i32, i32* %10, align 1		; <i32> [#uses=1]
+	%10 = getelementptr i32, ptr %7, i64 %9		; <ptr> [#uses=1]
+	%11 = load i32, ptr %10, align 1		; <i32> [#uses=1]
 	%12 = add i32 %11, %6		; <i32> [#uses=1]
 	%13 = zext i32 %1 to i64		; <i64> [#uses=1]
-	%14 = getelementptr i32, i32* %0, i64 %13		; <i32*> [#uses=1]
-	store i32 %12, i32* %14, align 1
-	%15 = load i32*, i32** @a, align 8		; <i32*> [#uses=1]
+	%14 = getelementptr i32, ptr %0, i64 %13		; <ptr> [#uses=1]
+	store i32 %12, ptr %14, align 1
+	%15 = load ptr, ptr @a, align 8		; <ptr> [#uses=1]
 	%16 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%17 = and i32 %16, 15		; <i32> [#uses=1]
-	%18 = load i32*, i32** @b, align 8		; <i32*> [#uses=1]
+	%18 = load ptr, ptr @b, align 8		; <ptr> [#uses=1]
 	%19 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%20 = and i32 %19, 15		; <i32> [#uses=1]
 	%21 = zext i32 %20 to i64		; <i64> [#uses=1]
-	%22 = getelementptr i32, i32* %18, i64 %21		; <i32*> [#uses=1]
-	%23 = load i32, i32* %22, align 1		; <i32> [#uses=1]
-	%24 = load i32*, i32** @c, align 8		; <i32*> [#uses=1]
+	%22 = getelementptr i32, ptr %18, i64 %21		; <ptr> [#uses=1]
+	%23 = load i32, ptr %22, align 1		; <i32> [#uses=1]
+	%24 = load ptr, ptr @c, align 8		; <ptr> [#uses=1]
 	%25 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%26 = and i32 %25, 15		; <i32> [#uses=1]
 	%27 = zext i32 %26 to i64		; <i64> [#uses=1]
-	%28 = getelementptr i32, i32* %24, i64 %27		; <i32*> [#uses=1]
-	%29 = load i32, i32* %28, align 1		; <i32> [#uses=1]
+	%28 = getelementptr i32, ptr %24, i64 %27		; <ptr> [#uses=1]
+	%29 = load i32, ptr %28, align 1		; <i32> [#uses=1]
 	%30 = add i32 %29, %23		; <i32> [#uses=1]
 	%31 = zext i32 %17 to i64		; <i64> [#uses=1]
-	%32 = getelementptr i32, i32* %15, i64 %31		; <i32*> [#uses=1]
-	store i32 %30, i32* %32, align 1
-	%33 = load i32*, i32** @a, align 8		; <i32*> [#uses=1]
+	%32 = getelementptr i32, ptr %15, i64 %31		; <ptr> [#uses=1]
+	store i32 %30, ptr %32, align 1
+	%33 = load ptr, ptr @a, align 8		; <ptr> [#uses=1]
 	%34 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%35 = and i32 %34, 15		; <i32> [#uses=1]
-	%36 = load i32*, i32** @b, align 8		; <i32*> [#uses=1]
+	%36 = load ptr, ptr @b, align 8		; <ptr> [#uses=1]
 	%37 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%38 = and i32 %37, 15		; <i32> [#uses=1]
 	%39 = zext i32 %38 to i64		; <i64> [#uses=1]
-	%40 = getelementptr i32, i32* %36, i64 %39		; <i32*> [#uses=1]
-	%41 = load i32, i32* %40, align 1		; <i32> [#uses=1]
-	%42 = load i32*, i32** @c, align 8		; <i32*> [#uses=1]
+	%40 = getelementptr i32, ptr %36, i64 %39		; <ptr> [#uses=1]
+	%41 = load i32, ptr %40, align 1		; <i32> [#uses=1]
+	%42 = load ptr, ptr @c, align 8		; <ptr> [#uses=1]
 	%43 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%44 = and i32 %43, 15		; <i32> [#uses=1]
 	%45 = zext i32 %44 to i64		; <i64> [#uses=1]
-	%46 = getelementptr i32, i32* %42, i64 %45		; <i32*> [#uses=1]
-	%47 = load i32, i32* %46, align 1		; <i32> [#uses=1]
+	%46 = getelementptr i32, ptr %42, i64 %45		; <ptr> [#uses=1]
+	%47 = load i32, ptr %46, align 1		; <i32> [#uses=1]
 	%48 = add i32 %47, %41		; <i32> [#uses=1]
 	%49 = zext i32 %35 to i64		; <i64> [#uses=1]
-	%50 = getelementptr i32, i32* %33, i64 %49		; <i32*> [#uses=1]
-	store i32 %48, i32* %50, align 1
-	%51 = load i32*, i32** @d, align 8		; <i32*> [#uses=1]
+	%50 = getelementptr i32, ptr %33, i64 %49		; <ptr> [#uses=1]
+	store i32 %48, ptr %50, align 1
+	%51 = load ptr, ptr @d, align 8		; <ptr> [#uses=1]
 	%52 = and i32 %i.0.reg2mem.0, 15		; <i32> [#uses=1]
-	%53 = load i32*, i32** @e, align 8		; <i32*> [#uses=1]
+	%53 = load ptr, ptr @e, align 8		; <ptr> [#uses=1]
 	%54 = and i32 %i.0.reg2mem.0, 15		; <i32> [#uses=1]
 	%55 = zext i32 %54 to i64		; <i64> [#uses=1]
-	%56 = getelementptr i32, i32* %53, i64 %55		; <i32*> [#uses=1]
-	%57 = load i32, i32* %56, align 1		; <i32> [#uses=1]
-	%58 = load i32*, i32** @f, align 8		; <i32*> [#uses=1]
+	%56 = getelementptr i32, ptr %53, i64 %55		; <ptr> [#uses=1]
+	%57 = load i32, ptr %56, align 1		; <i32> [#uses=1]
+	%58 = load ptr, ptr @f, align 8		; <ptr> [#uses=1]
 	%59 = and i32 %i.0.reg2mem.0, 15		; <i32> [#uses=1]
 	%60 = zext i32 %59 to i64		; <i64> [#uses=1]
-	%61 = getelementptr i32, i32* %58, i64 %60		; <i32*> [#uses=1]
-	%62 = load i32, i32* %61, align 1		; <i32> [#uses=1]
+	%61 = getelementptr i32, ptr %58, i64 %60		; <ptr> [#uses=1]
+	%62 = load i32, ptr %61, align 1		; <i32> [#uses=1]
 	%63 = sext i32 %i.0.reg2mem.0 to i64		; <i64> [#uses=1]
-	%64 = getelementptr [256 x i32], [256 x i32]* @K, i64 0, i64 %63		; <i32*> [#uses=1]
-	%65 = load i32, i32* %64, align 4		; <i32> [#uses=1]
+	%64 = getelementptr [256 x i32], ptr @K, i64 0, i64 %63		; <ptr> [#uses=1]
+	%65 = load i32, ptr %64, align 4		; <i32> [#uses=1]
 	%66 = add i32 %62, %57		; <i32> [#uses=1]
 	%67 = add i32 %66, %65		; <i32> [#uses=1]
 	%68 = zext i32 %52 to i64		; <i64> [#uses=1]
-	%69 = getelementptr i32, i32* %51, i64 %68		; <i32*> [#uses=1]
-	store i32 %67, i32* %69, align 1
-	%70 = load i32*, i32** @d, align 8		; <i32*> [#uses=1]
+	%69 = getelementptr i32, ptr %51, i64 %68		; <ptr> [#uses=1]
+	store i32 %67, ptr %69, align 1
+	%70 = load ptr, ptr @d, align 8		; <ptr> [#uses=1]
 	%71 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%72 = and i32 %71, 15		; <i32> [#uses=1]
-	%73 = load i32*, i32** @e, align 8		; <i32*> [#uses=1]
+	%73 = load ptr, ptr @e, align 8		; <ptr> [#uses=1]
 	%74 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%75 = and i32 %74, 15		; <i32> [#uses=1]
 	%76 = zext i32 %75 to i64		; <i64> [#uses=1]
-	%77 = getelementptr i32, i32* %73, i64 %76		; <i32*> [#uses=1]
-	%78 = load i32, i32* %77, align 1		; <i32> [#uses=1]
-	%79 = load i32*, i32** @f, align 8		; <i32*> [#uses=1]
+	%77 = getelementptr i32, ptr %73, i64 %76		; <ptr> [#uses=1]
+	%78 = load i32, ptr %77, align 1		; <i32> [#uses=1]
+	%79 = load ptr, ptr @f, align 8		; <ptr> [#uses=1]
 	%80 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%81 = and i32 %80, 15		; <i32> [#uses=1]
 	%82 = zext i32 %81 to i64		; <i64> [#uses=1]
-	%83 = getelementptr i32, i32* %79, i64 %82		; <i32*> [#uses=1]
-	%84 = load i32, i32* %83, align 1		; <i32> [#uses=1]
+	%83 = getelementptr i32, ptr %79, i64 %82		; <ptr> [#uses=1]
+	%84 = load i32, ptr %83, align 1		; <i32> [#uses=1]
 	%85 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=1]
 	%86 = sext i32 %85 to i64		; <i64> [#uses=1]
-	%87 = getelementptr [256 x i32], [256 x i32]* @K, i64 0, i64 %86		; <i32*> [#uses=1]
-	%88 = load i32, i32* %87, align 4		; <i32> [#uses=1]
+	%87 = getelementptr [256 x i32], ptr @K, i64 0, i64 %86		; <ptr> [#uses=1]
+	%88 = load i32, ptr %87, align 4		; <i32> [#uses=1]
 	%89 = add i32 %84, %78		; <i32> [#uses=1]
 	%90 = add i32 %89, %88		; <i32> [#uses=1]
 	%91 = zext i32 %72 to i64		; <i64> [#uses=1]
-	%92 = getelementptr i32, i32* %70, i64 %91		; <i32*> [#uses=1]
-	store i32 %90, i32* %92, align 1
-	%93 = load i32*, i32** @d, align 8		; <i32*> [#uses=1]
+	%92 = getelementptr i32, ptr %70, i64 %91		; <ptr> [#uses=1]
+	store i32 %90, ptr %92, align 1
+	%93 = load ptr, ptr @d, align 8		; <ptr> [#uses=1]
 	%94 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%95 = and i32 %94, 15		; <i32> [#uses=1]
-	%96 = load i32*, i32** @e, align 8		; <i32*> [#uses=1]
+	%96 = load ptr, ptr @e, align 8		; <ptr> [#uses=1]
 	%97 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%98 = and i32 %97, 15		; <i32> [#uses=1]
 	%99 = zext i32 %98 to i64		; <i64> [#uses=1]
-	%100 = getelementptr i32, i32* %96, i64 %99		; <i32*> [#uses=1]
-	%101 = load i32, i32* %100, align 1		; <i32> [#uses=1]
-	%102 = load i32*, i32** @f, align 8		; <i32*> [#uses=1]
+	%100 = getelementptr i32, ptr %96, i64 %99		; <ptr> [#uses=1]
+	%101 = load i32, ptr %100, align 1		; <i32> [#uses=1]
+	%102 = load ptr, ptr @f, align 8		; <ptr> [#uses=1]
 	%103 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%104 = and i32 %103, 15		; <i32> [#uses=1]
 	%105 = zext i32 %104 to i64		; <i64> [#uses=1]
-	%106 = getelementptr i32, i32* %102, i64 %105		; <i32*> [#uses=1]
-	%107 = load i32, i32* %106, align 1		; <i32> [#uses=1]
+	%106 = getelementptr i32, ptr %102, i64 %105		; <ptr> [#uses=1]
+	%107 = load i32, ptr %106, align 1		; <i32> [#uses=1]
 	%108 = add i32 %i.0.reg2mem.0, 2		; <i32> [#uses=1]
 	%109 = sext i32 %108 to i64		; <i64> [#uses=1]
-	%110 = getelementptr [256 x i32], [256 x i32]* @K, i64 0, i64 %109		; <i32*> [#uses=1]
-	%111 = load i32, i32* %110, align 4		; <i32> [#uses=1]
+	%110 = getelementptr [256 x i32], ptr @K, i64 0, i64 %109		; <ptr> [#uses=1]
+	%111 = load i32, ptr %110, align 4		; <i32> [#uses=1]
 	%112 = add i32 %107, %101		; <i32> [#uses=1]
 	%113 = add i32 %112, %111		; <i32> [#uses=1]
 	%114 = zext i32 %95 to i64		; <i64> [#uses=1]
-	%115 = getelementptr i32, i32* %93, i64 %114		; <i32*> [#uses=1]
-	store i32 %113, i32* %115, align 1
+	%115 = getelementptr i32, ptr %93, i64 %114		; <ptr> [#uses=1]
+	store i32 %113, ptr %115, align 1
 	%116 = add i32 %i.0.reg2mem.0, 1		; <i32> [#uses=2]
 	%117 = icmp sgt i32 %116, 23646		; <i1> [#uses=1]
 	br i1 %117, label %return, label %bb1

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/2011-11-15-multiexit.ll b/llvm/test/Transforms/IndVarSimplify/X86/2011-11-15-multiexit.ll
index 76b5438b4d3c9..cd5bbd712c3e3 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/2011-11-15-multiexit.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/2011-11-15-multiexit.ll
@@ -10,8 +10,8 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 target triple = "x86_64-apple-darwin"
 
 ; CHECK: if.end:
-; CHECK: phi i32* [ %first.lcssa, %early.exit ]
-define i32 @test(i32* %first, i32* %last) uwtable ssp {
+; CHECK: phi ptr [ %first.lcssa, %early.exit ]
+define i32 @test(ptr %first, ptr %last) uwtable ssp {
 entry:
   br i1 undef, label %if.end, label %if.then
 
@@ -19,22 +19,22 @@ if.then:                                          ; preds = %entry
   br i1 undef, label %if.end, label %do.body
 
 do.body:                                          ; preds = %if.else, %if.then
-  %firstIV = phi i32* [ %incdec.ptr2, %if.else ], [ %first, %if.then ]
-  %incdec.ptr1 = getelementptr inbounds i32, i32* %firstIV, i64 1
-  %cmp1 = icmp eq i32* %incdec.ptr1, %last
+  %firstIV = phi ptr [ %incdec.ptr2, %if.else ], [ %first, %if.then ]
+  %incdec.ptr1 = getelementptr inbounds i32, ptr %firstIV, i64 1
+  %cmp1 = icmp eq ptr %incdec.ptr1, %last
   br i1 %cmp1, label %early.exit, label %if.else
 
 if.else:                                        ; preds = %do.body
-  %incdec.ptr2 = getelementptr inbounds i32, i32* %firstIV, i64 2
-  %cmp2 = icmp eq i32* %incdec.ptr2, %last
+  %incdec.ptr2 = getelementptr inbounds i32, ptr %firstIV, i64 2
+  %cmp2 = icmp eq ptr %incdec.ptr2, %last
   br i1 %cmp2, label %if.end, label %do.body
 
 early.exit:
-  %first.lcssa = phi i32* [ %firstIV, %do.body ]
+  %first.lcssa = phi ptr [ %firstIV, %do.body ]
   br label %if.end
 
 if.end:
-  %tmp = phi i32* [ %first.lcssa, %early.exit ], [ %first, %if.then ], [ %first, %entry ], [ undef, %if.else ]
-  %val = load i32, i32* %tmp
+  %tmp = phi ptr [ %first.lcssa, %early.exit ], [ %first, %if.then ], [ %first, %entry ], [ undef, %if.else ]
+  %val = load i32, ptr %tmp
   ret i32 %val
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/deterministic-scev-verify.ll b/llvm/test/Transforms/IndVarSimplify/X86/deterministic-scev-verify.ll
index e600d28fad987..fcc0e9d243fc6 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/deterministic-scev-verify.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/deterministic-scev-verify.ll
@@ -19,7 +19,7 @@ tmp0:
 
 tmp7:
   %tmp8 = add nuw nsw i32 %tmp13, 1
-  store i32 undef, i32* @b
+  store i32 undef, ptr @b
   br label %tmp12
 
 tmp12:

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/eliminate-trunc.ll b/llvm/test/Transforms/IndVarSimplify/X86/eliminate-trunc.ll
index d8f2d38e56978..de705bd14c467 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/eliminate-trunc.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/eliminate-trunc.ll
@@ -373,7 +373,7 @@ exit:
 }
 
 ; Do not eliminate trunc if it is used by something 
diff erent from icmp.
-define void @test_07(i32* %p, i32 %n) {
+define void @test_07(ptr %p, i32 %n) {
 ; CHECK-LABEL: @test_07(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[SMAX:%.*]] = call i32 @llvm.smax.i32(i32 [[N:%.*]], i32 0)
@@ -384,7 +384,7 @@ define void @test_07(i32* %p, i32 %n) {
 ; CHECK-NEXT:    [[IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i64 [[IV]], 1
 ; CHECK-NEXT:    [[NARROW_IV:%.*]] = trunc i64 [[IV]] to i32
-; CHECK-NEXT:    store i32 [[NARROW_IV]], i32* [[P:%.*]], align 4
+; CHECK-NEXT:    store i32 [[NARROW_IV]], ptr [[P:%.*]], align 4
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[IV_NEXT]], [[WIDE_TRIP_COUNT]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
 ; CHECK:       exit:
@@ -396,7 +396,7 @@ loop:
   %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
   %iv.next = add i64 %iv, 1
   %narrow.iv = trunc i64 %iv to i32
-  store i32 %narrow.iv, i32* %p
+  store i32 %narrow.iv, ptr %p
   %cmp = icmp slt i32 %narrow.iv, %n
   br i1 %cmp, label %loop, label %exit
 exit:
@@ -540,10 +540,10 @@ bb7:                                             ; preds = %bb6
 
 ; Show that we can turn signed comparison to unsigned and use zext while
 ; comparing non-negative values.
-define void @test_12(i32* %p) {
+define void @test_12(ptr %p) {
 ; CHECK-LABEL: @test_12(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[N:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT:    [[N:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0:![0-9]+]]
 ; CHECK-NEXT:    [[SMAX:%.*]] = call i32 @llvm.smax.i32(i32 [[N]], i32 1)
 ; CHECK-NEXT:    [[WIDE_TRIP_COUNT:%.*]] = zext i32 [[SMAX]] to i64
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
@@ -556,7 +556,7 @@ define void @test_12(i32* %p) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %n = load i32, i32* %p, !range !0
+  %n = load i32, ptr %p, !range !0
   br label %loop
 loop:
   %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/huge_muls.ll b/llvm/test/Transforms/IndVarSimplify/X86/huge_muls.ll
index 39f28dd63166e..4bd0bb993f054 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/huge_muls.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/huge_muls.ll
@@ -27,7 +27,7 @@ bci_55.postloop:                                  ; preds = %bci_90.postloop, %b
   %indvars.iv180.postloop = phi i64 [ %indvars.iv.next181.postloop, %bci_90.postloop ], [ 15, %bci_12 ]
   %local_2_16.postloop = phi i32 [ %tmp17, %bci_90.postloop ], [ 4, %bci_12 ]
   %indvars.iv.next181.postloop = add nuw nsw i64 %indvars.iv180.postloop, 1
-  %tmp6 = load i32, i32 addrspace(1)* undef, align 4
+  %tmp6 = load i32, ptr addrspace(1) undef, align 4
   %tmp7 = mul i32 %tmp6, %tmp1
   br label %not_zero65.us.postloop
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/indvar-debug-value.ll b/llvm/test/Transforms/IndVarSimplify/X86/indvar-debug-value.ll
index 4ef9ff9abf24b..8a9afb85ab7af 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/indvar-debug-value.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/indvar-debug-value.ll
@@ -28,7 +28,7 @@ target triple = "x86_64-unknown-linux-gnu"
 
 @.str = private unnamed_addr constant [20 x i8] c"\0A Argument %d:  %s\0A\00", align 1
 
-define dso_local i32 @main(i32 %argc, i8** %argv) !dbg !7 {
+define dso_local i32 @main(i32 %argc, ptr %argv) !dbg !7 {
 entry:
   call void @llvm.dbg.value(metadata i32 1, metadata !17, metadata !DIExpression()), !dbg !19
   %cmp1 = icmp slt i32 1, %argc, !dbg !19
@@ -47,9 +47,9 @@ for.body:                                         ; preds = %for.body.lr.ph, %fo
   %ArgIndex.02 = phi i32 [ 1, %for.body.lr.ph ], [ %add, %for.inc ]
   call void @llvm.dbg.value(metadata i32 %ArgIndex.02, metadata !17, metadata !DIExpression()), !dbg !19
   %idxprom = sext i32 %ArgIndex.02 to i64, !dbg !19
-  %arrayidx = getelementptr inbounds i8*, i8** %argv, i64 %idxprom, !dbg !19
-  %0 = load i8*, i8** %arrayidx, align 8, !dbg !19
-  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %ArgIndex.02, i8* %0), !dbg !19
+  %arrayidx = getelementptr inbounds ptr, ptr %argv, i64 %idxprom, !dbg !19
+  %0 = load ptr, ptr %arrayidx, align 8, !dbg !19
+  %call = call i32 (ptr, ...) @printf(ptr @.str, i32 %ArgIndex.02, ptr %0), !dbg !19
   br label %for.inc, !dbg !19
 
 for.inc:                                          ; preds = %for.body
@@ -62,7 +62,7 @@ for.end:                                          ; preds = %for.cond.cleanup
   ret i32 0, !dbg !19
 }
 
-declare dso_local i32 @printf(i8*, ...)
+declare dso_local i32 @printf(ptr, ...)
 
 declare void @llvm.dbg.value(metadata, metadata, metadata)
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/indvar-debug-value2.ll b/llvm/test/Transforms/IndVarSimplify/X86/indvar-debug-value2.ll
index 393e9684ec054..3b9b4b7e587a7 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/indvar-debug-value2.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/indvar-debug-value2.ll
@@ -28,10 +28,10 @@ target triple = "x86_64-unknown-linux-gnu"
 
 @.str = private unnamed_addr constant [20 x i8] c"\0A Argument %d:  %s\0A\00", align 1
 
-define dso_local i32 @main(i32 %argc, i8** %argv) !dbg !7 {
+define dso_local i32 @main(i32 %argc, ptr %argv) !dbg !7 {
 entry:
   call void @llvm.dbg.value(metadata i32 %argc, metadata !15, metadata !DIExpression()), !dbg !19
-  call void @llvm.dbg.value(metadata i8** %argv, metadata !16, metadata !DIExpression()), !dbg !19
+  call void @llvm.dbg.value(metadata ptr %argv, metadata !16, metadata !DIExpression()), !dbg !19
   call void @llvm.dbg.value(metadata i32 1, metadata !17, metadata !DIExpression()), !dbg !19
   br label %for.cond, !dbg !19
 
@@ -46,9 +46,9 @@ for.cond.cleanup:                                 ; preds = %for.cond
 
 for.body:                                         ; preds = %for.cond
   %idxprom = sext i32 %ArgIndex.0 to i64, !dbg !19
-  %arrayidx = getelementptr inbounds i8*, i8** %argv, i64 %idxprom, !dbg !19
-  %0 = load i8*, i8** %arrayidx, align 8, !dbg !19
-  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %ArgIndex.0, i8* %0), !dbg !19
+  %arrayidx = getelementptr inbounds ptr, ptr %argv, i64 %idxprom, !dbg !19
+  %0 = load ptr, ptr %arrayidx, align 8, !dbg !19
+  %call = call i32 (ptr, ...) @printf(ptr @.str, i32 %ArgIndex.0, ptr %0), !dbg !19
   br label %for.inc, !dbg !19
 
 for.inc:                                          ; preds = %for.body
@@ -60,7 +60,7 @@ for.end:                                          ; preds = %for.cond.cleanup
   ret i32 0, !dbg !19
 }
 
-declare dso_local i32 @printf(i8*, ...)
+declare dso_local i32 @printf(ptr, ...)
 
 declare void @llvm.dbg.value(metadata, metadata, metadata)
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/inner-loop.ll b/llvm/test/Transforms/IndVarSimplify/X86/inner-loop.ll
index e5e6a0da393ca..9c4ab17d1e285 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/inner-loop.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/inner-loop.ll
@@ -10,7 +10,7 @@ target triple = "x86_64-unknown-linux-gnu"
 declare void @foo(i64)
 declare void @bar(i32)
 
-define void @test(i8* %arr) {
+define void @test(ptr %arr) {
 entry:
   br label %outer_header
 
@@ -24,8 +24,8 @@ inner_header:
   %j1 = zext i32 %j to i64
 ; The next 4 lines are required for avoid widening of %j and
 ; SCEV at %cmp would not be AddRec.
-  %gep = getelementptr inbounds i8, i8*  %arr, i64 %j1
-  %ld = load i8, i8* %gep
+  %gep = getelementptr inbounds i8, ptr  %arr, i64 %j1
+  %ld = load i8, ptr %gep
   %ec = icmp eq i8 %ld, 0
   br i1 %ec, label %return, label %inner_backedge
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/loop-invariant-conditions.ll b/llvm/test/Transforms/IndVarSimplify/X86/loop-invariant-conditions.ll
index a27ea770d1159..4543ec220dbee 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/loop-invariant-conditions.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/loop-invariant-conditions.ll
@@ -384,10 +384,10 @@ for.end:                                          ; preds = %if.end, %entry
   ret void
 }
 
-define void @test7(i64 %start, i64* %inc_ptr) {
+define void @test7(i64 %start, ptr %inc_ptr) {
 ; CHECK-LABEL: @test7(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[INC:%.*]] = load i64, i64* [[INC_PTR:%.*]], align 8, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT:    [[INC:%.*]] = load i64, ptr [[INC_PTR:%.*]], align 8, !range [[RNG0:![0-9]+]]
 ; CHECK-NEXT:    [[OK:%.*]] = icmp sge i64 [[INC]], 0
 ; CHECK-NEXT:    br i1 [[OK]], label [[LOOP_PREHEADER:%.*]], label [[FOR_END:%.*]]
 ; CHECK:       loop.preheader:
@@ -401,7 +401,7 @@ define void @test7(i64 %start, i64* %inc_ptr) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %inc = load i64, i64* %inc_ptr, !range !0
+  %inc = load i64, ptr %inc_ptr, !range !0
   %ok = icmp sge i64 %inc, 0
   br i1 %ok, label %loop, label %for.end
 
@@ -415,10 +415,10 @@ for.end:                                          ; preds = %if.end, %entry
   ret void
 }
 
-define void @test7.next(i64 %start, i64* %inc_ptr) {
+define void @test7.next(i64 %start, ptr %inc_ptr) {
 ; CHECK-LABEL: @test7.next(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[INC:%.*]] = load i64, i64* [[INC_PTR:%.*]], align 8, !range [[RNG0]]
+; CHECK-NEXT:    [[INC:%.*]] = load i64, ptr [[INC_PTR:%.*]], align 8, !range [[RNG0]]
 ; CHECK-NEXT:    [[OK:%.*]] = icmp sge i64 [[INC]], 0
 ; CHECK-NEXT:    br i1 [[OK]], label [[LOOP_PREHEADER:%.*]], label [[FOR_END:%.*]]
 ; CHECK:       loop.preheader:
@@ -433,7 +433,7 @@ define void @test7.next(i64 %start, i64* %inc_ptr) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %inc = load i64, i64* %inc_ptr, !range !0
+  %inc = load i64, ptr %inc_ptr, !range !0
   %ok = icmp sge i64 %inc, 0
   br i1 %ok, label %loop, label %for.end
 
@@ -622,10 +622,10 @@ for.end:                                          ; preds = %if.end, %entry
   ret void
 }
 
-define void @test8(i64 %start, i64* %inc_ptr) {
+define void @test8(i64 %start, ptr %inc_ptr) {
 ; CHECK-LABEL: @test8(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[INC:%.*]] = load i64, i64* [[INC_PTR:%.*]], align 8, !range [[RNG1:![0-9]+]]
+; CHECK-NEXT:    [[INC:%.*]] = load i64, ptr [[INC_PTR:%.*]], align 8, !range [[RNG1:![0-9]+]]
 ; CHECK-NEXT:    [[OK:%.*]] = icmp sge i64 [[INC]], 0
 ; CHECK-NEXT:    br i1 [[OK]], label [[LOOP_PREHEADER:%.*]], label [[FOR_END:%.*]]
 ; CHECK:       loop.preheader:
@@ -641,7 +641,7 @@ define void @test8(i64 %start, i64* %inc_ptr) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %inc = load i64, i64* %inc_ptr, !range !1
+  %inc = load i64, ptr %inc_ptr, !range !1
   %ok = icmp sge i64 %inc, 0
   br i1 %ok, label %loop, label %for.end
 
@@ -739,10 +739,10 @@ exit:
 
 ; check that we can figure out that iv.next > 1 from the facts that iv >= 0 and
 ; iv.start != 0.
-define void @test11(i64* %inc_ptr) {
+define void @test11(ptr %inc_ptr) {
 ; CHECK-LABEL: @test11(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[INC:%.*]] = load i64, i64* [[INC_PTR:%.*]], align 8, !range [[RNG0]]
+; CHECK-NEXT:    [[INC:%.*]] = load i64, ptr [[INC_PTR:%.*]], align 8, !range [[RNG0]]
 ; CHECK-NEXT:    [[NE_COND:%.*]] = icmp ne i64 [[INC]], 0
 ; CHECK-NEXT:    br i1 [[NE_COND]], label [[LOOP_PREHEADER:%.*]], label [[EXIT:%.*]]
 ; CHECK:       loop.preheader:
@@ -764,7 +764,7 @@ define void @test11(i64* %inc_ptr) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %inc = load i64, i64* %inc_ptr, !range !0
+  %inc = load i64, ptr %inc_ptr, !range !0
   %ne.cond = icmp ne i64 %inc, 0
   br i1 %ne.cond, label %loop, label %exit
 
@@ -790,10 +790,10 @@ exit:
 
 ; check that we can prove that a recurrency is greater than another recurrency
 ; in the same loop, with the same step, and with smaller starting value.
-define void @test12(i64* %inc_ptr) {
+define void @test12(ptr %inc_ptr) {
 ; CHECK-LABEL: @test12(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[INC:%.*]] = load i64, i64* [[INC_PTR:%.*]], align 8, !range [[RNG0]]
+; CHECK-NEXT:    [[INC:%.*]] = load i64, ptr [[INC_PTR:%.*]], align 8, !range [[RNG0]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i64 [ [[INC]], [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ]
@@ -810,7 +810,7 @@ define void @test12(i64* %inc_ptr) {
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %inc = load i64, i64* %inc_ptr, !range !0
+  %inc = load i64, ptr %inc_ptr, !range !0
   %inc.minus.1 = sub i64 %inc, 1
   br label %loop
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/overflow-intrinsics.ll b/llvm/test/Transforms/IndVarSimplify/X86/overflow-intrinsics.ll
index 5a59e75eaf1ab..e678146c80af8 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/overflow-intrinsics.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/overflow-intrinsics.ll
@@ -3,7 +3,7 @@
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define void @f_sadd(i8* %a) {
+define void @f_sadd(ptr %a) {
 ; CHECK-LABEL: @f_sadd(
 entry:
   br label %for.body
@@ -14,8 +14,8 @@ for.cond.cleanup:                                 ; preds = %cont
 for.body:                                         ; preds = %entry, %cont
   %i.04 = phi i32 [ 0, %entry ], [ %2, %cont ]
   %idxprom = sext i32 %i.04 to i64
-  %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom
-  store i8 0, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom
+  store i8 0, ptr %arrayidx, align 1
   %0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %i.04, i32 1)
   %1 = extractvalue { i32, i1 } %0, 1
 ; CHECK: for.body:
@@ -33,7 +33,7 @@ cont:                                             ; preds = %for.body
   br i1 %cmp, label %for.body, label %for.cond.cleanup
 }
 
-define void @f_uadd(i8* %a) {
+define void @f_uadd(ptr %a) {
 ; CHECK-LABEL: @f_uadd(
 entry:
   br label %for.body
@@ -44,8 +44,8 @@ for.cond.cleanup:                                 ; preds = %cont
 for.body:                                         ; preds = %entry, %cont
   %i.04 = phi i32 [ 0, %entry ], [ %2, %cont ]
   %idxprom = sext i32 %i.04 to i64
-  %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom
-  store i8 0, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom
+  store i8 0, ptr %arrayidx, align 1
   %0 = tail call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %i.04, i32 1)
   %1 = extractvalue { i32, i1 } %0, 1
 ; CHECK: for.body:
@@ -63,7 +63,7 @@ cont:                                             ; preds = %for.body
   br i1 %cmp, label %for.body, label %for.cond.cleanup
 }
 
-define void @f_ssub(i8* nocapture %a) {
+define void @f_ssub(ptr nocapture %a) {
 ; CHECK-LABEL: @f_ssub(
 entry:
   br label %for.body
@@ -74,8 +74,8 @@ for.cond.cleanup:                                 ; preds = %cont
 for.body:                                         ; preds = %entry, %cont
   %i.04 = phi i32 [ 15, %entry ], [ %2, %cont ]
   %idxprom = sext i32 %i.04 to i64
-  %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom
-  store i8 0, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom
+  store i8 0, ptr %arrayidx, align 1
   %0 = tail call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %i.04, i32 1)
   %1 = extractvalue { i32, i1 } %0, 1
 ; CHECK: for.body:
@@ -93,7 +93,7 @@ cont:                                             ; preds = %for.body
   br i1 %cmp, label %for.body, label %for.cond.cleanup
 }
 
-define void @f_usub(i8* nocapture %a) {
+define void @f_usub(ptr nocapture %a) {
 ; CHECK-LABEL: @f_usub(
 entry:
   br label %for.body
@@ -104,8 +104,8 @@ for.cond.cleanup:                                 ; preds = %cont
 for.body:                                         ; preds = %entry, %cont
   %i.04 = phi i32 [ 15, %entry ], [ %2, %cont ]
   %idxprom = sext i32 %i.04 to i64
-  %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom
-  store i8 0, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom
+  store i8 0, ptr %arrayidx, align 1
   %0 = tail call { i32, i1 } @llvm.usub.with.overflow.i32(i32 %i.04, i32 1)
   %1 = extractvalue { i32, i1 } %0, 1
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/polynomial-expand.ll b/llvm/test/Transforms/IndVarSimplify/X86/polynomial-expand.ll
index 6e4b3714d424a..3bcb7bb05d564 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/polynomial-expand.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/polynomial-expand.ll
@@ -4,7 +4,7 @@
 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 void @ctpmv_(float* noalias nocapture %tmp4, i32 %tmp21) nounwind {
+define void @ctpmv_(ptr noalias nocapture %tmp4, i32 %tmp21) nounwind {
 bb20:                                             ; preds = %bb19
   br label %bb24
 
@@ -20,8 +20,8 @@ bb30:                                             ; preds = %bb30, %bb24
   %tmp31 = phi i32 [ %tmp39, %bb30 ], [ %tmp28, %bb24 ] ; <i32> [#uses=2]
   %tmp32 = phi i32 [ %tmp37, %bb30 ], [ %tmp27, %bb24 ] ; <i32> [#uses=2]
   %tmp33 = sext i32 %tmp32 to i64                 ; <i64> [#uses=1]
-  %tmp35 = getelementptr float, float* %tmp4, i64 %tmp33 ; <%0*> [#uses=1]
-  %tmp36 = load float, float* %tmp35, align 4               ; <%0> [#uses=0]
+  %tmp35 = getelementptr float, ptr %tmp4, i64 %tmp33 ; <ptr> [#uses=1]
+  %tmp36 = load float, ptr %tmp35, align 4               ; <%0> [#uses=0]
   %tmp37 = add nsw i32 %tmp32, -1                 ; <i32> [#uses=1]
   %tmp39 = add nsw i32 %tmp31, -1                 ; <i32> [#uses=1]
   %tmp38 = icmp eq i32 %tmp31, 1                  ; <i1> [#uses=1]

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/pr24356.ll b/llvm/test/Transforms/IndVarSimplify/X86/pr24356.ll
index 44aca9dfc38e4..f2d938f6452d3 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/pr24356.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/pr24356.ll
@@ -24,7 +24,7 @@ bb4.preheader.bb4.preheader.split_crit_edge:      ; preds = %bb4.preheader
   br label %bb4.preheader.split
 
 bb4.preheader.bb18.loopexit.split_crit_edge:      ; preds = %bb4.preheader
-  store i32 0, i32* @a, align 4
+  store i32 0, ptr @a, align 4
   br label %bb18.loopexit.split
 
 bb4.preheader.split:                              ; preds = %bb4.preheader.bb4.preheader.split_crit_edge
@@ -53,7 +53,7 @@ bb18.loopexit.split:                              ; preds = %bb4.preheader.bb18.
 
 bb18.loopexit1:                                   ; preds = %bb16
   %tmp14.lcssa5.lcssa = phi i32 [ %tmp14.lcssa5, %bb16 ]
-  store i32 %tmp14.lcssa5.lcssa, i32* @a, align 4
+  store i32 %tmp14.lcssa5.lcssa, ptr @a, align 4
   br label %bb18
 
 bb18:                                             ; preds = %bb18.loopexit1, %bb18.loopexit.split

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/pr24804.ll b/llvm/test/Transforms/IndVarSimplify/X86/pr24804.ll
index 7c5a39be10445..2310aa8e6cb3c 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/pr24804.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/pr24804.ll
@@ -5,7 +5,7 @@ target triple = "x86_64-unknown-linux-gnu"
 
 ; Checking for a crash
 
-define void @f(i32* %a) {
+define void @f(ptr %a) {
 ; CHECK-LABEL: @f(
 entry:
   br label %for.cond
@@ -14,7 +14,7 @@ for.cond:                                         ; preds = %for.inc, %for.cond,
   %iv = phi i32 [ 0, %entry ], [ %add, %for.inc ], [ %iv, %for.cond ]
   %add = add nsw i32 %iv, 1
   %idxprom = sext i32 %add to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
   br i1 undef, label %for.cond, label %for.inc
 
 for.inc:                                          ; preds = %for.cond

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/pr24956.ll b/llvm/test/Transforms/IndVarSimplify/X86/pr24956.ll
index 68e3e24600003..b5ee029143dd0 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/pr24956.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/pr24956.ll
@@ -5,31 +5,31 @@
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.10.0"
 
-define void @re_update_line(i8* %new) {
+define void @re_update_line(ptr %new) {
 ; CHECK: @re_update_line(
 entry:
-  %incdec.ptr6 = getelementptr inbounds i8, i8* %new, i64 1
+  %incdec.ptr6 = getelementptr inbounds i8, ptr %new, i64 1
   br label %for.cond.11.preheader
 
 for.cond.11.preheader:                            ; preds = %for.inc.26, %entry
-  %n.154 = phi i8* [ %new, %entry ], [ %incdec.ptr27, %for.inc.26 ]
-  %cmp12.52 = icmp ult i8* %n.154, %incdec.ptr6
+  %n.154 = phi ptr [ %new, %entry ], [ %incdec.ptr27, %for.inc.26 ]
+  %cmp12.52 = icmp ult ptr %n.154, %incdec.ptr6
   br i1 %cmp12.52, label %land.rhs.16.lr.ph, label %for.inc.26
 
 land.rhs.16.lr.ph:                                ; preds = %for.cond.11.preheader
   br label %land.rhs.16
 
 for.cond.11:                                      ; preds = %land.rhs.16
-  %incdec.ptr24 = getelementptr inbounds i8, i8* %p.053, i64 1
-  %cmp12 = icmp ult i8* %p.053, %new
+  %incdec.ptr24 = getelementptr inbounds i8, ptr %p.053, i64 1
+  %cmp12 = icmp ult ptr %p.053, %new
   br i1 %cmp12, label %land.rhs.16, label %for.inc.26
 
 land.rhs.16:                                      ; preds = %for.cond.11, %land.rhs.16.lr.ph
-  %p.053 = phi i8* [ %n.154, %land.rhs.16.lr.ph ], [ %incdec.ptr24, %for.cond.11 ]
+  %p.053 = phi ptr [ %n.154, %land.rhs.16.lr.ph ], [ %incdec.ptr24, %for.cond.11 ]
   br i1 undef, label %for.cond.11, label %for.inc.26
 
 for.inc.26:                                       ; preds = %land.rhs.16, %for.cond.11, %for.cond.11.preheader
-  %incdec.ptr27 = getelementptr inbounds i8, i8* %n.154, i64 1
+  %incdec.ptr27 = getelementptr inbounds i8, ptr %n.154, i64 1
   br i1 false, label %for.cond.11.preheader, label %for.end.28
 
 for.end.28:                                       ; preds = %for.inc.26

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/pr25051.ll b/llvm/test/Transforms/IndVarSimplify/X86/pr25051.ll
index 1376a58cda42f..68c84bc045010 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/pr25051.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/pr25051.ll
@@ -3,7 +3,7 @@
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.11.0"
 
-define i32 @somefunc(double* %arr) {
+define i32 @somefunc(ptr %arr) {
 ; CHECK-LABEL: @somefunc(
 entry:
   br label %for.cond.1.preheader
@@ -23,7 +23,7 @@ for.body.3:                                       ; preds = %for.body.3, %for.bo
   %index2.010 = phi i32 [ 0, %for.body.3.lr.ph ], [ %inc8, %for.body.3 ]
   %inc = add nsw i32 %index3.111, 1
   %idxprom = sext i32 %index3.111 to i64
-  %arrayidx = getelementptr inbounds double, double* %arr, i64 %idxprom
+  %arrayidx = getelementptr inbounds double, ptr %arr, i64 %idxprom
   %idxprom4 = sext i32 %index2.010 to i64
   %inc8 = add nsw i32 %index2.010, 1
   %cmp2 = icmp slt i32 %inc8, %index.012

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/pr26973.ll b/llvm/test/Transforms/IndVarSimplify/X86/pr26973.ll
index 174610df51911..858b341fadc2a 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/pr26973.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/pr26973.ll
@@ -3,26 +3,25 @@
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.11.0"
 
- at a = common global double* null, align 8
+ at a = common global ptr null, align 8
 @b = common global double 0.000000e+00, align 8
 
 define void @fn1(i32 %p1) {
 ; CHECK-LABEL: @fn1(
 entry:
-  %ld = load double*, double** @a, align 8
+  %ld = load ptr, ptr @a, align 8
   br label %outer.loop
 
 outer.loop:
   %iv.outer = phi i32 [ %p1, %entry ], [ %iv.outer.dec, %outer.be ]
   %idxprom = sext i32 %iv.outer to i64
-  %arrayidx = getelementptr inbounds double, double* %ld, i64 %idxprom
-  %arrayidx.bc = bitcast double* %arrayidx to i64*
+  %arrayidx = getelementptr inbounds double, ptr %ld, i64 %idxprom
   br label %inner.loop
 
 inner.loop:
   %iv.inner = phi i32 [ %iv.outer, %outer.loop ], [ %iv.inner.dec, %inner.loop ]
-  %ld.arr = load i64, i64* %arrayidx.bc, align 8
-  store i64 %ld.arr, i64* bitcast (double* @b to i64*), align 8
+  %ld.arr = load i64, ptr %arrayidx, align 8
+  store i64 %ld.arr, ptr @b, align 8
   %iv.inner.dec = add nsw i32 %iv.inner, -1
   %cmp = icmp slt i32 %iv.outer, %iv.inner.dec
   br i1 %cmp, label %outer.be, label %inner.loop

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/pr27133.ll b/llvm/test/Transforms/IndVarSimplify/X86/pr27133.ll
index b2ef606de1cb4..6efe86d751476 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/pr27133.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/pr27133.ll
@@ -3,7 +3,7 @@
 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc18.0.0"
 
-define i32 @fn2() personality i32 (...)* @__CxxFrameHandler3 {
+define i32 @fn2() personality ptr @__CxxFrameHandler3 {
 ; CHECK-LABEL: @fn2(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[FOR_COND:%.*]]
@@ -16,7 +16,7 @@ define i32 @fn2() personality i32 (...)* @__CxxFrameHandler3 {
 ; CHECK-NEXT:    [[C_0_LCSSA:%.*]] = phi i32 [ [[INDVARS1]], [[FOR_COND]] ]
 ; CHECK-NEXT:    [[TMP0:%.*]] = catchswitch within none [label %catch] unwind to caller
 ; CHECK:       catch:
-; CHECK-NEXT:    [[TMP1:%.*]] = catchpad within [[TMP0]] [i8* null, i32 64, i8* null]
+; CHECK-NEXT:    [[TMP1:%.*]] = catchpad within [[TMP0]] [ptr null, i32 64, ptr null]
 ; CHECK-NEXT:    catchret from [[TMP1]] to label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret i32 [[C_0_LCSSA]]
@@ -38,7 +38,7 @@ catch.dispatch:                                   ; preds = %for.cond
   %0 = catchswitch within none [label %catch] unwind to caller
 
 catch:                                            ; preds = %catch.dispatch
-  %1 = catchpad within %0 [i8* null, i32 64, i8* null]
+  %1 = catchpad within %0 [ptr null, i32 64, ptr null]
   catchret from %1 to label %exit
 
 exit:

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/pr35406.ll b/llvm/test/Transforms/IndVarSimplify/X86/pr35406.ll
index c8b05ff473e79..d7beb34383daf 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/pr35406.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/pr35406.ll
@@ -3,7 +3,7 @@
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
 target triple = "x86_64-unknown-linux-gnu"
 
-define i32 @testDiv(i8* %p, i64* %p1) {
+define i32 @testDiv(ptr %p, ptr %p1) {
 ; CHECK-LABEL: @testDiv(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP1:%.*]]
@@ -16,9 +16,9 @@ define i32 @testDiv(i8* %p, i64* %p1) {
 ; CHECK:       loop2.preheader:
 ; CHECK-NEXT:    br label [[LOOP2:%.*]]
 ; CHECK:       loop2:
-; CHECK-NEXT:    [[I4:%.*]] = load atomic i64, i64* [[P1:%.*]] unordered, align 8
+; CHECK-NEXT:    [[I4:%.*]] = load atomic i64, ptr [[P1:%.*]] unordered, align 8
 ; CHECK-NEXT:    [[I6:%.*]] = sub i64 [[I4]], -1
-; CHECK-NEXT:    store atomic i64 [[I6]], i64* [[P1]] unordered, align 8
+; CHECK-NEXT:    store atomic i64 [[I6]], ptr [[P1]] unordered, align 8
 ; CHECK-NEXT:    br i1 true, label [[LOOP2_EXIT_LOOPEXIT:%.*]], label [[LOOP2]]
 ; CHECK:       loop2.exit.loopexit:
 ; CHECK-NEXT:    br label [[LOOP2_EXIT]]
@@ -47,10 +47,10 @@ loop2:                                            ; preds = %loop2, %general_cas
   %local_1_56 = phi i32 [ %i2, %general_case24 ], [ %i3, %loop2 ]
   %local_2_57 = phi i32 [ 1, %general_case24 ], [ %i7, %loop2 ]
   %i3 = add i32 %local_1_56, -1
-  %i4 = load atomic i64, i64* %p1 unordered, align 8
+  %i4 = load atomic i64, ptr %p1 unordered, align 8
   %i5 = sext i32 %i3 to i64
   %i6 = sub i64 %i4, %i5
-  store atomic i64 %i6, i64* %p1 unordered, align 8
+  store atomic i64 %i6, ptr %p1 unordered, align 8
   %i7 = add nuw nsw i32 %local_2_57, 1
   %i8 = icmp ugt i32 %local_2_57, 7
   br i1 %i8, label %loop2.exit, label %loop2
@@ -66,7 +66,7 @@ exit:                                             ; preds = %loop2.exit, %loop1
   ret i32 0
 }
 
-define i32 @testRem(i8* %p, i64* %p1) {
+define i32 @testRem(ptr %p, ptr %p1) {
 ; CHECK-LABEL: @testRem(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP1:%.*]]
@@ -79,9 +79,9 @@ define i32 @testRem(i8* %p, i64* %p1) {
 ; CHECK:       loop2.preheader:
 ; CHECK-NEXT:    br label [[LOOP2:%.*]]
 ; CHECK:       loop2:
-; CHECK-NEXT:    [[I4:%.*]] = load atomic i64, i64* [[P1:%.*]] unordered, align 8
+; CHECK-NEXT:    [[I4:%.*]] = load atomic i64, ptr [[P1:%.*]] unordered, align 8
 ; CHECK-NEXT:    [[I6:%.*]] = sub i64 [[I4]], -1
-; CHECK-NEXT:    store atomic i64 [[I6]], i64* [[P1]] unordered, align 8
+; CHECK-NEXT:    store atomic i64 [[I6]], ptr [[P1]] unordered, align 8
 ; CHECK-NEXT:    br i1 true, label [[LOOP2_EXIT_LOOPEXIT:%.*]], label [[LOOP2]]
 ; CHECK:       loop2.exit.loopexit:
 ; CHECK-NEXT:    br label [[LOOP2_EXIT]]
@@ -110,10 +110,10 @@ loop2:                                            ; preds = %loop2, %general_cas
   %local_1_56 = phi i32 [ %i2, %general_case24 ], [ %i3, %loop2 ]
   %local_2_57 = phi i32 [ 1, %general_case24 ], [ %i7, %loop2 ]
   %i3 = add i32 %local_1_56, -1
-  %i4 = load atomic i64, i64* %p1 unordered, align 8
+  %i4 = load atomic i64, ptr %p1 unordered, align 8
   %i5 = sext i32 %i3 to i64
   %i6 = sub i64 %i4, %i5
-  store atomic i64 %i6, i64* %p1 unordered, align 8
+  store atomic i64 %i6, ptr %p1 unordered, align 8
   %i7 = add nuw nsw i32 %local_2_57, 1
   %i8 = icmp ugt i32 %local_2_57, 7
   br i1 %i8, label %loop2.exit, label %loop2

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/pr45360.ll b/llvm/test/Transforms/IndVarSimplify/X86/pr45360.ll
index 4be5b7e846f53..510e16ee8c142 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/pr45360.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/pr45360.ll
@@ -19,9 +19,9 @@ target triple = "x86_64-pc-linux-gnu"
 define i32 @main() {
 ; CHECK-LABEL: @main(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[I6:%.*]] = load i32, i32* @a, align 4
-; CHECK-NEXT:    [[I24:%.*]] = load i32, i32* @b, align 4
-; CHECK-NEXT:    [[D_PROMOTED10:%.*]] = load i32, i32* @d, align 4
+; CHECK-NEXT:    [[I6:%.*]] = load i32, ptr @a, align 4
+; CHECK-NEXT:    [[I24:%.*]] = load i32, ptr @b, align 4
+; CHECK-NEXT:    [[D_PROMOTED10:%.*]] = load i32, ptr @d, align 4
 ; CHECK-NEXT:    br label [[BB1:%.*]]
 ; CHECK:       bb1:
 ; CHECK-NEXT:    br label [[BB5:%.*]]
@@ -35,33 +35,33 @@ define i32 @main() {
 ; CHECK:       bb27.thread:
 ; CHECK-NEXT:    [[DOTLCSSA_LCSSA:%.*]] = phi i32 [ [[DOTLCSSA]], [[BB13_PREHEADER]] ]
 ; CHECK-NEXT:    [[I11_LCSSA_LCSSA:%.*]] = phi i32 [ -1, [[BB13_PREHEADER]] ]
-; CHECK-NEXT:    store i32 [[DOTLCSSA_LCSSA]], i32* @d, align 4
-; CHECK-NEXT:    store i32 [[I11_LCSSA_LCSSA]], i32* @f, align 4
-; CHECK-NEXT:    store i32 0, i32* @c, align 4
-; CHECK-NEXT:    store i32 0, i32* @e, align 4
+; CHECK-NEXT:    store i32 [[DOTLCSSA_LCSSA]], ptr @d, align 4
+; CHECK-NEXT:    store i32 [[I11_LCSSA_LCSSA]], ptr @f, align 4
+; CHECK-NEXT:    store i32 0, ptr @c, align 4
+; CHECK-NEXT:    store i32 0, ptr @e, align 4
 ; CHECK-NEXT:    br label [[BB32:%.*]]
 ; CHECK:       bb27:
 ; CHECK-NEXT:    [[I26:%.*]] = urem i32 [[I24]], [[DOTLCSSA]]
-; CHECK-NEXT:    store i32 [[I26]], i32* @e, align 4
+; CHECK-NEXT:    store i32 [[I26]], ptr @e, align 4
 ; CHECK-NEXT:    [[I30_NOT:%.*]] = icmp eq i32 [[I26]], 0
 ; CHECK-NEXT:    br i1 [[I30_NOT]], label [[BB32_LOOPEXIT:%.*]], label [[BB36:%.*]]
 ; CHECK:       bb32.loopexit:
 ; CHECK-NEXT:    [[DOTLCSSA_LCSSA15:%.*]] = phi i32 [ [[DOTLCSSA]], [[BB27]] ]
 ; CHECK-NEXT:    [[I11_LCSSA_LCSSA14:%.*]] = phi i32 [ -1, [[BB27]] ]
-; CHECK-NEXT:    store i32 [[DOTLCSSA_LCSSA15]], i32* @d, align 4
-; CHECK-NEXT:    store i32 [[I11_LCSSA_LCSSA14]], i32* @f, align 4
-; CHECK-NEXT:    store i32 0, i32* @c, align 4
+; CHECK-NEXT:    store i32 [[DOTLCSSA_LCSSA15]], ptr @d, align 4
+; CHECK-NEXT:    store i32 [[I11_LCSSA_LCSSA14]], ptr @f, align 4
+; CHECK-NEXT:    store i32 0, ptr @c, align 4
 ; CHECK-NEXT:    br label [[BB32]]
 ; CHECK:       bb32:
 ; CHECK-NEXT:    ret i32 0
 ; CHECK:       bb36:
-; CHECK-NEXT:    store i32 1, i32* @c, align 4
+; CHECK-NEXT:    store i32 1, ptr @c, align 4
 ; CHECK-NEXT:    br label [[BB1]]
 ;
 bb:
-  %i6 = load i32, i32* @a, align 4
-  %i24 = load i32, i32* @b, align 4
-  %d.promoted10 = load i32, i32* @d, align 4
+  %i6 = load i32, ptr @a, align 4
+  %i24 = load i32, ptr @b, align 4
+  %d.promoted10 = load i32, ptr @d, align 4
   br label %bb1
 
 bb1:                                              ; preds = %bb36, %bb
@@ -83,30 +83,30 @@ bb5:                                              ; preds = %bb1, %bb5
 bb27.thread:                                      ; preds = %bb13.preheader
   %.lcssa.lcssa = phi i32 [ %.lcssa, %bb13.preheader ]
   %i11.lcssa.lcssa = phi i32 [ %i11.lcssa, %bb13.preheader ]
-  store i32 %.lcssa.lcssa, i32* @d, align 4
-  store i32 %i11.lcssa.lcssa, i32* @f, align 4
-  store i32 0, i32* @c, align 4
-  store i32 0, i32* @e, align 4
+  store i32 %.lcssa.lcssa, ptr @d, align 4
+  store i32 %i11.lcssa.lcssa, ptr @f, align 4
+  store i32 0, ptr @c, align 4
+  store i32 0, ptr @e, align 4
   br label %bb32
 
 bb27:                                             ; preds = %bb13.preheader
   %i26 = urem i32 %i24, %.lcssa
-  store i32 %i26, i32* @e, align 4
+  store i32 %i26, ptr @e, align 4
   %i30.not = icmp eq i32 %i26, 0
   br i1 %i30.not, label %bb32.loopexit, label %bb36
 
 bb32.loopexit:                                    ; preds = %bb27
   %.lcssa.lcssa15 = phi i32 [ %.lcssa, %bb27 ]
   %i11.lcssa.lcssa14 = phi i32 [ %i11.lcssa, %bb27 ]
-  store i32 %.lcssa.lcssa15, i32* @d, align 4
-  store i32 %i11.lcssa.lcssa14, i32* @f, align 4
-  store i32 0, i32* @c, align 4
+  store i32 %.lcssa.lcssa15, ptr @d, align 4
+  store i32 %i11.lcssa.lcssa14, ptr @f, align 4
+  store i32 0, ptr @c, align 4
   br label %bb32
 
 bb32:                                             ; preds = %bb32.loopexit, %bb27.thread
   ret i32 0
 
 bb36:                                             ; preds = %bb27
-  store i32 1, i32* @c, align 4
+  store i32 1, ptr @c, align 4
   br label %bb1
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/pr57187.ll b/llvm/test/Transforms/IndVarSimplify/X86/pr57187.ll
index 8dbb2a9126855..620b0adaebfe5 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/pr57187.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/pr57187.ll
@@ -36,7 +36,7 @@ backedge:                                         ; preds = %stuck
 loop:                                             ; preds = %backedge, %entry
   %iv = phi i32 [ %start, %entry ], [ %iv.next, %backedge ]
   %iv.zext = zext i32 %iv to i64
-  %gep = getelementptr inbounds i64, i64* undef, i64 %iv.zext
+  %gep = getelementptr inbounds i64, ptr undef, i64 %iv.zext
   %iv.next = add i32 %iv, -1
   %loop.exit.cond = icmp slt i32 %iv.next, 11
   br i1 %loop.exit.cond, label %exit, label %stuck

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/scev-phi-debug-info.ll b/llvm/test/Transforms/IndVarSimplify/X86/scev-phi-debug-info.ll
index 61f7eaca5043e..b12201ecea3f8 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/scev-phi-debug-info.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/scev-phi-debug-info.ll
@@ -3,7 +3,7 @@ source_filename = "/Data/llvm/test/Transforms/IndVarSimplify/scev-phi-debug-info
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-%struct.status = type { i32, i8* }
+%struct.status = type { i32, ptr }
 
 @status = internal unnamed_addr global [32 x %struct.status] zeroinitializer, align 16, !dbg !0
 
@@ -22,8 +22,8 @@ for.cond:                                         ; preds = %for.body, %entry
 
 for.body:                                         ; preds = %for.cond
   %idxprom = sext i32 %i.0 to i64, !dbg !24
-  %value = getelementptr inbounds [32 x %struct.status], [32 x %struct.status]* @status, i64 0, i64 %idxprom, i32 0, !dbg !24
-  store i32 42, i32* %value, align 16, !dbg !24
+  %value = getelementptr inbounds [32 x %struct.status], ptr @status, i64 0, i64 %idxprom, i32 0, !dbg !24
+  store i32 42, ptr %value, align 16, !dbg !24
   tail call void @use(i32 %i.0), !dbg !24
   %inc = add nsw i32 %i.0, 1, !dbg !24
   tail call void @llvm.dbg.value(metadata i32 %inc, metadata !23, metadata !DIExpression()), !dbg !24

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/uglygep.ll b/llvm/test/Transforms/IndVarSimplify/X86/uglygep.ll
index 126fe0c97ed52..9373ecc398e60 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/uglygep.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/uglygep.ll
@@ -6,9 +6,9 @@
 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-n8:16:32:64"
 target triple = "x86_64-apple-darwin11.0"
 
- at numf2s = external global i32                     ; <i32*> [#uses=1]
- at numf1s = external global i32                     ; <i32*> [#uses=1]
- at tds = external global double**                   ; <double***> [#uses=1]
+ at numf2s = external global i32                     ; <ptr> [#uses=1]
+ at numf1s = external global i32                     ; <ptr> [#uses=1]
+ at tds = external global ptr                   ; <ptr> [#uses=1]
 
 define void @init_td(i32 %tmp7) nounwind {
 ; CHECK-LABEL: @init_td
@@ -29,10 +29,10 @@ bb2:                                              ; preds = %bb1, %bb
   br i1 %tmp8, label %bb1, label %bb3
 
 bb1:                                              ; preds = %bb2
-  %tmp = load double**, double*** @tds, align 8             ; <double**> [#uses=1]
+  %tmp = load ptr, ptr @tds, align 8             ; <ptr> [#uses=1]
   %tmp1 = sext i32 %i.0 to i64                    ; <i64> [#uses=1]
-  %tmp2 = getelementptr inbounds double*, double** %tmp, i64 %tmp1 ; <double**> [#uses=1]
-  %tmp3 = load double*, double** %tmp2, align 1            ; <double*> [#uses=1]
+  %tmp2 = getelementptr inbounds ptr, ptr %tmp, i64 %tmp1 ; <ptr> [#uses=1]
+  %tmp3 = load ptr, ptr %tmp2, align 1            ; <ptr> [#uses=1]
   %tmp6 = add nsw i32 %j.0, 1                     ; <i32> [#uses=1]
   br label %bb2
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/variable-stride-ivs-1.ll b/llvm/test/Transforms/IndVarSimplify/X86/variable-stride-ivs-1.ll
index 80cc14b38e551..300727b6a773e 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/variable-stride-ivs-1.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/variable-stride-ivs-1.ll
@@ -3,9 +3,9 @@
 
 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-f80:128:128"
 target triple = "x86_64-undermydesk-freebsd8.0"
-	%struct.mbuf = type <{ %struct.mbuf*, i8*, i32, i8, i8, i8, i8 }>
+	%struct.mbuf = type <{ ptr, ptr, i32, i8, i8, i8, i8 }>
 
-define i32 @crash(%struct.mbuf* %m) nounwind {
+define i32 @crash(ptr %m) nounwind {
 entry:
 	br label %for.cond
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/verify-scev.ll b/llvm/test/Transforms/IndVarSimplify/X86/verify-scev.ll
index c0dbc11d05797..f6758245a00e2 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/verify-scev.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/verify-scev.ll
@@ -175,7 +175,7 @@ if.end250:                                        ; preds = %for.cond246
   br i1 undef, label %if.end256, label %for.end562
 
 if.end256:                                        ; preds = %if.end250
-  %0 = load i32, i32* undef, align 4
+  %0 = load i32, ptr undef, align 4
   br i1 undef, label %if.then274, label %for.cond404.preheader
 
 for.cond404.preheader:                            ; preds = %if.end256
@@ -379,7 +379,7 @@ for.body48:                                       ; preds = %for.inc221, %for.bo
   br i1 undef, label %for.inc221, label %for.body65.lr.ph
 
 for.body65.lr.ph:                                 ; preds = %for.body48
-  %0 = load i32, i32* undef, align 4
+  %0 = load i32, ptr undef, align 4
   %1 = sext i32 %0 to i64
   br label %for.body65.us
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/X86/widen-nsw.ll b/llvm/test/Transforms/IndVarSimplify/X86/widen-nsw.ll
index 4c507d31ae48c..7cba30dd8a1f4 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/widen-nsw.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/widen-nsw.ll
@@ -4,7 +4,7 @@ target triple = "x86_64-apple-macosx"
 
 ; CHECK-LABEL: @test1
 ; CHECK: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
-define i32 @test1(i32* %a) #0 {
+define i32 @test1(ptr %a) #0 {
 entry:
   br label %for.cond
 
@@ -16,8 +16,8 @@ for.cond:                                         ; preds = %for.body, %entry
 
 for.body:                                         ; preds = %for.cond
   %idxprom = sext i32 %i.0 to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  %0 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  %0 = load i32, ptr %arrayidx, align 4
   %add = add nsw i32 %sum.0, %0
   %inc = add nsw i32 %i.0, 1
   br label %for.cond

diff  --git a/llvm/test/Transforms/IndVarSimplify/ada-loops.ll b/llvm/test/Transforms/IndVarSimplify/ada-loops.ll
index ded30cb66e370..26d4219b347f1 100644
--- a/llvm/test/Transforms/IndVarSimplify/ada-loops.ll
+++ b/llvm/test/Transforms/IndVarSimplify/ada-loops.ll
@@ -21,10 +21,10 @@ target triple = "i686-pc-linux-gnu"
 ; CHECK:         bb:
 ; CHECK-NOT:     {{sext i8|zext i8|add i8|trunc}}
 
-define void @kinds__sbytezero([256 x i32]* nocapture %a) nounwind {
+define void @kinds__sbytezero(ptr nocapture %a) nounwind {
 bb.thread:
-	%tmp46 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 0		; <i32*> [#uses=1]
-	store i32 0, i32* %tmp46
+	%tmp46 = getelementptr [256 x i32], ptr %a, i32 0, i32 0		; <ptr> [#uses=1]
+	store i32 0, ptr %tmp46
 	br label %bb
 
 bb:		; preds = %bb, %bb.thread
@@ -32,8 +32,8 @@ bb:		; preds = %bb, %bb.thread
 	%tmp8 = add i8 %i.0.reg2mem.0, 1		; <i8> [#uses=3]
 	%tmp1 = sext i8 %tmp8 to i32		; <i32> [#uses=1]
 	%tmp3 = add i32 %tmp1, 128		; <i32> [#uses=1]
-	%tmp4 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 %tmp3		; <i32*> [#uses=1]
-	store i32 0, i32* %tmp4
+	%tmp4 = getelementptr [256 x i32], ptr %a, i32 0, i32 %tmp3		; <ptr> [#uses=1]
+	store i32 0, ptr %tmp4
 	%0 = icmp eq i8 %tmp8, 127		; <i1> [#uses=1]
 	br i1 %0, label %return, label %bb
 
@@ -43,18 +43,18 @@ return:		; preds = %bb
 
 ; CHECK-LABEL: @kinds__ubytezero
 
-define void @kinds__ubytezero([256 x i32]* nocapture %a) nounwind {
+define void @kinds__ubytezero(ptr nocapture %a) nounwind {
 bb.thread:
-	%tmp35 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 0		; <i32*> [#uses=1]
-	store i32 0, i32* %tmp35
+	%tmp35 = getelementptr [256 x i32], ptr %a, i32 0, i32 0		; <ptr> [#uses=1]
+	store i32 0, ptr %tmp35
 	br label %bb
 
 bb:		; preds = %bb, %bb.thread
 	%i.0.reg2mem.0 = phi i8 [ 0, %bb.thread ], [ %tmp7, %bb ]		; <i8> [#uses=1]
 	%tmp7 = add i8 %i.0.reg2mem.0, 1		; <i8> [#uses=3]
 	%tmp1 = zext i8 %tmp7 to i32		; <i32> [#uses=1]
-	%tmp3 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 %tmp1		; <i32*> [#uses=1]
-	store i32 0, i32* %tmp3
+	%tmp3 = getelementptr [256 x i32], ptr %a, i32 0, i32 %tmp1		; <ptr> [#uses=1]
+	store i32 0, ptr %tmp3
 	%0 = icmp eq i8 %tmp7, -1		; <i1> [#uses=1]
 	br i1 %0, label %return, label %bb
 
@@ -62,7 +62,7 @@ return:		; preds = %bb
 	ret void
 }
 
-define void @kinds__srangezero([21 x i32]* nocapture %a) nounwind {
+define void @kinds__srangezero(ptr nocapture %a) nounwind {
 bb.thread:
 	br label %bb
 
@@ -70,8 +70,8 @@ bb:		; preds = %bb, %bb.thread
 	%i.0.reg2mem.0 = phi i8 [ -10, %bb.thread ], [ %tmp7, %bb ]		; <i8> [#uses=2]
 	%tmp12 = sext i8 %i.0.reg2mem.0 to i32		; <i32> [#uses=1]
 	%tmp4 = add i32 %tmp12, 10		; <i32> [#uses=1]
-	%tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4		; <i32*> [#uses=1]
-	store i32 0, i32* %tmp5
+	%tmp5 = getelementptr [21 x i32], ptr %a, i32 0, i32 %tmp4		; <ptr> [#uses=1]
+	store i32 0, ptr %tmp5
 	%tmp7 = add i8 %i.0.reg2mem.0, 1		; <i8> [#uses=2]
 	%0 = icmp sgt i8 %tmp7, 10		; <i1> [#uses=1]
 	br i1 %0, label %return, label %bb
@@ -80,7 +80,7 @@ return:		; preds = %bb
 	ret void
 }
 
-define void @kinds__urangezero([21 x i32]* nocapture %a) nounwind {
+define void @kinds__urangezero(ptr nocapture %a) nounwind {
 bb.thread:
 	br label %bb
 
@@ -88,8 +88,8 @@ bb:		; preds = %bb, %bb.thread
 	%i.0.reg2mem.0 = phi i8 [ 10, %bb.thread ], [ %tmp7, %bb ]		; <i8> [#uses=2]
 	%tmp12 = sext i8 %i.0.reg2mem.0 to i32		; <i32> [#uses=1]
 	%tmp4 = add i32 %tmp12, -10		; <i32> [#uses=1]
-	%tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4		; <i32*> [#uses=1]
-	store i32 0, i32* %tmp5
+	%tmp5 = getelementptr [21 x i32], ptr %a, i32 0, i32 %tmp4		; <ptr> [#uses=1]
+	store i32 0, ptr %tmp5
 	%tmp7 = add i8 %i.0.reg2mem.0, 1		; <i8> [#uses=2]
 	%0 = icmp sgt i8 %tmp7, 30		; <i1> [#uses=1]
 	br i1 %0, label %return, label %bb

diff  --git a/llvm/test/Transforms/IndVarSimplify/addrec_no_exec_on_every_iteration.ll b/llvm/test/Transforms/IndVarSimplify/addrec_no_exec_on_every_iteration.ll
index 7209008a656eb..9524fcd998aff 100644
--- a/llvm/test/Transforms/IndVarSimplify/addrec_no_exec_on_every_iteration.ll
+++ b/llvm/test/Transforms/IndVarSimplify/addrec_no_exec_on_every_iteration.ll
@@ -5,14 +5,12 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 target triple = "x86_64-unknown-linux-gnu"
 
 ; Function Attrs: nofree norecurse nounwind uwtable
-define void @test(i8* nocapture readnone %arg, i8* noalias nocapture readnone %arg1, i8** noalias nocapture readnone %arg2, i8** noalias nocapture readonly %arg3, i64* noalias nocapture readnone %arg4) local_unnamed_addr #0 {
+define void @test(ptr nocapture readnone %arg, ptr noalias nocapture readnone %arg1, ptr noalias nocapture readnone %arg2, ptr noalias nocapture readonly %arg3, ptr noalias nocapture readnone %arg4) local_unnamed_addr #0 {
 ; CHECK-LABEL: @test
 bb:
-  %tmp = bitcast i8** %arg3 to [1 x [4 x [10 x [5 x float]]]]**
-  %tmp5 = load [1 x [4 x [10 x [5 x float]]]]*, [1 x [4 x [10 x [5 x float]]]]** %tmp, align 8, !invariant.load !0, !dereferenceable !1, !align !2
-  %tmp6 = getelementptr inbounds i8*, i8** %arg3, i64 3
-  %tmp7 = load i8*, i8** %tmp6, align 8, !invariant.load !0, !dereferenceable !3, !align !2
-  %tmp8 = bitcast i8* %tmp7 to [10 x [5 x [2 x [1 x [2 x float]]]]]*
+  %tmp5 = load ptr, ptr %arg3, align 8, !invariant.load !0, !dereferenceable !1, !align !2
+  %tmp6 = getelementptr inbounds ptr, ptr %arg3, i64 3
+  %tmp7 = load ptr, ptr %tmp6, align 8, !invariant.load !0, !dereferenceable !3, !align !2
   br label %bb9
 
 bb9:                                              ; preds = %bb33, %bb
@@ -34,10 +32,10 @@ bb15:                                             ; preds = %bb27, %bb12
 bb19:                                             ; preds = %bb19, %bb15
   %tmp20 = phi i64 [ 0, %bb15 ], [ %tmp25, %bb19 ]
   %tmp21 = add nuw nsw i64 %tmp18, %tmp20
-  %tmp22 = getelementptr inbounds [1 x [4 x [10 x [5 x float]]]], [1 x [4 x [10 x [5 x float]]]]* %tmp5, i64 0, i64 0, i64 %tmp21, i64 %tmp11, i64 %tmp14
-  %tmp23 = load float, float* %tmp22, align 4, !invariant.load !0, !noalias !4
-  %tmp24 = getelementptr inbounds [10 x [5 x [2 x [1 x [2 x float]]]]], [10 x [5 x [2 x [1 x [2 x float]]]]]* %tmp8, i64 0, i64 %tmp10, i64 %tmp13, i64 %tmp16, i64 0, i64 %tmp20
-  store float %tmp23, float* %tmp24, align 4, !alias.scope !4, !noalias !7
+  %tmp22 = getelementptr inbounds [1 x [4 x [10 x [5 x float]]]], ptr %tmp5, i64 0, i64 0, i64 %tmp21, i64 %tmp11, i64 %tmp14
+  %tmp23 = load float, ptr %tmp22, align 4, !invariant.load !0, !noalias !4
+  %tmp24 = getelementptr inbounds [10 x [5 x [2 x [1 x [2 x float]]]]], ptr %tmp7, i64 0, i64 %tmp10, i64 %tmp13, i64 %tmp16, i64 0, i64 %tmp20
+  store float %tmp23, ptr %tmp24, align 4, !alias.scope !4, !noalias !7
   %tmp25 = add nuw nsw i64 %tmp20, 1
   %tmp26 = icmp eq i64 %tmp20, 0
   br i1 %tmp26, label %bb19, label %bb27
@@ -58,11 +56,9 @@ bb33:                                             ; preds = %bb30
   br i1 %tmp35, label %bb36, label %bb9
 
 bb36:                                             ; preds = %bb33
-  %tmp37 = getelementptr inbounds i8*, i8** %arg3, i64 1
-  %tmp38 = bitcast i8** %tmp37 to [1 x [4 x [6 x [7 x float]]]]**
-  %tmp39 = load [1 x [4 x [6 x [7 x float]]]]*, [1 x [4 x [6 x [7 x float]]]]** %tmp38, align 8, !invariant.load !0, !dereferenceable !10, !align !2
-  %tmp40 = getelementptr inbounds i8, i8* %tmp7, i64 800
-  %tmp41 = bitcast i8* %tmp40 to [2 x [6 x [7 x [2 x [1 x float]]]]]*
+  %tmp37 = getelementptr inbounds ptr, ptr %arg3, i64 1
+  %tmp39 = load ptr, ptr %tmp37, align 8, !invariant.load !0, !dereferenceable !10, !align !2
+  %tmp40 = getelementptr inbounds i8, ptr %tmp7, i64 800
   br label %bb42
 
 bb42:                                             ; preds = %bb63, %bb36
@@ -81,10 +77,10 @@ bb48:                                             ; preds = %bb48, %bb46
   %tmp49 = phi i64 [ 0, %bb46 ], [ %tmp55, %bb48 ]
   %tmp50 = shl nuw nsw i64 %tmp49, 1
   %tmp51 = add nuw nsw i64 %tmp50, %tmp43
-  %tmp52 = getelementptr inbounds [1 x [4 x [6 x [7 x float]]]], [1 x [4 x [6 x [7 x float]]]]* %tmp39, i64 0, i64 0, i64 %tmp51, i64 %tmp45, i64 %tmp47
-  %tmp53 = load float, float* %tmp52, align 4, !invariant.load !0, !noalias !11
-  %tmp54 = getelementptr inbounds [2 x [6 x [7 x [2 x [1 x float]]]]], [2 x [6 x [7 x [2 x [1 x float]]]]]* %tmp41, i64 0, i64 %tmp43, i64 %tmp45, i64 %tmp47, i64 %tmp49, i64 0
-  store float %tmp53, float* %tmp54, align 4, !alias.scope !11, !noalias !12
+  %tmp52 = getelementptr inbounds [1 x [4 x [6 x [7 x float]]]], ptr %tmp39, i64 0, i64 0, i64 %tmp51, i64 %tmp45, i64 %tmp47
+  %tmp53 = load float, ptr %tmp52, align 4, !invariant.load !0, !noalias !11
+  %tmp54 = getelementptr inbounds [2 x [6 x [7 x [2 x [1 x float]]]]], ptr %tmp40, i64 0, i64 %tmp43, i64 %tmp45, i64 %tmp47, i64 %tmp49, i64 0
+  store float %tmp53, ptr %tmp54, align 4, !alias.scope !11, !noalias !12
   %tmp55 = add nuw nsw i64 %tmp49, 1
   %tmp56 = icmp eq i64 %tmp49, 0
   br i1 %tmp56, label %bb48, label %bb57
@@ -105,8 +101,7 @@ bb63:                                             ; preds = %bb60
   br i1 %tmp65, label %bb42, label %bb66
 
 bb66:                                             ; preds = %bb63
-  %tmp67 = getelementptr inbounds i8, i8* %tmp7, i64 1472
-  %tmp68 = bitcast i8* %tmp67 to [2 x [1 x [2 x [2 x [2 x float]]]]]*
+  %tmp67 = getelementptr inbounds i8, ptr %tmp7, i64 1472
   br label %bb69
 
 bb69:                                             ; preds = %bb140, %bb66
@@ -188,10 +183,10 @@ bb110:                                            ; preds = %bb114, %bb104
 
 bb114:                                            ; preds = %bb104
   %tmp115 = sub nsw i64 1, %tmp106
-  %tmp116 = getelementptr inbounds [2 x [6 x [7 x [2 x [1 x float]]]]], [2 x [6 x [7 x [2 x [1 x float]]]]]* %tmp41, i64 0, i64 %tmp70, i64 %tmp86, i64 %tmp94, i64 %tmp115, i64 0
-  %tmp117 = getelementptr inbounds [10 x [5 x [2 x [1 x [2 x float]]]]], [10 x [5 x [2 x [1 x [2 x float]]]]]* %tmp8, i64 0, i64 %tmp84, i64 %tmp92, i64 %bugged, i64 0, i64 %tmp79
-  %tmp118 = load float, float* %tmp117, align 4, !alias.scope !4, !noalias !7
-  %tmp119 = load float, float* %tmp116, align 4, !alias.scope !11, !noalias !12
+  %tmp116 = getelementptr inbounds [2 x [6 x [7 x [2 x [1 x float]]]]], ptr %tmp40, i64 0, i64 %tmp70, i64 %tmp86, i64 %tmp94, i64 %tmp115, i64 0
+  %tmp117 = getelementptr inbounds [10 x [5 x [2 x [1 x [2 x float]]]]], ptr %tmp7, i64 0, i64 %tmp84, i64 %tmp92, i64 %bugged, i64 0, i64 %tmp79
+  %tmp118 = load float, ptr %tmp117, align 4, !alias.scope !4, !noalias !7
+  %tmp119 = load float, ptr %tmp116, align 4, !alias.scope !11, !noalias !12
   %tmp120 = fmul reassoc nsz contract float %tmp118, %tmp119
   %tmp121 = fadd reassoc nsz contract float %tmp105, %tmp120
   br label %bb110
@@ -211,8 +206,8 @@ bb125:                                            ; preds = %bb124, %bb122
 
 bb129:                                            ; preds = %bb125
   %tmp130 = phi float [ %tmp126, %bb125 ]
-  %tmp131 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 %tmp70, i64 0, i64 %tmp72, i64 %tmp76, i64 %tmp79
-  store float %tmp130, float* %tmp131, align 4, !alias.scope !13, !noalias !14
+  %tmp131 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 %tmp70, i64 0, i64 %tmp72, i64 %tmp76, i64 %tmp79
+  store float %tmp130, ptr %tmp131, align 4, !alias.scope !13, !noalias !14
   %tmp132 = add nuw nsw i64 %tmp79, 1
   %tmp133 = icmp eq i64 %tmp79, 0
   br i1 %tmp133, label %bb78, label %bb134
@@ -233,9 +228,8 @@ bb140:                                            ; preds = %bb137
   br i1 %tmp142, label %bb69, label %bb143
 
 bb143:                                            ; preds = %bb140
-  %tmp144 = getelementptr inbounds i8*, i8** %arg3, i64 2
-  %tmp145 = bitcast i8** %tmp144 to [4 x [2 x [1 x [2 x float]]]]**
-  %tmp146 = load [4 x [2 x [1 x [2 x float]]]]*, [4 x [2 x [1 x [2 x float]]]]** %tmp145, align 8, !invariant.load !0, !dereferenceable !16, !align !2
+  %tmp144 = getelementptr inbounds ptr, ptr %arg3, i64 2
+  %tmp146 = load ptr, ptr %tmp144, align 8, !invariant.load !0, !dereferenceable !16, !align !2
   br label %bb147
 
 bb147:                                            ; preds = %bb143
@@ -245,100 +239,98 @@ bb148:                                            ; preds = %bb147
   br label %bb149
 
 bb149:                                            ; preds = %bb148
-  %tmp150 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0
-  %tmp151 = load float, float* %tmp150, align 4, !alias.scope !13, !noalias !14
-  %tmp152 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 0, i64 0, i64 0, i64 0
-  store float %tmp151, float* %tmp152, align 4, !alias.scope !17, !noalias !13
-  %tmp153 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 0, i64 0, i64 1, i64 0, i64 0
-  %tmp154 = load float, float* %tmp153, align 4, !alias.scope !13, !noalias !14
-  %tmp155 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 0, i64 0, i64 0, i64 1
-  store float %tmp154, float* %tmp155, align 4, !alias.scope !17, !noalias !13
+  %tmp151 = load float, ptr %tmp67, align 4, !alias.scope !13, !noalias !14
+  store float %tmp151, ptr %tmp146, align 4, !alias.scope !17, !noalias !13
+  %tmp153 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 0, i64 0, i64 1, i64 0, i64 0
+  %tmp154 = load float, ptr %tmp153, align 4, !alias.scope !13, !noalias !14
+  %tmp155 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 0, i64 0, i64 0, i64 1
+  store float %tmp154, ptr %tmp155, align 4, !alias.scope !17, !noalias !13
   br label %bb156
 
 bb156:                                            ; preds = %bb149
-  %tmp157 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 1, i64 0, i64 0, i64 0, i64 0
-  %tmp158 = load float, float* %tmp157, align 4, !alias.scope !13, !noalias !14
-  %tmp159 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 0, i64 1, i64 0, i64 0
-  store float %tmp158, float* %tmp159, align 4, !alias.scope !17, !noalias !13
-  %tmp160 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 1, i64 0, i64 1, i64 0, i64 0
-  %tmp161 = load float, float* %tmp160, align 4, !alias.scope !13, !noalias !14
-  %tmp162 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 0, i64 1, i64 0, i64 1
-  store float %tmp161, float* %tmp162, align 4, !alias.scope !17, !noalias !13
+  %tmp157 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 1, i64 0, i64 0, i64 0, i64 0
+  %tmp158 = load float, ptr %tmp157, align 4, !alias.scope !13, !noalias !14
+  %tmp159 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 0, i64 1, i64 0, i64 0
+  store float %tmp158, ptr %tmp159, align 4, !alias.scope !17, !noalias !13
+  %tmp160 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 1, i64 0, i64 1, i64 0, i64 0
+  %tmp161 = load float, ptr %tmp160, align 4, !alias.scope !13, !noalias !14
+  %tmp162 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 0, i64 1, i64 0, i64 1
+  store float %tmp161, ptr %tmp162, align 4, !alias.scope !17, !noalias !13
   br label %bb163
 
 bb163:                                            ; preds = %bb156
   br label %bb164
 
 bb164:                                            ; preds = %bb163
-  %tmp165 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 0, i64 0, i64 0, i64 0, i64 1
-  %tmp166 = load float, float* %tmp165, align 4, !alias.scope !13, !noalias !14
-  %tmp167 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 1, i64 0, i64 0, i64 0
-  store float %tmp166, float* %tmp167, align 4, !alias.scope !17, !noalias !13
-  %tmp168 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 0, i64 0, i64 1, i64 0, i64 1
-  %tmp169 = load float, float* %tmp168, align 4, !alias.scope !13, !noalias !14
-  %tmp170 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 1, i64 0, i64 0, i64 1
-  store float %tmp169, float* %tmp170, align 4, !alias.scope !17, !noalias !13
+  %tmp165 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 0, i64 0, i64 0, i64 0, i64 1
+  %tmp166 = load float, ptr %tmp165, align 4, !alias.scope !13, !noalias !14
+  %tmp167 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 1, i64 0, i64 0, i64 0
+  store float %tmp166, ptr %tmp167, align 4, !alias.scope !17, !noalias !13
+  %tmp168 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 0, i64 0, i64 1, i64 0, i64 1
+  %tmp169 = load float, ptr %tmp168, align 4, !alias.scope !13, !noalias !14
+  %tmp170 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 1, i64 0, i64 0, i64 1
+  store float %tmp169, ptr %tmp170, align 4, !alias.scope !17, !noalias !13
   br label %bb171
 
 bb171:                                            ; preds = %bb164
-  %tmp172 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 1, i64 0, i64 0, i64 0, i64 1
-  %tmp173 = load float, float* %tmp172, align 4, !alias.scope !13, !noalias !14
-  %tmp174 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 1, i64 1, i64 0, i64 0
-  store float %tmp173, float* %tmp174, align 4, !alias.scope !17, !noalias !13
-  %tmp175 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 1, i64 0, i64 1, i64 0, i64 1
-  %tmp176 = load float, float* %tmp175, align 4, !alias.scope !13, !noalias !14
-  %tmp177 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 1, i64 1, i64 0, i64 1
-  store float %tmp176, float* %tmp177, align 4, !alias.scope !17, !noalias !13
+  %tmp172 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 1, i64 0, i64 0, i64 0, i64 1
+  %tmp173 = load float, ptr %tmp172, align 4, !alias.scope !13, !noalias !14
+  %tmp174 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 1, i64 1, i64 0, i64 0
+  store float %tmp173, ptr %tmp174, align 4, !alias.scope !17, !noalias !13
+  %tmp175 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 1, i64 0, i64 1, i64 0, i64 1
+  %tmp176 = load float, ptr %tmp175, align 4, !alias.scope !13, !noalias !14
+  %tmp177 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 1, i64 1, i64 0, i64 1
+  store float %tmp176, ptr %tmp177, align 4, !alias.scope !17, !noalias !13
   br label %bb178
 
 bb178:                                            ; preds = %bb171
   br label %bb179
 
 bb179:                                            ; preds = %bb178
-  %tmp180 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 0, i64 0, i64 0, i64 1, i64 0
-  %tmp181 = load float, float* %tmp180, align 4, !alias.scope !13, !noalias !14
-  %tmp182 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 2, i64 0, i64 0, i64 0
-  store float %tmp181, float* %tmp182, align 4, !alias.scope !17, !noalias !13
-  %tmp183 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 0, i64 0, i64 1, i64 1, i64 0
-  %tmp184 = load float, float* %tmp183, align 4, !alias.scope !13, !noalias !14
-  %tmp185 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 2, i64 0, i64 0, i64 1
-  store float %tmp184, float* %tmp185, align 4, !alias.scope !17, !noalias !13
+  %tmp180 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 0, i64 0, i64 0, i64 1, i64 0
+  %tmp181 = load float, ptr %tmp180, align 4, !alias.scope !13, !noalias !14
+  %tmp182 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 2, i64 0, i64 0, i64 0
+  store float %tmp181, ptr %tmp182, align 4, !alias.scope !17, !noalias !13
+  %tmp183 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 0, i64 0, i64 1, i64 1, i64 0
+  %tmp184 = load float, ptr %tmp183, align 4, !alias.scope !13, !noalias !14
+  %tmp185 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 2, i64 0, i64 0, i64 1
+  store float %tmp184, ptr %tmp185, align 4, !alias.scope !17, !noalias !13
   br label %bb186
 
 bb186:                                            ; preds = %bb179
-  %tmp187 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 1, i64 0, i64 0, i64 1, i64 0
-  %tmp188 = load float, float* %tmp187, align 4, !alias.scope !13, !noalias !14
-  %tmp189 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 2, i64 1, i64 0, i64 0
-  store float %tmp188, float* %tmp189, align 4, !alias.scope !17, !noalias !13
-  %tmp190 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 1, i64 0, i64 1, i64 1, i64 0
-  %tmp191 = load float, float* %tmp190, align 4, !alias.scope !13, !noalias !14
-  %tmp192 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 2, i64 1, i64 0, i64 1
-  store float %tmp191, float* %tmp192, align 4, !alias.scope !17, !noalias !13
+  %tmp187 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 1, i64 0, i64 0, i64 1, i64 0
+  %tmp188 = load float, ptr %tmp187, align 4, !alias.scope !13, !noalias !14
+  %tmp189 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 2, i64 1, i64 0, i64 0
+  store float %tmp188, ptr %tmp189, align 4, !alias.scope !17, !noalias !13
+  %tmp190 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 1, i64 0, i64 1, i64 1, i64 0
+  %tmp191 = load float, ptr %tmp190, align 4, !alias.scope !13, !noalias !14
+  %tmp192 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 2, i64 1, i64 0, i64 1
+  store float %tmp191, ptr %tmp192, align 4, !alias.scope !17, !noalias !13
   br label %bb193
 
 bb193:                                            ; preds = %bb186
   br label %bb194
 
 bb194:                                            ; preds = %bb193
-  %tmp195 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 0, i64 0, i64 0, i64 1, i64 1
-  %tmp196 = load float, float* %tmp195, align 4, !alias.scope !13, !noalias !14
-  %tmp197 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 3, i64 0, i64 0, i64 0
-  store float %tmp196, float* %tmp197, align 4, !alias.scope !17, !noalias !13
-  %tmp198 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 0, i64 0, i64 1, i64 1, i64 1
-  %tmp199 = load float, float* %tmp198, align 4, !alias.scope !13, !noalias !14
-  %tmp200 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 3, i64 0, i64 0, i64 1
-  store float %tmp199, float* %tmp200, align 4, !alias.scope !17, !noalias !13
+  %tmp195 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 0, i64 0, i64 0, i64 1, i64 1
+  %tmp196 = load float, ptr %tmp195, align 4, !alias.scope !13, !noalias !14
+  %tmp197 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 3, i64 0, i64 0, i64 0
+  store float %tmp196, ptr %tmp197, align 4, !alias.scope !17, !noalias !13
+  %tmp198 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 0, i64 0, i64 1, i64 1, i64 1
+  %tmp199 = load float, ptr %tmp198, align 4, !alias.scope !13, !noalias !14
+  %tmp200 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 3, i64 0, i64 0, i64 1
+  store float %tmp199, ptr %tmp200, align 4, !alias.scope !17, !noalias !13
   br label %bb201
 
 bb201:                                            ; preds = %bb194
-  %tmp202 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 1, i64 0, i64 0, i64 1, i64 1
-  %tmp203 = load float, float* %tmp202, align 4, !alias.scope !13, !noalias !14
-  %tmp204 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 3, i64 1, i64 0, i64 0
-  store float %tmp203, float* %tmp204, align 4, !alias.scope !17, !noalias !13
-  %tmp205 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], [2 x [1 x [2 x [2 x [2 x float]]]]]* %tmp68, i64 0, i64 1, i64 0, i64 1, i64 1, i64 1
-  %tmp206 = load float, float* %tmp205, align 4, !alias.scope !13, !noalias !14
-  %tmp207 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], [4 x [2 x [1 x [2 x float]]]]* %tmp146, i64 0, i64 3, i64 1, i64 0, i64 1
-  store float %tmp206, float* %tmp207, align 4, !alias.scope !17, !noalias !13
+  %tmp202 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 1, i64 0, i64 0, i64 1, i64 1
+  %tmp203 = load float, ptr %tmp202, align 4, !alias.scope !13, !noalias !14
+  %tmp204 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 3, i64 1, i64 0, i64 0
+  store float %tmp203, ptr %tmp204, align 4, !alias.scope !17, !noalias !13
+  %tmp205 = getelementptr inbounds [2 x [1 x [2 x [2 x [2 x float]]]]], ptr %tmp67, i64 0, i64 1, i64 0, i64 1, i64 1, i64 1
+  %tmp206 = load float, ptr %tmp205, align 4, !alias.scope !13, !noalias !14
+  %tmp207 = getelementptr inbounds [4 x [2 x [1 x [2 x float]]]], ptr %tmp146, i64 0, i64 3, i64 1, i64 0, i64 1
+  store float %tmp206, ptr %tmp207, align 4, !alias.scope !17, !noalias !13
   ret void
 }
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/ashr-tripcount.ll b/llvm/test/Transforms/IndVarSimplify/ashr-tripcount.ll
index 7ae69da1e4668..4dedf7c6b6331 100644
--- a/llvm/test/Transforms/IndVarSimplify/ashr-tripcount.ll
+++ b/llvm/test/Transforms/IndVarSimplify/ashr-tripcount.ll
@@ -4,12 +4,12 @@
 ; inside the loop.
 
 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-n32:64"
- at pow_2_tab = external constant [0 x float]		; <[0 x float]*> [#uses=1]
- at pow_2_025_tab = external constant [0 x float]		; <[0 x float]*> [#uses=1]
- at i_pow_2_tab = external constant [0 x float]		; <[0 x float]*> [#uses=1]
- at i_pow_2_025_tab = external constant [0 x float]		; <[0 x float]*> [#uses=1]
+ at pow_2_tab = external constant [0 x float]		; <ptr> [#uses=1]
+ at pow_2_025_tab = external constant [0 x float]		; <ptr> [#uses=1]
+ at i_pow_2_tab = external constant [0 x float]		; <ptr> [#uses=1]
+ at i_pow_2_025_tab = external constant [0 x float]		; <ptr> [#uses=1]
 
-define void @foo(i32 %gain, i32 %noOfLines, i32* %quaSpectrum, float* %iquaSpectrum, float* %pow4_3_tab_ptr) nounwind {
+define void @foo(i32 %gain, i32 %noOfLines, ptr %quaSpectrum, ptr %iquaSpectrum, ptr %pow4_3_tab_ptr) nounwind {
 ; CHECK-LABEL: @foo(
 ; CHECK: sext
 ; CHECK-NOT: sext
@@ -23,18 +23,18 @@ bb1:		; preds = %entry
 	br label %bb2
 
 bb2:		; preds = %bb1, %entry
-	%pow_2_tab.pn = phi [0 x float]* [ @i_pow_2_tab, %bb1 ], [ @pow_2_tab, %entry ]		; <[0 x float]*> [#uses=1]
+	%pow_2_tab.pn = phi ptr [ @i_pow_2_tab, %bb1 ], [ @pow_2_tab, %entry ]		; <ptr> [#uses=1]
 	%.pn3.in.in = phi i32 [ %t1, %bb1 ], [ %gain, %entry ]		; <i32> [#uses=1]
-	%pow_2_025_tab.pn = phi [0 x float]* [ @i_pow_2_025_tab, %bb1 ], [ @pow_2_025_tab, %entry ]		; <[0 x float]*> [#uses=1]
+	%pow_2_025_tab.pn = phi ptr [ @i_pow_2_025_tab, %bb1 ], [ @pow_2_025_tab, %entry ]		; <ptr> [#uses=1]
 	%.pn2.in.in = phi i32 [ %t2, %bb1 ], [ %gain, %entry ]		; <i32> [#uses=1]
 	%.pn3.in = ashr i32 %.pn3.in.in, 2		; <i32> [#uses=1]
 	%.pn2.in = and i32 %.pn2.in.in, 3		; <i32> [#uses=1]
 	%.pn3 = sext i32 %.pn3.in to i64		; <i64> [#uses=1]
 	%.pn2 = zext i32 %.pn2.in to i64		; <i64> [#uses=1]
-	%.pn.in = getelementptr [0 x float], [0 x float]* %pow_2_tab.pn, i64 0, i64 %.pn3		; <float*> [#uses=1]
-	%.pn1.in = getelementptr [0 x float], [0 x float]* %pow_2_025_tab.pn, i64 0, i64 %.pn2		; <float*> [#uses=1]
-	%.pn = load float, float* %.pn.in		; <float> [#uses=1]
-	%.pn1 = load float, float* %.pn1.in		; <float> [#uses=1]
+	%.pn.in = getelementptr [0 x float], ptr %pow_2_tab.pn, i64 0, i64 %.pn3		; <ptr> [#uses=1]
+	%.pn1.in = getelementptr [0 x float], ptr %pow_2_025_tab.pn, i64 0, i64 %.pn2		; <ptr> [#uses=1]
+	%.pn = load float, ptr %.pn.in		; <float> [#uses=1]
+	%.pn1 = load float, ptr %.pn1.in		; <float> [#uses=1]
 	%invQuantizer.0 = fmul float %.pn, %.pn1		; <float> [#uses=4]
 	%t3 = ashr i32 %noOfLines, 2		; <i32> [#uses=1]
 	%t4 = icmp sgt i32 %t3, 0		; <i1> [#uses=1]
@@ -48,51 +48,51 @@ bb3:		; preds = %bb4, %bb.nph
 	%i.05 = phi i32 [ %t49, %bb4 ], [ 0, %bb.nph ]		; <i32> [#uses=9]
 	%k.04 = phi i32 [ %t48, %bb4 ], [ 0, %bb.nph ]		; <i32> [#uses=1]
 	%t6 = sext i32 %i.05 to i64		; <i64> [#uses=1]
-	%t7 = getelementptr i32, i32* %quaSpectrum, i64 %t6		; <i32*> [#uses=1]
-	%t8 = load i32, i32* %t7, align 4		; <i32> [#uses=1]
+	%t7 = getelementptr i32, ptr %quaSpectrum, i64 %t6		; <ptr> [#uses=1]
+	%t8 = load i32, ptr %t7, align 4		; <i32> [#uses=1]
 	%t9 = zext i32 %t8 to i64		; <i64> [#uses=1]
-	%t10 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t9		; <float*> [#uses=1]
-	%t11 = load float, float* %t10, align 4		; <float> [#uses=1]
+	%t10 = getelementptr float, ptr %pow4_3_tab_ptr, i64 %t9		; <ptr> [#uses=1]
+	%t11 = load float, ptr %t10, align 4		; <float> [#uses=1]
 	%t12 = or i32 %i.05, 1		; <i32> [#uses=1]
 	%t13 = sext i32 %t12 to i64		; <i64> [#uses=1]
-	%t14 = getelementptr i32, i32* %quaSpectrum, i64 %t13		; <i32*> [#uses=1]
-	%t15 = load i32, i32* %t14, align 4		; <i32> [#uses=1]
+	%t14 = getelementptr i32, ptr %quaSpectrum, i64 %t13		; <ptr> [#uses=1]
+	%t15 = load i32, ptr %t14, align 4		; <i32> [#uses=1]
 	%t16 = zext i32 %t15 to i64		; <i64> [#uses=1]
-	%t17 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t16		; <float*> [#uses=1]
-	%t18 = load float, float* %t17, align 4		; <float> [#uses=1]
+	%t17 = getelementptr float, ptr %pow4_3_tab_ptr, i64 %t16		; <ptr> [#uses=1]
+	%t18 = load float, ptr %t17, align 4		; <float> [#uses=1]
 	%t19 = or i32 %i.05, 2		; <i32> [#uses=1]
 	%t20 = sext i32 %t19 to i64		; <i64> [#uses=1]
-	%t21 = getelementptr i32, i32* %quaSpectrum, i64 %t20		; <i32*> [#uses=1]
-	%t22 = load i32, i32* %t21, align 4		; <i32> [#uses=1]
+	%t21 = getelementptr i32, ptr %quaSpectrum, i64 %t20		; <ptr> [#uses=1]
+	%t22 = load i32, ptr %t21, align 4		; <i32> [#uses=1]
 	%t23 = zext i32 %t22 to i64		; <i64> [#uses=1]
-	%t24 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t23		; <float*> [#uses=1]
-	%t25 = load float, float* %t24, align 4		; <float> [#uses=1]
+	%t24 = getelementptr float, ptr %pow4_3_tab_ptr, i64 %t23		; <ptr> [#uses=1]
+	%t25 = load float, ptr %t24, align 4		; <float> [#uses=1]
 	%t26 = or i32 %i.05, 3		; <i32> [#uses=1]
 	%t27 = sext i32 %t26 to i64		; <i64> [#uses=1]
-	%t28 = getelementptr i32, i32* %quaSpectrum, i64 %t27		; <i32*> [#uses=1]
-	%t29 = load i32, i32* %t28, align 4		; <i32> [#uses=1]
+	%t28 = getelementptr i32, ptr %quaSpectrum, i64 %t27		; <ptr> [#uses=1]
+	%t29 = load i32, ptr %t28, align 4		; <i32> [#uses=1]
 	%t30 = zext i32 %t29 to i64		; <i64> [#uses=1]
-	%t31 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t30		; <float*> [#uses=1]
-	%t32 = load float, float* %t31, align 4		; <float> [#uses=1]
+	%t31 = getelementptr float, ptr %pow4_3_tab_ptr, i64 %t30		; <ptr> [#uses=1]
+	%t32 = load float, ptr %t31, align 4		; <float> [#uses=1]
 	%t33 = fmul float %t11, %invQuantizer.0		; <float> [#uses=1]
 	%t34 = sext i32 %i.05 to i64		; <i64> [#uses=1]
-	%t35 = getelementptr float, float* %iquaSpectrum, i64 %t34		; <float*> [#uses=1]
-	store float %t33, float* %t35, align 4
+	%t35 = getelementptr float, ptr %iquaSpectrum, i64 %t34		; <ptr> [#uses=1]
+	store float %t33, ptr %t35, align 4
 	%t36 = or i32 %i.05, 1		; <i32> [#uses=1]
 	%t37 = fmul float %t18, %invQuantizer.0		; <float> [#uses=1]
 	%t38 = sext i32 %t36 to i64		; <i64> [#uses=1]
-	%t39 = getelementptr float, float* %iquaSpectrum, i64 %t38		; <float*> [#uses=1]
-	store float %t37, float* %t39, align 4
+	%t39 = getelementptr float, ptr %iquaSpectrum, i64 %t38		; <ptr> [#uses=1]
+	store float %t37, ptr %t39, align 4
 	%t40 = or i32 %i.05, 2		; <i32> [#uses=1]
 	%t41 = fmul float %t25, %invQuantizer.0		; <float> [#uses=1]
 	%t42 = sext i32 %t40 to i64		; <i64> [#uses=1]
-	%t43 = getelementptr float, float* %iquaSpectrum, i64 %t42		; <float*> [#uses=1]
-	store float %t41, float* %t43, align 4
+	%t43 = getelementptr float, ptr %iquaSpectrum, i64 %t42		; <ptr> [#uses=1]
+	store float %t41, ptr %t43, align 4
 	%t44 = or i32 %i.05, 3		; <i32> [#uses=1]
 	%t45 = fmul float %t32, %invQuantizer.0		; <float> [#uses=1]
 	%t46 = sext i32 %t44 to i64		; <i64> [#uses=1]
-	%t47 = getelementptr float, float* %iquaSpectrum, i64 %t46		; <float*> [#uses=1]
-	store float %t45, float* %t47, align 4
+	%t47 = getelementptr float, ptr %iquaSpectrum, i64 %t46		; <ptr> [#uses=1]
+	store float %t45, ptr %t47, align 4
 	%t48 = add i32 %k.04, 1		; <i32> [#uses=2]
 	%t49 = add i32 %i.05, 4		; <i32> [#uses=1]
 	br label %bb4

diff  --git a/llvm/test/Transforms/IndVarSimplify/avoid-i0.ll b/llvm/test/Transforms/IndVarSimplify/avoid-i0.ll
index 69d9890041f3b..307736f82b9b0 100644
--- a/llvm/test/Transforms/IndVarSimplify/avoid-i0.ll
+++ b/llvm/test/Transforms/IndVarSimplify/avoid-i0.ll
@@ -23,98 +23,98 @@ bb6:		; preds = %bb4
 	br label %bb
 }
 
- at x = common global i32 0		; <i32*> [#uses=1]
+ at x = common global i32 0		; <ptr> [#uses=1]
 
 define signext i8 @safe_sub_func_int32_t_s_s(i32 %_si1, i8 signext %_si2) nounwind {
 entry:
-	%_si1_addr = alloca i32		; <i32*> [#uses=3]
-	%_si2_addr = alloca i8		; <i8*> [#uses=3]
-	%retval = alloca i32		; <i32*> [#uses=2]
-	%0 = alloca i32		; <i32*> [#uses=2]
+	%_si1_addr = alloca i32		; <ptr> [#uses=3]
+	%_si2_addr = alloca i8		; <ptr> [#uses=3]
+	%retval = alloca i32		; <ptr> [#uses=2]
+	%0 = alloca i32		; <ptr> [#uses=2]
 	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
-	store i32 %_si1, i32* %_si1_addr
-	store i8 %_si2, i8* %_si2_addr
-	%1 = load i8, i8* %_si2_addr, align 1		; <i8> [#uses=1]
+	store i32 %_si1, ptr %_si1_addr
+	store i8 %_si2, ptr %_si2_addr
+	%1 = load i8, ptr %_si2_addr, align 1		; <i8> [#uses=1]
 	%2 = sext i8 %1 to i32		; <i32> [#uses=1]
-	%3 = load i32, i32* %_si1_addr, align 4		; <i32> [#uses=1]
+	%3 = load i32, ptr %_si1_addr, align 4		; <i32> [#uses=1]
 	%4 = xor i32 %2, %3		; <i32> [#uses=1]
-	%5 = load i8, i8* %_si2_addr, align 1		; <i8> [#uses=1]
+	%5 = load i8, ptr %_si2_addr, align 1		; <i8> [#uses=1]
 	%6 = sext i8 %5 to i32		; <i32> [#uses=1]
 	%7 = sub i32 7, %6		; <i32> [#uses=1]
-	%8 = load i32, i32* %_si1_addr, align 4		; <i32> [#uses=1]
+	%8 = load i32, ptr %_si1_addr, align 4		; <i32> [#uses=1]
 	%9 = shl i32 %8, %7		; <i32> [#uses=1]
 	%10 = and i32 %4, %9		; <i32> [#uses=1]
 	%11 = icmp slt i32 %10, 0		; <i1> [#uses=1]
 	%12 = zext i1 %11 to i32		; <i32> [#uses=1]
-	store i32 %12, i32* %0, align 4
-	%13 = load i32, i32* %0, align 4		; <i32> [#uses=1]
-	store i32 %13, i32* %retval, align 4
+	store i32 %12, ptr %0, align 4
+	%13 = load i32, ptr %0, align 4		; <i32> [#uses=1]
+	store i32 %13, ptr %retval, align 4
 	br label %return
 
 return:		; preds = %entry
-	%retval1 = load i32, i32* %retval		; <i32> [#uses=1]
+	%retval1 = load i32, ptr %retval		; <i32> [#uses=1]
 	%retval12 = trunc i32 %retval1 to i8		; <i8> [#uses=1]
 	ret i8 %retval12
 }
 
 define i32 @safe_sub_func_uint64_t_u_u(i32 %_ui1, i32 %_ui2) nounwind {
 entry:
-	%_ui1_addr = alloca i32		; <i32*> [#uses=2]
-	%_ui2_addr = alloca i32		; <i32*> [#uses=1]
-	%retval = alloca i32		; <i32*> [#uses=2]
-	%0 = alloca i32		; <i32*> [#uses=2]
+	%_ui1_addr = alloca i32		; <ptr> [#uses=2]
+	%_ui2_addr = alloca i32		; <ptr> [#uses=1]
+	%retval = alloca i32		; <ptr> [#uses=2]
+	%0 = alloca i32		; <ptr> [#uses=2]
 	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
-	store i32 %_ui1, i32* %_ui1_addr
-	store i32 %_ui2, i32* %_ui2_addr
-	%1 = load i32, i32* %_ui1_addr, align 4		; <i32> [#uses=1]
+	store i32 %_ui1, ptr %_ui1_addr
+	store i32 %_ui2, ptr %_ui2_addr
+	%1 = load i32, ptr %_ui1_addr, align 4		; <i32> [#uses=1]
 	%2 = sub i32 %1, 1		; <i32> [#uses=1]
-	store i32 %2, i32* %0, align 4
-	%3 = load i32, i32* %0, align 4		; <i32> [#uses=1]
-	store i32 %3, i32* %retval, align 4
+	store i32 %2, ptr %0, align 4
+	%3 = load i32, ptr %0, align 4		; <i32> [#uses=1]
+	store i32 %3, ptr %retval, align 4
 	br label %return
 
 return:		; preds = %entry
-	%retval1 = load i32, i32* %retval		; <i32> [#uses=1]
+	%retval1 = load i32, ptr %retval		; <i32> [#uses=1]
 	ret i32 %retval1
 }
 
 define void @int87(i8 signext %p_48, i8 signext %p_49) nounwind {
 entry:
-	%p_48_addr = alloca i8		; <i8*> [#uses=1]
-	%p_49_addr = alloca i8		; <i8*> [#uses=1]
-	%l_52 = alloca i32		; <i32*> [#uses=7]
-	%vol.0 = alloca i32		; <i32*> [#uses=1]
+	%p_48_addr = alloca i8		; <ptr> [#uses=1]
+	%p_49_addr = alloca i8		; <ptr> [#uses=1]
+	%l_52 = alloca i32		; <ptr> [#uses=7]
+	%vol.0 = alloca i32		; <ptr> [#uses=1]
 	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
-	store i8 %p_48, i8* %p_48_addr
-	store i8 %p_49, i8* %p_49_addr
+	store i8 %p_48, ptr %p_48_addr
+	store i8 %p_49, ptr %p_49_addr
 	br label %bb4
 
 bb:		; preds = %bb4
-	%0 = load volatile i32, i32* @x, align 4		; <i32> [#uses=1]
-	store i32 %0, i32* %vol.0, align 4
-	store i32 0, i32* %l_52, align 4
+	%0 = load volatile i32, ptr @x, align 4		; <i32> [#uses=1]
+	store i32 %0, ptr %vol.0, align 4
+	store i32 0, ptr %l_52, align 4
 	br label %bb2
 
 bb1:		; preds = %bb2
-	%1 = load i32, i32* %l_52, align 4		; <i32> [#uses=1]
+	%1 = load i32, ptr %l_52, align 4		; <i32> [#uses=1]
 	%2 = call i32 @safe_sub_func_uint64_t_u_u(i32 %1, i32 1) nounwind		; <i32> [#uses=1]
-	store i32 %2, i32* %l_52, align 4
+	store i32 %2, ptr %l_52, align 4
 	br label %bb2
 
 bb2:		; preds = %bb1, %bb
-	%3 = load i32, i32* %l_52, align 4		; <i32> [#uses=1]
+	%3 = load i32, ptr %l_52, align 4		; <i32> [#uses=1]
 	%4 = icmp eq i32 %3, 0		; <i1> [#uses=1]
 	br i1 %4, label %bb1, label %bb3
 
 bb3:		; preds = %bb2
-	%5 = load i32, i32* %l_52, align 4		; <i32> [#uses=1]
+	%5 = load i32, ptr %l_52, align 4		; <i32> [#uses=1]
 	%6 = call signext i8 @safe_sub_func_int32_t_s_s(i32 %5, i8 signext 1) nounwind		; <i8> [#uses=1]
 	%7 = sext i8 %6 to i32		; <i32> [#uses=1]
-	store i32 %7, i32* %l_52, align 4
+	store i32 %7, ptr %l_52, align 4
 	br label %bb4
 
 bb4:		; preds = %bb3, %entry
-	%8 = load i32, i32* %l_52, align 4		; <i32> [#uses=1]
+	%8 = load i32, ptr %l_52, align 4		; <i32> [#uses=1]
 	%9 = icmp ne i32 %8, 0		; <i1> [#uses=1]
 	br i1 %9, label %bb, label %bb5
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/backedge-on-min-max.ll b/llvm/test/Transforms/IndVarSimplify/backedge-on-min-max.ll
index fb05da59d1e61..4b52f1c984b2f 100644
--- a/llvm/test/Transforms/IndVarSimplify/backedge-on-min-max.ll
+++ b/llvm/test/Transforms/IndVarSimplify/backedge-on-min-max.ll
@@ -3,7 +3,7 @@
 
 ;; --- signed ---
 
-define void @min.signed.1(i32* %a, i32 %a_len, i32 %n) {
+define void @min.signed.1(ptr %a, i32 %a_len, i32 %n) {
 ; CHECK-LABEL: @min.signed.1
  entry:
   %smin.cmp = icmp slt i32 %a_len, %n
@@ -19,8 +19,8 @@ define void @min.signed.1(i32* %a, i32 %a_len, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -31,7 +31,7 @@ define void @min.signed.1(i32* %a, i32 %a_len, i32 %n) {
   ret void
 }
 
-define void @min.signed.2(i32* %a, i32 %a_len, i32 %n) {
+define void @min.signed.2(ptr %a, i32 %a_len, i32 %n) {
 ; CHECK-LABEL: @min.signed.2
  entry:
   %smin.cmp = icmp slt i32 %a_len, %n
@@ -47,8 +47,8 @@ define void @min.signed.2(i32* %a, i32 %a_len, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -59,7 +59,7 @@ define void @min.signed.2(i32* %a, i32 %a_len, i32 %n) {
   ret void
 }
 
-define void @min.signed.3(i32* %a, i32 %n) {
+define void @min.signed.3(ptr %a, i32 %n) {
 ; CHECK-LABEL: @min.signed.3
  entry:
   %smin.cmp = icmp slt i32 42, %n
@@ -75,8 +75,8 @@ define void @min.signed.3(i32* %a, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -87,7 +87,7 @@ define void @min.signed.3(i32* %a, i32 %n) {
   ret void
 }
 
-define void @min.signed.4(i32* %a, i32 %n) {
+define void @min.signed.4(ptr %a, i32 %n) {
 ; CHECK-LABEL: @min.signed.4
  entry:
   %smin.cmp = icmp slt i32 42, %n
@@ -103,8 +103,8 @@ define void @min.signed.4(i32* %a, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -115,7 +115,7 @@ define void @min.signed.4(i32* %a, i32 %n) {
   ret void
 }
 
-define void @max.signed.1(i32* %a, i32 %a_len, i32 %n) {
+define void @max.signed.1(ptr %a, i32 %a_len, i32 %n) {
 ; CHECK-LABEL: @max.signed.1
  entry:
   %smax.cmp = icmp sgt i32 %a_len, %n
@@ -131,8 +131,8 @@ define void @max.signed.1(i32* %a, i32 %a_len, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -143,7 +143,7 @@ define void @max.signed.1(i32* %a, i32 %a_len, i32 %n) {
   ret void
 }
 
-define void @max.signed.2(i32* %a, i32 %a_len, i32 %n) {
+define void @max.signed.2(ptr %a, i32 %a_len, i32 %n) {
 ; CHECK-LABEL: @max.signed.2
  entry:
   %smax.cmp = icmp sgt i32 %a_len, %n
@@ -159,8 +159,8 @@ define void @max.signed.2(i32* %a, i32 %a_len, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -171,7 +171,7 @@ define void @max.signed.2(i32* %a, i32 %a_len, i32 %n) {
   ret void
 }
 
-define void @max.signed.3(i32* %a, i32 %n, i32 %init) {
+define void @max.signed.3(ptr %a, i32 %n, i32 %init) {
 ; CHECK-LABEL: @max.signed.3
  entry:
   %smax.cmp = icmp sgt i32 42, %n
@@ -187,8 +187,8 @@ define void @max.signed.3(i32* %a, i32 %n, i32 %init) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -199,7 +199,7 @@ define void @max.signed.3(i32* %a, i32 %n, i32 %init) {
   ret void
 }
 
-define void @max.signed.4(i32* %a, i32 %n, i32 %init) {
+define void @max.signed.4(ptr %a, i32 %n, i32 %init) {
 ; CHECK-LABEL: @max.signed.4
  entry:
   %smax.cmp = icmp sgt i32 42, %n
@@ -215,8 +215,8 @@ define void @max.signed.4(i32* %a, i32 %n, i32 %init) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -229,7 +229,7 @@ define void @max.signed.4(i32* %a, i32 %n, i32 %init) {
 
 ;; --- unsigned ---
 
-define void @min.unsigned.1(i32* %a, i32 %a_len, i32 %n) {
+define void @min.unsigned.1(ptr %a, i32 %a_len, i32 %n) {
 ; CHECK-LABEL: @min.unsigned.1
  entry:
   %umin.cmp = icmp ult i32 %a_len, %n
@@ -245,8 +245,8 @@ define void @min.unsigned.1(i32* %a, i32 %a_len, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -257,7 +257,7 @@ define void @min.unsigned.1(i32* %a, i32 %a_len, i32 %n) {
   ret void
 }
 
-define void @min.unsigned.2(i32* %a, i32 %a_len, i32 %n) {
+define void @min.unsigned.2(ptr %a, i32 %a_len, i32 %n) {
 ; CHECK-LABEL: @min.unsigned.2
  entry:
   %umin.cmp = icmp ult i32 %a_len, %n
@@ -273,8 +273,8 @@ define void @min.unsigned.2(i32* %a, i32 %a_len, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -285,7 +285,7 @@ define void @min.unsigned.2(i32* %a, i32 %a_len, i32 %n) {
   ret void
 }
 
-define void @min.unsigned.3(i32* %a, i32 %n) {
+define void @min.unsigned.3(ptr %a, i32 %n) {
 ; CHECK-LABEL: @min.unsigned.3
  entry:
   %umin.cmp = icmp ult i32 42, %n
@@ -301,8 +301,8 @@ define void @min.unsigned.3(i32* %a, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -313,7 +313,7 @@ define void @min.unsigned.3(i32* %a, i32 %n) {
   ret void
 }
 
-define void @min.unsigned.4(i32* %a, i32 %n) {
+define void @min.unsigned.4(ptr %a, i32 %n) {
 ; CHECK-LABEL: @min.unsigned.4
  entry:
   %umin.cmp = icmp ult i32 42, %n
@@ -329,8 +329,8 @@ define void @min.unsigned.4(i32* %a, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -341,7 +341,7 @@ define void @min.unsigned.4(i32* %a, i32 %n) {
   ret void
 }
 
-define void @max.unsigned.1(i32* %a, i32 %a_len, i32 %n) {
+define void @max.unsigned.1(ptr %a, i32 %a_len, i32 %n) {
 ; CHECK-LABEL: @max.unsigned.1
  entry:
   %umax.cmp = icmp ugt i32 %a_len, %n
@@ -357,8 +357,8 @@ define void @max.unsigned.1(i32* %a, i32 %a_len, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -369,7 +369,7 @@ define void @max.unsigned.1(i32* %a, i32 %a_len, i32 %n) {
   ret void
 }
 
-define void @max.unsigned.2(i32* %a, i32 %a_len, i32 %n) {
+define void @max.unsigned.2(ptr %a, i32 %a_len, i32 %n) {
 ; CHECK-LABEL: @max.unsigned.2
  entry:
   %umax.cmp = icmp ugt i32 %a_len, %n
@@ -385,8 +385,8 @@ define void @max.unsigned.2(i32* %a, i32 %a_len, i32 %n) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -397,7 +397,7 @@ define void @max.unsigned.2(i32* %a, i32 %a_len, i32 %n) {
   ret void
 }
 
-define void @max.unsigned.3(i32* %a, i32 %n, i32 %init) {
+define void @max.unsigned.3(ptr %a, i32 %n, i32 %init) {
 ; CHECK-LABEL: @max.unsigned.3
  entry:
   %umax.cmp = icmp ugt i32 42, %n
@@ -413,8 +413,8 @@ define void @max.unsigned.3(i32* %a, i32 %n, i32 %init) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:
@@ -425,7 +425,7 @@ define void @max.unsigned.3(i32* %a, i32 %n, i32 %init) {
   ret void
 }
 
-define void @max.unsigned.4(i32* %a, i32 %n, i32 %init) {
+define void @max.unsigned.4(ptr %a, i32 %n, i32 %init) {
 ; CHECK-LABEL: @max.unsigned.4
  entry:
   %umax.cmp = icmp ugt i32 42, %n
@@ -441,8 +441,8 @@ define void @max.unsigned.4(i32* %a, i32 %n, i32 %init) {
 ; CHECK: br i1 true, label %ok, label %latch
 
  ok:
-  %addr = getelementptr i32, i32* %a, i32 %idx
-  store i32 %idx, i32* %addr
+  %addr = getelementptr i32, ptr %a, i32 %idx
+  store i32 %idx, ptr %addr
   br label %latch
 
  latch:

diff  --git a/llvm/test/Transforms/IndVarSimplify/bbi-63564.ll b/llvm/test/Transforms/IndVarSimplify/bbi-63564.ll
index 867c17ac83d87..0de70f2753cff 100644
--- a/llvm/test/Transforms/IndVarSimplify/bbi-63564.ll
+++ b/llvm/test/Transforms/IndVarSimplify/bbi-63564.ll
@@ -20,11 +20,11 @@ define void @f() {
 ; CHECK:       for.body2:
 ; CHECK-NEXT:    [[INC2:%.*]] = phi i16 [ undef, [[FOR_BODY]] ], [ [[INC:%.*]], [[FOR_BODY2]] ]
 ; CHECK-NEXT:    [[INC]] = add nuw nsw i16 [[INC2]], 1
-; CHECK-NEXT:    store i16 [[INC]], i16* undef, align 1
+; CHECK-NEXT:    store i16 [[INC]], ptr undef, align 1
 ; CHECK-NEXT:    br i1 true, label [[FOR_BODY2]], label [[CRIT_EDGE:%.*]]
 ; CHECK:       crit_edge:
 ; CHECK-NEXT:    [[INC_LCSSA:%.*]] = phi i16 [ [[INC]], [[FOR_BODY2]] ]
-; CHECK-NEXT:    store i16 [[INC_LCSSA]], i16* @a, align 1
+; CHECK-NEXT:    store i16 [[INC_LCSSA]], ptr @a, align 1
 ; CHECK-NEXT:    unreachable
 ; CHECK:       for.end4:
 ; CHECK-NEXT:    ret void
@@ -36,21 +36,21 @@ for.cond:                                         ; preds = %entry
   br i1 false, label %for.body, label %for.end4
 
 for.body:                                         ; preds = %for.cond
-  %c.promoted = load i16, i16* @c, align 1
+  %c.promoted = load i16, ptr @c, align 1
   br label %for.body2
 
 for.body2:                                        ; preds = %for.body2, %for.body
   %inc33 = phi i16 [ %c.promoted, %for.body ], [ %inc3, %for.body2 ]
   %inc2 = phi i16 [ undef, %for.body ], [ %inc, %for.body2 ]
   %inc = add nsw i16 %inc2, 1
-  store i16 %inc, i16* undef, align 1
+  store i16 %inc, ptr undef, align 1
   %inc3 = add nsw i16 %inc33, 1
   %tobool = icmp ne i16 %inc3, 0
   br i1 %tobool, label %for.body2, label %crit_edge
 
 crit_edge:                                        ; preds = %for.body2
   %inc.lcssa = phi i16 [ %inc, %for.body2 ]
-  store i16 %inc.lcssa, i16* @a, align 1
+  store i16 %inc.lcssa, ptr @a, align 1
   unreachable
 
 for.end4:                                         ; preds = %for.cond

diff  --git a/llvm/test/Transforms/IndVarSimplify/bec-cmp.ll b/llvm/test/Transforms/IndVarSimplify/bec-cmp.ll
index 3084c8c1a1a7e..5faaf0836b0a9 100644
--- a/llvm/test/Transforms/IndVarSimplify/bec-cmp.ll
+++ b/llvm/test/Transforms/IndVarSimplify/bec-cmp.ll
@@ -3,7 +3,7 @@ target datalayout = "E-m:e-i64:64-n32:64"
 target triple = "powerpc64-unknown-linux-gnu"
 
 ; Function Attrs: nounwind
-define void @foo(i32* nocapture %a, i32* nocapture readonly %b, i32 signext %n) #0 {
+define void @foo(ptr nocapture %a, ptr nocapture readonly %b, i32 signext %n) #0 {
 entry:
 
 ; CHECK-LABEL: @foo
@@ -30,11 +30,11 @@ for.body:                                         ; preds = %for.body.lr.ph, %fo
 
 if.then:                                          ; preds = %for.body
   %idxprom = sext i32 %i.011 to i64
-  %arrayidx = getelementptr inbounds i32, i32* %b, i64 %idxprom
-  %0 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %b, i64 %idxprom
+  %0 = load i32, ptr %arrayidx, align 4
   %add = add nsw i32 %0, 1
-  %arrayidx3 = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %add, i32* %arrayidx3, align 4
+  %arrayidx3 = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %add, ptr %arrayidx3, align 4
   br label %for.inc
 
 for.inc:                                          ; preds = %for.body, %if.then

diff  --git a/llvm/test/Transforms/IndVarSimplify/canonicalize-cmp.ll b/llvm/test/Transforms/IndVarSimplify/canonicalize-cmp.ll
index 40d255a6d42a7..c8b5b7b61bc49 100644
--- a/llvm/test/Transforms/IndVarSimplify/canonicalize-cmp.ll
+++ b/llvm/test/Transforms/IndVarSimplify/canonicalize-cmp.ll
@@ -6,7 +6,7 @@
 
 target datalayout = "n8:16:32:64"
 
-define i32 @test_01(i32 %a, i32 %b, i32* %p) {
+define i32 @test_01(i32 %a, i32 %b, ptr %p) {
 ; CHECK-LABEL: @test_01(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP_ENTRY:%.*]]
@@ -15,19 +15,19 @@ define i32 @test_01(i32 %a, i32 %b, i32* %p) {
 ; CHECK-NEXT:    [[CMP1:%.*]] = icmp ult i32 [[IV]], 100
 ; CHECK-NEXT:    br i1 [[CMP1]], label [[B1:%.*]], label [[B2:%.*]]
 ; CHECK:       b1:
-; CHECK-NEXT:    store i32 [[IV]], i32* [[P:%.*]], align 4
+; CHECK-NEXT:    store i32 [[IV]], ptr [[P:%.*]], align 4
 ; CHECK-NEXT:    br label [[MERGE:%.*]]
 ; CHECK:       b2:
-; CHECK-NEXT:    store i32 [[A:%.*]], i32* [[P]], align 4
+; CHECK-NEXT:    store i32 [[A:%.*]], ptr [[P]], align 4
 ; CHECK-NEXT:    br label [[MERGE]]
 ; CHECK:       merge:
 ; CHECK-NEXT:    [[CMP2:%.*]] = icmp ult i32 [[IV]], 100
 ; CHECK-NEXT:    br i1 [[CMP2]], label [[B3:%.*]], label [[B4:%.*]]
 ; CHECK:       b3:
-; CHECK-NEXT:    store i32 [[IV]], i32* [[P]], align 4
+; CHECK-NEXT:    store i32 [[IV]], ptr [[P]], align 4
 ; CHECK-NEXT:    br label [[LOOP_BE]]
 ; CHECK:       b4:
-; CHECK-NEXT:    store i32 [[B:%.*]], i32* [[P]], align 4
+; CHECK-NEXT:    store i32 [[B:%.*]], ptr [[P]], align 4
 ; CHECK-NEXT:    br label [[LOOP_BE]]
 ; CHECK:       loop.be:
 ; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
@@ -46,11 +46,11 @@ loop.entry:
   br i1 %cmp1, label %b1, label %b2
 
 b1:
-  store i32 %iv, i32* %p
+  store i32 %iv, ptr %p
   br label %merge
 
 b2:
-  store i32 %a, i32* %p
+  store i32 %a, ptr %p
   br label %merge
 
 merge:
@@ -58,11 +58,11 @@ merge:
   br i1 %cmp2, label %b3, label %b4
 
 b3:
-  store i32 %iv, i32* %p
+  store i32 %iv, ptr %p
   br label %loop.be
 
 b4:
-  store i32 %b, i32* %p
+  store i32 %b, ptr %p
   br label %loop.be
 
 loop.be:
@@ -74,7 +74,7 @@ exit:
   ret i32 %iv
 }
 
-define i32 @test_02(i32 %a, i32 %b, i32* %p) {
+define i32 @test_02(i32 %a, i32 %b, ptr %p) {
 ; CHECK-LABEL: @test_02(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP_ENTRY:%.*]]
@@ -83,19 +83,19 @@ define i32 @test_02(i32 %a, i32 %b, i32* %p) {
 ; CHECK-NEXT:    [[CMP1:%.*]] = icmp ugt i32 100, [[IV]]
 ; CHECK-NEXT:    br i1 [[CMP1]], label [[B1:%.*]], label [[B2:%.*]]
 ; CHECK:       b1:
-; CHECK-NEXT:    store i32 [[IV]], i32* [[P:%.*]], align 4
+; CHECK-NEXT:    store i32 [[IV]], ptr [[P:%.*]], align 4
 ; CHECK-NEXT:    br label [[MERGE:%.*]]
 ; CHECK:       b2:
-; CHECK-NEXT:    store i32 [[A:%.*]], i32* [[P]], align 4
+; CHECK-NEXT:    store i32 [[A:%.*]], ptr [[P]], align 4
 ; CHECK-NEXT:    br label [[MERGE]]
 ; CHECK:       merge:
 ; CHECK-NEXT:    [[CMP2:%.*]] = icmp ugt i32 100, [[IV]]
 ; CHECK-NEXT:    br i1 [[CMP2]], label [[B3:%.*]], label [[B4:%.*]]
 ; CHECK:       b3:
-; CHECK-NEXT:    store i32 [[IV]], i32* [[P]], align 4
+; CHECK-NEXT:    store i32 [[IV]], ptr [[P]], align 4
 ; CHECK-NEXT:    br label [[LOOP_BE]]
 ; CHECK:       b4:
-; CHECK-NEXT:    store i32 [[B:%.*]], i32* [[P]], align 4
+; CHECK-NEXT:    store i32 [[B:%.*]], ptr [[P]], align 4
 ; CHECK-NEXT:    br label [[LOOP_BE]]
 ; CHECK:       loop.be:
 ; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
@@ -114,11 +114,11 @@ loop.entry:
   br i1 %cmp1, label %b1, label %b2
 
 b1:
-  store i32 %iv, i32* %p
+  store i32 %iv, ptr %p
   br label %merge
 
 b2:
-  store i32 %a, i32* %p
+  store i32 %a, ptr %p
   br label %merge
 
 merge:
@@ -126,11 +126,11 @@ merge:
   br i1 %cmp2, label %b3, label %b4
 
 b3:
-  store i32 %iv, i32* %p
+  store i32 %iv, ptr %p
   br label %loop.be
 
 b4:
-  store i32 %b, i32* %p
+  store i32 %b, ptr %p
   br label %loop.be
 
 loop.be:

diff  --git a/llvm/test/Transforms/IndVarSimplify/constant-fold.ll b/llvm/test/Transforms/IndVarSimplify/constant-fold.ll
index 995e6589fd5d6..87287758e06c4 100644
--- a/llvm/test/Transforms/IndVarSimplify/constant-fold.ll
+++ b/llvm/test/Transforms/IndVarSimplify/constant-fold.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -passes=indvars -S < %s | FileCheck %s
 
-define void @test0(i32* %x) {
+define void @test0(ptr %x) {
 entry:
   br label %for.inc
 
@@ -9,7 +9,7 @@ for.inc:                                          ; preds = %for.inc, %entry
   %and = and i32 %i.01, 3
   %cmp1 = icmp eq i32 %and, 0
   %cond = select i1 %cmp1, i32 0, i32 1
-  store i32 %cond, i32* %x, align 4
+  store i32 %cond, ptr %x, align 4
   %add = add i32 %i.01, 4
   %cmp = icmp ult i32 %add, 8
   br i1 %cmp, label %for.inc, label %for.end
@@ -22,7 +22,7 @@ for.end:                                          ; preds = %for.inc
 ; CHECK-LABEL: void @test0(
 ; CHECK:         icmp eq i32 0, 0
 
-define void @test1(i32* %a) {
+define void @test1(ptr %a) {
 entry:
   br label %for.body
 
@@ -31,8 +31,8 @@ for.body:                                         ; preds = %entry, %for.body
   %mul = mul nsw i32 %i.01, 64
   %rem = srem i32 %mul, 8
   %idxprom = sext i32 %rem to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end

diff  --git a/llvm/test/Transforms/IndVarSimplify/constant_result.ll b/llvm/test/Transforms/IndVarSimplify/constant_result.ll
index 6eae0cd806a41..1eb5bb9a4dc14 100644
--- a/llvm/test/Transforms/IndVarSimplify/constant_result.ll
+++ b/llvm/test/Transforms/IndVarSimplify/constant_result.ll
@@ -9,8 +9,8 @@ define i16 @foo() {
 ; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[I:%.*]] = phi i16 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ]
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [400 x i16], [400 x i16]* @Y, i16 0, i16 [[I]]
-; CHECK-NEXT:    store i16 0, i16* [[ARRAYIDX]], align 1
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [400 x i16], ptr @Y, i16 0, i16 [[I]]
+; CHECK-NEXT:    store i16 0, ptr [[ARRAYIDX]], align 1
 ; CHECK-NEXT:    [[INC]] = add nuw nsw i16 [[I]], 1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ult i16 [[INC]], 400
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]
@@ -23,8 +23,8 @@ entry:
 for.body:                                         ; preds = %entry, %for.body
   %i = phi i16 [ 0, %entry ], [ %inc, %for.body ]
 
-  %arrayidx = getelementptr inbounds [400 x i16], [400 x i16]* @Y, i16 0, i16 %i
-  store i16 0, i16* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [400 x i16], ptr @Y, i16 0, i16 %i
+  store i16 0, ptr %arrayidx, align 1
   %inc = add nuw nsw i16 %i, 1
   %cmp = icmp ult i16 %inc, 400
   br i1 %cmp, label %for.body, label %for.end

diff  --git a/llvm/test/Transforms/IndVarSimplify/crash.ll b/llvm/test/Transforms/IndVarSimplify/crash.ll
index 20ca822d0be77..d3c417c5a15f5 100644
--- a/llvm/test/Transforms/IndVarSimplify/crash.ll
+++ b/llvm/test/Transforms/IndVarSimplify/crash.ll
@@ -3,7 +3,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 
 declare i32 @putchar(i8) nounwind
 
-define void @t2(i1* %P) nounwind {
+define void @t2(ptr %P) nounwind {
 ; <label>:0
   br label %1
 
@@ -12,7 +12,7 @@ define void @t2(i1* %P) nounwind {
   %3 = tail call i32 @putchar(i8 72)              ; <i32> [#uses=0]
   %4 = fadd double %2, -1.000000e+00              ; <double> [#uses=2]
   %5 = fcmp ult double %4, 0.000000e+00           ; <i1> [#uses=1]
-  store i1 %5, i1* %P
+  store i1 %5, ptr %P
   br i1 %5, label %6, label %1
 
 ; <label>:6                                       ; preds = %1
@@ -60,9 +60,9 @@ declare void @__go_panic() noreturn
 
 declare void @__go_undefer()
 
-declare i32 @__gccgo_personality_v0(i32, i64, i8*, i8*)
+declare i32 @__gccgo_personality_v0(i32, i64, ptr, ptr)
 
-define void @main.main() uwtable personality i32 (i32, i64, i8*, i8*)* @__gccgo_personality_v0 {
+define void @main.main() uwtable personality ptr @__gccgo_personality_v0 {
 entry:
   invoke void @__go_panic() noreturn
           to label %0 unwind label %"5.i"
@@ -75,13 +75,13 @@ entry:
           to label %main.f.exit unwind label %"7.i"
 
 "5.i":                                            ; preds = %entry
-  %1 = landingpad { i8*, i32 }
-          catch i8* null
+  %1 = landingpad { ptr, i32 }
+          catch ptr null
   br label %"3.i"
 
 "7.i":                                            ; preds = %"3.i"
-  %2 = landingpad { i8*, i32 }
-          catch i8* null
+  %2 = landingpad { ptr, i32 }
+          catch ptr null
   br label %"3.i"
 
 main.f.exit:                                      ; preds = %"3.i"

diff  --git a/llvm/test/Transforms/IndVarSimplify/dangling-use.ll b/llvm/test/Transforms/IndVarSimplify/dangling-use.ll
index d7702fff49a2e..89d48ea7f8058 100644
--- a/llvm/test/Transforms/IndVarSimplify/dangling-use.ll
+++ b/llvm/test/Transforms/IndVarSimplify/dangling-use.ll
@@ -3,39 +3,38 @@
 target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i8:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128-n32"
 target triple = "powerpc-unknown-linux-gnu"
 
-define void @vec_inverse_5_7_vert_loop_copyseparate(i8* %x, i32 %n, i32 %rowbytes) nounwind {
+define void @vec_inverse_5_7_vert_loop_copyseparate(ptr %x, i32 %n, i32 %rowbytes) nounwind {
 entry:
   %tmp1 = sdiv i32 %n, 3                          ; <i32> [#uses=1]
   %tmp2 = sdiv i32 %rowbytes, 5                   ; <i32> [#uses=2]
   br label %bb49
 
 bb49:                                             ; preds = %bb48, %entry
-  %x_addr.0 = phi i8* [ %x, %entry ], [ %tmp481, %bb48 ] ; <i8*> [#uses=2]
+  %x_addr.0 = phi ptr [ %x, %entry ], [ %tmp481, %bb48 ] ; <ptr> [#uses=2]
   br label %bb10
 
 bb10:                                             ; preds = %bb49
   %tmp326 = mul nsw i32 %tmp1, %tmp2              ; <i32> [#uses=1]
-  %tmp351 = getelementptr inbounds i8, i8* %x_addr.0, i32 %tmp326 ; <i8*> [#uses=1]
+  %tmp351 = getelementptr inbounds i8, ptr %x_addr.0, i32 %tmp326 ; <ptr> [#uses=1]
   br i1 false, label %bb.nph, label %bb48
 
 bb.nph:                                           ; preds = %bb10
   br label %bb23
 
 bb23:                                             ; preds = %bb28, %bb.nph
-  %pOriginHi.01 = phi i8* [ %tmp351, %bb.nph ], [ %pOriginHi.0, %bb28 ] ; <i8*> [#uses=2]
-  %tmp378 = bitcast i8* %pOriginHi.01 to i8*      ; <i8*> [#uses=1]
-  store i8* %tmp378, i8** null
-  %tmp385 = getelementptr inbounds i8, i8* %pOriginHi.01, i32 %tmp2 ; <i8*> [#uses=1]
+  %pOriginHi.01 = phi ptr [ %tmp351, %bb.nph ], [ %pOriginHi.0, %bb28 ] ; <ptr> [#uses=2]
+  store ptr %pOriginHi.01, ptr null
+  %tmp385 = getelementptr inbounds i8, ptr %pOriginHi.01, i32 %tmp2 ; <ptr> [#uses=1]
   br label %bb28
 
 bb28:                                             ; preds = %bb23
-  %pOriginHi.0 = phi i8* [ %tmp385, %bb23 ]       ; <i8*> [#uses=1]
+  %pOriginHi.0 = phi ptr [ %tmp385, %bb23 ]       ; <ptr> [#uses=1]
   br i1 false, label %bb23, label %bb28.bb48_crit_edge
 
 bb28.bb48_crit_edge:                              ; preds = %bb28
   br label %bb48
 
 bb48:                                             ; preds = %bb28.bb48_crit_edge, %bb10
-  %tmp481 = getelementptr inbounds i8, i8* %x_addr.0, i32 1 ; <i8*> [#uses=1]
+  %tmp481 = getelementptr inbounds i8, ptr %x_addr.0, i32 1 ; <ptr> [#uses=1]
   br label %bb49
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/deterministic-sign.ll b/llvm/test/Transforms/IndVarSimplify/deterministic-sign.ll
index 62afded30b21e..1daaccd4bb5f4 100644
--- a/llvm/test/Transforms/IndVarSimplify/deterministic-sign.ll
+++ b/llvm/test/Transforms/IndVarSimplify/deterministic-sign.ll
@@ -5,7 +5,7 @@
 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
 target triple = "aarch64-unknown-linux-gnu"
 
-define dso_local float @foo(float* noalias %dst, float* %src, i32 %offset, i32 %N) {
+define dso_local float @foo(ptr noalias %dst, ptr %src, i32 %offset, i32 %N) {
 ; CHECK-LABEL: @foo(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[CMP1:%.*]] = icmp slt i32 1, [[N:%.*]]
@@ -21,14 +21,14 @@ define dso_local float @foo(float* noalias %dst, float* %src, i32 %offset, i32 %
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ 1, [[FOR_BODY_LR_PH]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[TMP1:%.*]] = add nsw i64 [[INDVARS_IV]], [[TMP0]]
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds float, float* [[SRC:%.*]], i64 [[TMP1]]
-; CHECK-NEXT:    [[TMP2:%.*]] = load float, float* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds float, ptr [[SRC:%.*]], i64 [[TMP1]]
+; CHECK-NEXT:    [[TMP2:%.*]] = load float, ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[TMP3:%.*]] = add nsw i64 [[TMP1]], 1
-; CHECK-NEXT:    [[ARRAYIDX3:%.*]] = getelementptr inbounds float, float* [[SRC]], i64 [[TMP3]]
-; CHECK-NEXT:    [[TMP4:%.*]] = load float, float* [[ARRAYIDX3]], align 4
+; CHECK-NEXT:    [[ARRAYIDX3:%.*]] = getelementptr inbounds float, ptr [[SRC]], i64 [[TMP3]]
+; CHECK-NEXT:    [[TMP4:%.*]] = load float, ptr [[ARRAYIDX3]], align 4
 ; CHECK-NEXT:    [[ADD4:%.*]] = fadd fast float [[TMP2]], [[TMP4]]
-; CHECK-NEXT:    [[ARRAYIDX6:%.*]] = getelementptr inbounds float, float* [[DST:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    store float [[ADD4]], float* [[ARRAYIDX6]], align 4
+; CHECK-NEXT:    [[ARRAYIDX6:%.*]] = getelementptr inbounds float, ptr [[DST:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    store float [[ADD4]], ptr [[ARRAYIDX6]], align 4
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_COND_FOR_COND_CLEANUP_CRIT_EDGE:%.*]], !llvm.loop [[LOOP0:![0-9]+]]
@@ -47,16 +47,16 @@ for.cond.cleanup:                                 ; preds = %for.cond
 for.body:                                         ; preds = %for.cond
   %add = add nsw i32 %i.0, %offset
   %idxprom = sext i32 %add to i64
-  %arrayidx = getelementptr inbounds float, float* %src, i64 %idxprom
-  %0 = load float, float* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds float, ptr %src, i64 %idxprom
+  %0 = load float, ptr %arrayidx, align 4
   %add1 = add nsw i32 %add, 1
   %idxprom2 = sext i32 %add1 to i64
-  %arrayidx3 = getelementptr inbounds float, float* %src, i64 %idxprom2
-  %1 = load float, float* %arrayidx3, align 4
+  %arrayidx3 = getelementptr inbounds float, ptr %src, i64 %idxprom2
+  %1 = load float, ptr %arrayidx3, align 4
   %add4 = fadd fast float %0, %1
   %idxprom5 = zext i32 %i.0 to i64
-  %arrayidx6 = getelementptr inbounds float, float* %dst, i64 %idxprom5
-  store float %add4, float* %arrayidx6, align 4
+  %arrayidx6 = getelementptr inbounds float, ptr %dst, i64 %idxprom5
+  store float %add4, ptr %arrayidx6, align 4
   %inc = add nuw nsw i32 %i.0, 1
   br label %for.cond, !llvm.loop !1
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/divide-pointer.ll b/llvm/test/Transforms/IndVarSimplify/divide-pointer.ll
index 5ad66a95d8768..8d09e7c78eb35 100644
--- a/llvm/test/Transforms/IndVarSimplify/divide-pointer.ll
+++ b/llvm/test/Transforms/IndVarSimplify/divide-pointer.ll
@@ -6,7 +6,7 @@ target triple = "i386-apple-darwin10.0"
 	%struct.xyz = type <{ i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, [8 x i8], i64, i64, i32, i32, [4 x i32], i32, i32, i32, i32, i32, i32, [76 x i32], i32, [2 x %struct.uvw] }>
 	%struct.uvw = type <{ i64, i64 }>
 
-define i32 @foo(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
+define i32 @foo(ptr %header, ptr %p2, ptr %p3, ptr nocapture %p4) nounwind {
 entry:
 	br label %while.body.i
 
@@ -14,7 +14,7 @@ while.body.i:		; preds = %while.body.i, %entry
 	br i1 undef, label %while.body.i, label %bcopy_internal.exit
 
 bcopy_internal.exit:		; preds = %while.body.i
-	%conv135 = ptrtoint %struct.xyz* %header to i32		; <i32> [#uses=1]
+	%conv135 = ptrtoint ptr %header to i32		; <i32> [#uses=1]
 	%shr136 = lshr i32 %conv135, 12		; <i32> [#uses=1]
 	br label %for.body
 
@@ -28,7 +28,7 @@ if.then199:		; preds = %if.then199, %for.body
 	br label %if.then199
 }
 
-define i32 @same_thing_but_signed(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
+define i32 @same_thing_but_signed(ptr %header, ptr %p2, ptr %p3, ptr nocapture %p4) nounwind {
 entry:
 	br label %while.body.i
 
@@ -36,7 +36,7 @@ while.body.i:		; preds = %while.body.i, %entry
 	br i1 undef, label %while.body.i, label %bcopy_internal.exit
 
 bcopy_internal.exit:		; preds = %while.body.i
-	%conv135 = ptrtoint %struct.xyz* %header to i32		; <i32> [#uses=1]
+	%conv135 = ptrtoint ptr %header to i32		; <i32> [#uses=1]
 	%shr136 = ashr i32 %conv135, 12		; <i32> [#uses=1]
 	br label %for.body
 
@@ -50,7 +50,7 @@ if.then199:		; preds = %if.then199, %for.body
 	br label %if.then199
 }
 
-define i32 @same_thing_but_multiplied(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
+define i32 @same_thing_but_multiplied(ptr %header, ptr %p2, ptr %p3, ptr nocapture %p4) nounwind {
 entry:
 	br label %while.body.i
 
@@ -58,7 +58,7 @@ while.body.i:		; preds = %while.body.i, %entry
 	br i1 undef, label %while.body.i, label %bcopy_internal.exit
 
 bcopy_internal.exit:		; preds = %while.body.i
-	%conv135 = ptrtoint %struct.xyz* %header to i32		; <i32> [#uses=1]
+	%conv135 = ptrtoint ptr %header to i32		; <i32> [#uses=1]
 	%shr136 = shl i32 %conv135, 12		; <i32> [#uses=1]
 	br label %for.body
 
@@ -72,7 +72,7 @@ if.then199:		; preds = %if.then199, %for.body
 	br label %if.then199
 }
 
-define i32 @same_thing_but_xored(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
+define i32 @same_thing_but_xored(ptr %header, ptr %p2, ptr %p3, ptr nocapture %p4) nounwind {
 entry:
 	br label %while.body.i
 
@@ -80,7 +80,7 @@ while.body.i:		; preds = %while.body.i, %entry
 	br i1 undef, label %while.body.i, label %bcopy_internal.exit
 
 bcopy_internal.exit:		; preds = %while.body.i
-	%conv135 = ptrtoint %struct.xyz* %header to i32		; <i32> [#uses=1]
+	%conv135 = ptrtoint ptr %header to i32		; <i32> [#uses=1]
 	%shr136 = xor i32 %conv135, 12		; <i32> [#uses=1]
 	br label %for.body
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/dont-recompute.ll b/llvm/test/Transforms/IndVarSimplify/dont-recompute.ll
index bf97fe1afd6e7..b4cd98cd234f0 100644
--- a/llvm/test/Transforms/IndVarSimplify/dont-recompute.ll
+++ b/llvm/test/Transforms/IndVarSimplify/dont-recompute.ll
@@ -201,7 +201,7 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
-define void @test6(i32 %m, i32* %p) nounwind uwtable {
+define void @test6(i32 %m, ptr %p) nounwind uwtable {
 ; CHECK-LABEL: @test6(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
@@ -210,8 +210,8 @@ define void @test6(i32 %m, i32* %p) nounwind uwtable {
 ; CHECK-NEXT:    [[A_05:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[ADD:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[ADD]] = add i32 [[A_05]], [[M:%.*]]
 ; CHECK-NEXT:    [[SOFT_USE:%.*]] = add i32 [[ADD]], 123
-; CHECK-NEXT:    [[PIDX:%.*]] = getelementptr i32, i32* [[P:%.*]], i32 [[ADD]]
-; CHECK-NEXT:    store i32 [[SOFT_USE]], i32* [[PIDX]]
+; CHECK-NEXT:    [[PIDX:%.*]] = getelementptr i32, ptr [[P:%.*]], i32 [[ADD]]
+; CHECK-NEXT:    store i32 [[SOFT_USE]], ptr [[PIDX]]
 ; CHECK-NEXT:    [[INC]] = add nuw nsw i32 [[I_06]], 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i32 [[INC]], 186
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -228,8 +228,8 @@ for.body:                                         ; preds = %for.body, %entry
   %a.05 = phi i32 [ 0, %entry ], [ %add, %for.body ]
   %add = add i32 %a.05, %m
   %soft_use = add i32 %add, 123
-  %pidx = getelementptr i32, i32* %p, i32 %add
-  store i32 %soft_use, i32* %pidx
+  %pidx = getelementptr i32, ptr %p, i32 %add
+  store i32 %soft_use, ptr %pidx
   %inc = add nsw i32 %i.06, 1
   %exitcond = icmp eq i32 %inc, 186
   br i1 %exitcond, label %for.end, label %for.body

diff  --git a/llvm/test/Transforms/IndVarSimplify/drop-exact.ll b/llvm/test/Transforms/IndVarSimplify/drop-exact.ll
index 70afda9ed4b28..fb8027df74ee7 100644
--- a/llvm/test/Transforms/IndVarSimplify/drop-exact.ll
+++ b/llvm/test/Transforms/IndVarSimplify/drop-exact.ll
@@ -5,7 +5,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
 
 ; We make a transform by getting rid of add nsw i32 %tmp17, -1; make sure that
 ; we drop "exact" flag on lshr as we do it.
-define void @drop_exact(i32* %p, i64* %p1) {
+define void @drop_exact(ptr %p, ptr %p1) {
 ; CHECK-LABEL: @drop_exact(
 ; CHECK-NEXT:  bb:
 ; CHECK-NEXT:    br label [[BB12:%.*]]
@@ -20,9 +20,9 @@ define void @drop_exact(i32* %p, i64* %p1) {
 ; CHECK-NEXT:    [[TMP19:%.*]] = lshr i32 [[TMP17]], 1
 ; CHECK-NEXT:    [[TMP20:%.*]] = urem i32 [[TMP19]], 250
 ; CHECK-NEXT:    [[TMP22:%.*]] = lshr i32 [[TMP17]], 1
-; CHECK-NEXT:    store i32 [[TMP22]], i32* [[P:%.*]], align 4
+; CHECK-NEXT:    store i32 [[TMP22]], ptr [[P:%.*]], align 4
 ; CHECK-NEXT:    [[TMP26:%.*]] = zext i32 [[TMP20]] to i64
-; CHECK-NEXT:    store i64 [[TMP26]], i64* [[P1:%.*]], align 4
+; CHECK-NEXT:    store i64 [[TMP26]], ptr [[P1:%.*]], align 4
 ; CHECK-NEXT:    [[TMP42]] = add nuw nsw i32 [[TMP14]], 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i32 [[TMP42]], 719
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[BB7:%.*]], label [[BB12]]
@@ -43,16 +43,16 @@ bb12:                                             ; preds = %bb12, %bb
   %tmp20 = urem i32 %tmp19, 250
   %tmp21 = add nsw i32 %tmp17, -1
   %tmp22 = lshr exact i32 %tmp21, 1
-  store i32 %tmp22, i32* %p, align 4
+  store i32 %tmp22, ptr %p, align 4
   %tmp26 = zext i32 %tmp20 to i64
-  store i64 %tmp26, i64* %p1, align 4
+  store i64 %tmp26, ptr %p1, align 4
   %tmp42 = add nuw nsw i32 %tmp14, 1
   %tmp43 = icmp ugt i32 %tmp14, 717
   br i1 %tmp43, label %bb7, label %bb12
 }
 
 ; Throw away add nsw i32 %tmp17, 0, do not drop exact flag.
-define void @dont_drop_exact(i32* %p, i64* %p1) {
+define void @dont_drop_exact(ptr %p, ptr %p1) {
 ; CHECK-LABEL: @dont_drop_exact(
 ; CHECK-NEXT:  bb:
 ; CHECK-NEXT:    br label [[BB12:%.*]]
@@ -67,9 +67,9 @@ define void @dont_drop_exact(i32* %p, i64* %p1) {
 ; CHECK-NEXT:    [[TMP19:%.*]] = lshr i32 [[TMP17]], 1
 ; CHECK-NEXT:    [[TMP20:%.*]] = urem i32 [[TMP19]], 250
 ; CHECK-NEXT:    [[TMP22:%.*]] = lshr exact i32 [[TMP17]], 1
-; CHECK-NEXT:    store i32 [[TMP22]], i32* [[P:%.*]], align 4
+; CHECK-NEXT:    store i32 [[TMP22]], ptr [[P:%.*]], align 4
 ; CHECK-NEXT:    [[TMP26:%.*]] = zext i32 [[TMP20]] to i64
-; CHECK-NEXT:    store i64 [[TMP26]], i64* [[P1:%.*]], align 4
+; CHECK-NEXT:    store i64 [[TMP26]], ptr [[P1:%.*]], align 4
 ; CHECK-NEXT:    [[TMP42]] = add nuw nsw i32 [[TMP14]], 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i32 [[TMP42]], 719
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[BB7:%.*]], label [[BB12]]
@@ -90,9 +90,9 @@ bb12:                                             ; preds = %bb12, %bb
   %tmp20 = urem i32 %tmp19, 250
   %tmp21 = add nsw i32 %tmp17, 0
   %tmp22 = lshr exact i32 %tmp21, 1
-  store i32 %tmp22, i32* %p, align 4
+  store i32 %tmp22, ptr %p, align 4
   %tmp26 = zext i32 %tmp20 to i64
-  store i64 %tmp26, i64* %p1, align 4
+  store i64 %tmp26, ptr %p1, align 4
   %tmp42 = add nuw nsw i32 %tmp14, 1
   %tmp43 = icmp ugt i32 %tmp14, 717
   br i1 %tmp43, label %bb7, label %bb12

diff  --git a/llvm/test/Transforms/IndVarSimplify/elim-extend.ll b/llvm/test/Transforms/IndVarSimplify/elim-extend.ll
index 56f8d16c46cf6..137fd4746ccf6 100644
--- a/llvm/test/Transforms/IndVarSimplify/elim-extend.ll
+++ b/llvm/test/Transforms/IndVarSimplify/elim-extend.ll
@@ -5,7 +5,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 
 ; IV with constant start, preinc and postinc sign extends, with and without NSW.
 ; IV rewrite only removes one sext. WidenIVs removes all three.
-define void @postincConstIV(i8* %base, i32 %limit) nounwind {
+define void @postincConstIV(ptr %base, i32 %limit) nounwind {
 ; CHECK-LABEL: @postincConstIV(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[SMAX:%.*]] = call i32 @llvm.smax.i32(i32 [[LIMIT:%.*]], i32 0)
@@ -14,13 +14,13 @@ define void @postincConstIV(i8* %base, i32 %limit) nounwind {
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[LOOP]] ], [ 0, [[ENTRY:%.*]] ]
-; CHECK-NEXT:    [[PREADR:%.*]] = getelementptr i8, i8* [[BASE:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    store i8 0, i8* [[PREADR]], align 1
+; CHECK-NEXT:    [[PREADR:%.*]] = getelementptr i8, ptr [[BASE:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    store i8 0, ptr [[PREADR]], align 1
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
-; CHECK-NEXT:    [[POSTADR:%.*]] = getelementptr i8, i8* [[BASE]], i64 [[INDVARS_IV_NEXT]]
-; CHECK-NEXT:    store i8 0, i8* [[POSTADR]], align 1
-; CHECK-NEXT:    [[POSTADRNSW:%.*]] = getelementptr inbounds i8, i8* [[BASE]], i64 [[INDVARS_IV_NEXT]]
-; CHECK-NEXT:    store i8 0, i8* [[POSTADRNSW]], align 1
+; CHECK-NEXT:    [[POSTADR:%.*]] = getelementptr i8, ptr [[BASE]], i64 [[INDVARS_IV_NEXT]]
+; CHECK-NEXT:    store i8 0, ptr [[POSTADR]], align 1
+; CHECK-NEXT:    [[POSTADRNSW:%.*]] = getelementptr inbounds i8, ptr [[BASE]], i64 [[INDVARS_IV_NEXT]]
+; CHECK-NEXT:    store i8 0, ptr [[POSTADRNSW]], align 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
 ; CHECK:       exit:
@@ -34,16 +34,16 @@ loop:
   %iv = phi i32 [ %postiv, %loop ], [ 0, %entry ]
   %ivnsw = phi i32 [ %postivnsw, %loop ], [ 0, %entry ]
   %preofs = sext i32 %iv to i64
-  %preadr = getelementptr i8, i8* %base, i64 %preofs
-  store i8 0, i8* %preadr
+  %preadr = getelementptr i8, ptr %base, i64 %preofs
+  store i8 0, ptr %preadr
   %postiv = add i32 %iv, 1
   %postofs = sext i32 %postiv to i64
-  %postadr = getelementptr i8, i8* %base, i64 %postofs
-  store i8 0, i8* %postadr
+  %postadr = getelementptr i8, ptr %base, i64 %postofs
+  store i8 0, ptr %postadr
   %postivnsw = add nsw i32 %ivnsw, 1
   %postofsnsw = sext i32 %postivnsw to i64
-  %postadrnsw = getelementptr inbounds i8, i8* %base, i64 %postofsnsw
-  store i8 0, i8* %postadrnsw
+  %postadrnsw = getelementptr inbounds i8, ptr %base, i64 %postofsnsw
+  store i8 0, ptr %postadrnsw
   %cond = icmp sgt i32 %limit, %iv
   br i1 %cond, label %loop, label %exit
 exit:
@@ -55,7 +55,7 @@ return:
 ; IV with nonconstant start, preinc and postinc sign extends,
 ; with and without NSW.
 ; As with postincConstIV, WidenIVs removes all three sexts.
-define void @postincVarIV(i8* %base, i32 %init, i32 %limit) nounwind {
+define void @postincVarIV(ptr %base, i32 %init, i32 %limit) nounwind {
 ; CHECK-LABEL: @postincVarIV(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[PRECOND:%.*]] = icmp sgt i32 [[LIMIT:%.*]], [[INIT:%.*]]
@@ -66,13 +66,13 @@ define void @postincVarIV(i8* %base, i32 %init, i32 %limit) nounwind {
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[TMP0]], [[LOOP_PREHEADER]] ], [ [[INDVARS_IV_NEXT:%.*]], [[LOOP]] ]
-; CHECK-NEXT:    [[PREADR:%.*]] = getelementptr i8, i8* [[BASE:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    store i8 0, i8* [[PREADR]], align 1
+; CHECK-NEXT:    [[PREADR:%.*]] = getelementptr i8, ptr [[BASE:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    store i8 0, ptr [[PREADR]], align 1
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], 1
-; CHECK-NEXT:    [[POSTADR:%.*]] = getelementptr i8, i8* [[BASE]], i64 [[INDVARS_IV_NEXT]]
-; CHECK-NEXT:    store i8 0, i8* [[POSTADR]], align 1
-; CHECK-NEXT:    [[POSTADRNSW:%.*]] = getelementptr i8, i8* [[BASE]], i64 [[INDVARS_IV_NEXT]]
-; CHECK-NEXT:    store i8 0, i8* [[POSTADRNSW]], align 1
+; CHECK-NEXT:    [[POSTADR:%.*]] = getelementptr i8, ptr [[BASE]], i64 [[INDVARS_IV_NEXT]]
+; CHECK-NEXT:    store i8 0, ptr [[POSTADR]], align 1
+; CHECK-NEXT:    [[POSTADRNSW:%.*]] = getelementptr i8, ptr [[BASE]], i64 [[INDVARS_IV_NEXT]]
+; CHECK-NEXT:    store i8 0, ptr [[POSTADRNSW]], align 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
 ; CHECK:       exit:
@@ -87,16 +87,16 @@ loop:
   %iv = phi i32 [ %postiv, %loop ], [ %init, %entry ]
   %ivnsw = phi i32 [ %postivnsw, %loop ], [ %init, %entry ]
   %preofs = sext i32 %iv to i64
-  %preadr = getelementptr i8, i8* %base, i64 %preofs
-  store i8 0, i8* %preadr
+  %preadr = getelementptr i8, ptr %base, i64 %preofs
+  store i8 0, ptr %preadr
   %postiv = add i32 %iv, 1
   %postofs = sext i32 %postiv to i64
-  %postadr = getelementptr i8, i8* %base, i64 %postofs
-  store i8 0, i8* %postadr
+  %postadr = getelementptr i8, ptr %base, i64 %postofs
+  store i8 0, ptr %postadr
   %postivnsw = add nsw i32 %ivnsw, 1
   %postofsnsw = sext i32 %postivnsw to i64
-  %postadrnsw = getelementptr i8, i8* %base, i64 %postofsnsw
-  store i8 0, i8* %postadrnsw
+  %postadrnsw = getelementptr i8, ptr %base, i64 %postofsnsw
+  store i8 0, ptr %postadrnsw
   %cond = icmp sgt i32 %limit, %postiv
   br i1 %cond, label %loop, label %exit
 exit:
@@ -110,7 +110,7 @@ return:
 ; %innercount is currently blocked by lcssa, so is not widened.
 ; %inneriv can be widened only after proving it has no signed-overflow
 ;   based on the loop test.
-define void @nestedIV(i8* %address, i32 %limit) nounwind {
+define void @nestedIV(ptr %address, i32 %limit) nounwind {
 ; CHECK-LABEL: @nestedIV(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[LIMITDEC:%.*]] = add i32 [[LIMIT:%.*]], -1
@@ -121,8 +121,8 @@ define void @nestedIV(i8* %address, i32 %limit) nounwind {
 ; CHECK-NEXT:    [[INDVARS_IV1:%.*]] = phi i64 [ [[INDVARS_IV_NEXT2:%.*]], [[OUTERMERGE:%.*]] ], [ 0, [[ENTRY:%.*]] ]
 ; CHECK-NEXT:    [[INNERCOUNT:%.*]] = phi i32 [ [[INNERCOUNT_MERGE:%.*]], [[OUTERMERGE]] ], [ 0, [[ENTRY]] ]
 ; CHECK-NEXT:    [[TMP0:%.*]] = add nsw i64 [[INDVARS_IV1]], -1
-; CHECK-NEXT:    [[ADR1:%.*]] = getelementptr i8, i8* [[ADDRESS:%.*]], i64 [[TMP0]]
-; CHECK-NEXT:    store i8 0, i8* [[ADR1]], align 1
+; CHECK-NEXT:    [[ADR1:%.*]] = getelementptr i8, ptr [[ADDRESS:%.*]], i64 [[TMP0]]
+; CHECK-NEXT:    store i8 0, ptr [[ADR1]], align 1
 ; CHECK-NEXT:    br label [[INNERPREHEADER:%.*]]
 ; CHECK:       innerpreheader:
 ; CHECK-NEXT:    [[INNERPRECMP:%.*]] = icmp sgt i32 [[LIMITDEC]], [[INNERCOUNT]]
@@ -134,10 +134,10 @@ define void @nestedIV(i8* %address, i32 %limit) nounwind {
 ; CHECK:       innerloop:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[TMP1]], [[INNERLOOP_PREHEADER]] ], [ [[INDVARS_IV_NEXT:%.*]], [[INNERLOOP]] ]
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], 1
-; CHECK-NEXT:    [[ADR2:%.*]] = getelementptr i8, i8* [[ADDRESS]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    store i8 0, i8* [[ADR2]], align 1
-; CHECK-NEXT:    [[ADR3:%.*]] = getelementptr i8, i8* [[ADDRESS]], i64 [[INDVARS_IV_NEXT]]
-; CHECK-NEXT:    store i8 0, i8* [[ADR3]], align 1
+; CHECK-NEXT:    [[ADR2:%.*]] = getelementptr i8, ptr [[ADDRESS]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    store i8 0, ptr [[ADR2]], align 1
+; CHECK-NEXT:    [[ADR3:%.*]] = getelementptr i8, ptr [[ADDRESS]], i64 [[INDVARS_IV_NEXT]]
+; CHECK-NEXT:    store i8 0, ptr [[ADR3]], align 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[INNERLOOP]], label [[INNEREXIT:%.*]]
 ; CHECK:       innerexit:
@@ -146,11 +146,11 @@ define void @nestedIV(i8* %address, i32 %limit) nounwind {
 ; CHECK-NEXT:    br label [[OUTERMERGE]]
 ; CHECK:       outermerge:
 ; CHECK-NEXT:    [[INNERCOUNT_MERGE]] = phi i32 [ [[TMP2]], [[INNEREXIT]] ], [ [[INNERCOUNT]], [[INNERPREHEADER]] ]
-; CHECK-NEXT:    [[ADR4:%.*]] = getelementptr i8, i8* [[ADDRESS]], i64 [[INDVARS_IV1]]
-; CHECK-NEXT:    store i8 0, i8* [[ADR4]], align 1
+; CHECK-NEXT:    [[ADR4:%.*]] = getelementptr i8, ptr [[ADDRESS]], i64 [[INDVARS_IV1]]
+; CHECK-NEXT:    store i8 0, ptr [[ADR4]], align 1
 ; CHECK-NEXT:    [[OFS5:%.*]] = sext i32 [[INNERCOUNT_MERGE]] to i64
-; CHECK-NEXT:    [[ADR5:%.*]] = getelementptr i8, i8* [[ADDRESS]], i64 [[OFS5]]
-; CHECK-NEXT:    store i8 0, i8* [[ADR5]], align 1
+; CHECK-NEXT:    [[ADR5:%.*]] = getelementptr i8, ptr [[ADDRESS]], i64 [[OFS5]]
+; CHECK-NEXT:    store i8 0, ptr [[ADR5]], align 1
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT2]] = add nuw nsw i64 [[INDVARS_IV1]], 1
 ; CHECK-NEXT:    [[EXITCOND5:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT2]], [[WIDE_TRIP_COUNT4]]
 ; CHECK-NEXT:    br i1 [[EXITCOND5]], label [[OUTERLOOP]], label [[RETURN:%.*]]
@@ -169,8 +169,8 @@ outerloop:
 
   %outercountdec = add i32 %outercount, -1
   %ofs1 = sext i32 %outercountdec to i64
-  %adr1 = getelementptr i8, i8* %address, i64 %ofs1
-  store i8 0, i8* %adr1
+  %adr1 = getelementptr i8, ptr %address, i64 %ofs1
+  store i8 0, ptr %adr1
 
   br label %innerpreheader
 
@@ -188,12 +188,12 @@ innerloop:
   %innerpostiv = add i32 %inneriv, 1
 
   %ofs2 = sext i32 %inneriv to i64
-  %adr2 = getelementptr i8, i8* %address, i64 %ofs2
-  store i8 0, i8* %adr2
+  %adr2 = getelementptr i8, ptr %address, i64 %ofs2
+  store i8 0, ptr %adr2
 
   %ofs3 = sext i32 %innerpostiv to i64
-  %adr3 = getelementptr i8, i8* %address, i64 %ofs3
-  store i8 0, i8* %adr3
+  %adr3 = getelementptr i8, ptr %address, i64 %ofs3
+  store i8 0, ptr %adr3
 
   %innercmp = icmp sgt i32 %limitdec, %innerpostiv
   br i1 %innercmp, label %innerloop, label %innerexit
@@ -208,12 +208,12 @@ outermerge:
   %innercount.merge = phi i32 [ %innercount.lcssa, %innerexit ], [ %innercount, %innerpreheader ]
 
   %ofs4 = sext i32 %outercount to i64
-  %adr4 = getelementptr i8, i8* %address, i64 %ofs4
-  store i8 0, i8* %adr4
+  %adr4 = getelementptr i8, ptr %address, i64 %ofs4
+  store i8 0, ptr %adr4
 
   %ofs5 = sext i32 %innercount.merge to i64
-  %adr5 = getelementptr i8, i8* %address, i64 %ofs5
-  store i8 0, i8* %adr5
+  %adr5 = getelementptr i8, ptr %address, i64 %ofs5
+  store i8 0, ptr %adr5
 
   %outerpostcount = add i32 %outercount, 1
   %tmp47 = icmp slt i32 %outerpostcount, %limit

diff  --git a/llvm/test/Transforms/IndVarSimplify/eliminate-backedge.ll b/llvm/test/Transforms/IndVarSimplify/eliminate-backedge.ll
index d3fe3b8ad4951..5e3f1bdb001fa 100644
--- a/llvm/test/Transforms/IndVarSimplify/eliminate-backedge.ll
+++ b/llvm/test/Transforms/IndVarSimplify/eliminate-backedge.ll
@@ -2,11 +2,11 @@
 ; RUN: opt < %s -passes=indvars -S | FileCheck %s
 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-n8:16:32:64"
 
-declare i1 @foo(i8*, i8*)
+declare i1 @foo(ptr, ptr)
 declare i1 @bar()
 declare i1 @baz()
 
-define i1 @kill_backedge_and_phis(i8* align 1 %lhs, i8* align 1 %rhs, i32 %len) {
+define i1 @kill_backedge_and_phis(ptr align 1 %lhs, ptr align 1 %rhs, i32 %len) {
 ; CHECK-LABEL: @kill_backedge_and_phis(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    %length_not_zero = icmp ne i32 %len, 0
@@ -14,7 +14,7 @@ define i1 @kill_backedge_and_phis(i8* align 1 %lhs, i8* align 1 %rhs, i32 %len)
 ; CHECK:       loop_preheader:
 ; CHECK-NEXT:    br label %loop
 ; CHECK:       loop:
-; CHECK-NEXT:    %result = call i1 @foo(i8* %lhs, i8* %rhs)
+; CHECK-NEXT:    %result = call i1 @foo(ptr %lhs, ptr %rhs)
 ; CHECK-NEXT:    br i1 %result, label %exiting_1, label %exit.loopexit
 ; CHECK:       exiting_1:
 ; CHECK-NEXT:    br i1 false, label %exiting_2, label %exit.loopexit
@@ -45,9 +45,9 @@ loop:
   %iv.wide = phi i64 [ 0, %loop_preheader ], [ %iv.wide.next, %latch ]
   %iv.next = add i32 %iv, 1
   %iv.wide.next = add i64 %iv.wide, 1
-  %left_ptr = getelementptr inbounds i8, i8* %lhs, i32 %iv
-  %right_ptr = getelementptr inbounds i8, i8* %rhs, i32 %iv
-  %result = call i1 @foo(i8* %left_ptr, i8* %right_ptr)
+  %left_ptr = getelementptr inbounds i8, ptr %lhs, i32 %iv
+  %right_ptr = getelementptr inbounds i8, ptr %rhs, i32 %iv
+  %result = call i1 @foo(ptr %left_ptr, ptr %right_ptr)
   br i1 %result, label %exiting_1, label %exit
 
 exiting_1:
@@ -73,7 +73,7 @@ exit:
   ret i1 %val
 }
 
-define i1 @siblings(i8* align 1 %lhs, i8* align 1 %rhs, i32 %len) {
+define i1 @siblings(ptr align 1 %lhs, ptr align 1 %rhs, i32 %len) {
 ; CHECK-LABEL: @siblings(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    %length_not_zero = icmp ne i32 %len, 0
@@ -90,9 +90,9 @@ define i1 @siblings(i8* align 1 %lhs, i8* align 1 %rhs, i32 %len) {
 ; CHECK-NEXT:    br label %loop
 ; CHECK:       loop:
 ; CHECK-NEXT:    %iv.next = add i32 %weird.iv.lcssa, 1
-; CHECK-NEXT:    %left_ptr = getelementptr inbounds i8, i8* %lhs, i32 %weird.iv.lcssa
-; CHECK-NEXT:    %right_ptr = getelementptr inbounds i8, i8* %rhs, i32 %weird.iv.lcssa
-; CHECK-NEXT:    %result = call i1 @foo(i8* %left_ptr, i8* %right_ptr)
+; CHECK-NEXT:    %left_ptr = getelementptr inbounds i8, ptr %lhs, i32 %weird.iv.lcssa
+; CHECK-NEXT:    %right_ptr = getelementptr inbounds i8, ptr %rhs, i32 %weird.iv.lcssa
+; CHECK-NEXT:    %result = call i1 @foo(ptr %left_ptr, ptr %right_ptr)
 ; CHECK-NEXT:    br i1 %result, label %exiting_1, label %exit.loopexit
 ; CHECK:       exiting_1:
 ; CHECK-NEXT:    br i1 false, label %exiting_2, label %exit.loopexit
@@ -127,9 +127,9 @@ loop:
   %iv.wide = phi i64 [ %weird.iv.wide, %weird_loop ], [ %iv.wide.next, %latch ]
   %iv.next = add i32 %iv, 1
   %iv.wide.next = add i64 %iv.wide, 1
-  %left_ptr = getelementptr inbounds i8, i8* %lhs, i32 %iv
-  %right_ptr = getelementptr inbounds i8, i8* %rhs, i32 %iv
-  %result = call i1 @foo(i8* %left_ptr, i8* %right_ptr)
+  %left_ptr = getelementptr inbounds i8, ptr %lhs, i32 %iv
+  %right_ptr = getelementptr inbounds i8, ptr %rhs, i32 %iv
+  %result = call i1 @foo(ptr %left_ptr, ptr %right_ptr)
   br i1 %result, label %exiting_1, label %exit
 
 exiting_1:

diff  --git a/llvm/test/Transforms/IndVarSimplify/eliminate-exit-no-dl.ll b/llvm/test/Transforms/IndVarSimplify/eliminate-exit-no-dl.ll
index c96048eb27cc6..e605512cb23bf 100644
--- a/llvm/test/Transforms/IndVarSimplify/eliminate-exit-no-dl.ll
+++ b/llvm/test/Transforms/IndVarSimplify/eliminate-exit-no-dl.ll
@@ -14,7 +14,7 @@ define void @foo() {
 ; CHECK-NEXT:  bb:
 ; CHECK-NEXT:    br label [[BB3:%.*]]
 ; CHECK:       bb3:
-; CHECK-NEXT:    [[TMP6:%.*]] = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @global, i64 0, i64 1), align 1
+; CHECK-NEXT:    [[TMP6:%.*]] = load i8, ptr getelementptr inbounds ([0 x i8], ptr @global, i64 0, i64 1), align 1
 ; CHECK-NEXT:    br i1 false, label [[BB7:%.*]], label [[BB11:%.*]]
 ; CHECK:       bb7:
 ; CHECK-NEXT:    [[TMP8:%.*]] = zext i8 [[TMP6]] to i64
@@ -26,10 +26,10 @@ bb:
   br label %bb3
 
 bb3:                                              ; preds = %bb7, %bb2
-  %tmp = phi i8* [ %tmp4, %bb7 ], [ getelementptr inbounds ([0 x i8], [0 x i8]* @global, i64 0, i64 2), %bb ]
-  %tmp4 = getelementptr inbounds i8, i8* %tmp, i64 -1
-  %tmp6 = load i8, i8* %tmp4, align 1
-  %tmp5 = icmp ugt i8* %tmp4, getelementptr inbounds ([0 x i8], [0 x i8]* @global, i64 0, i64 500)
+  %tmp = phi ptr [ %tmp4, %bb7 ], [ getelementptr inbounds ([0 x i8], ptr @global, i64 0, i64 2), %bb ]
+  %tmp4 = getelementptr inbounds i8, ptr %tmp, i64 -1
+  %tmp6 = load i8, ptr %tmp4, align 1
+  %tmp5 = icmp ugt ptr %tmp4, getelementptr inbounds ([0 x i8], ptr @global, i64 0, i64 500)
   br i1 %tmp5, label %bb7, label %bb11
 
 bb7:                                              ; preds = %bb3

diff  --git a/llvm/test/Transforms/IndVarSimplify/eliminate-max.ll b/llvm/test/Transforms/IndVarSimplify/eliminate-max.ll
index 540eb255584ff..9eec980cc480d 100644
--- a/llvm/test/Transforms/IndVarSimplify/eliminate-max.ll
+++ b/llvm/test/Transforms/IndVarSimplify/eliminate-max.ll
@@ -7,7 +7,7 @@
 ; cannot eliminate, because it requires analyzing more than just the
 ; range of the induction variable.
 
- at 0 = private constant [4 x i8] c"%d\0A\00", align 1 ; <[4 x i8]*> [#uses=1]
+ at 0 = private constant [4 x i8] c"%d\0A\00", align 1 ; <ptr> [#uses=1]
 
 define i32 @main() nounwind {
 ; CHECK-LABEL: @main(
@@ -50,8 +50,8 @@ bb14:                                             ; preds = %bb11, %bb7
   br i1 %t20, label %bb1, label %bb21
 
 bb21:                                             ; preds = %bb14
-  %t22 = call i32 (i8*, ...) @printf(i8* noalias getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0), i32 %t18) nounwind
+  %t22 = call i32 (ptr, ...) @printf(ptr noalias @0, i32 %t18) nounwind
   ret i32 0
 }
 
-declare i32 @printf(i8* noalias nocapture, ...) nounwind
+declare i32 @printf(ptr noalias nocapture, ...) nounwind

diff  --git a/llvm/test/Transforms/IndVarSimplify/eliminate-rem.ll b/llvm/test/Transforms/IndVarSimplify/eliminate-rem.ll
index 7508d0cf41002..160efd8368262 100644
--- a/llvm/test/Transforms/IndVarSimplify/eliminate-rem.ll
+++ b/llvm/test/Transforms/IndVarSimplify/eliminate-rem.ll
@@ -7,7 +7,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 ; CHECK-NOT: rem
 ; CHECK: ret
 
-define void @simple(i64 %arg, double* %arg3) nounwind {
+define void @simple(i64 %arg, ptr %arg3) nounwind {
 bb:
   %t = icmp slt i64 0, %arg                     ; <i1> [#uses=1]
   br i1 %t, label %bb4, label %bb12
@@ -18,8 +18,8 @@ bb4:                                              ; preds = %bb
 bb5:                                              ; preds = %bb4, %bb5
   %t6 = phi i64 [ %t9, %bb5 ], [ 0, %bb4 ]    ; <i64> [#uses=2]
   %t7 = srem i64 %t6, %arg                    ; <i64> [#uses=1]
-  %t8 = getelementptr inbounds double, double* %arg3, i64 %t7 ; <double*> [#uses=1]
-  store double 0.000000e+00, double* %t8
+  %t8 = getelementptr inbounds double, ptr %arg3, i64 %t7 ; <ptr> [#uses=1]
+  store double 0.000000e+00, ptr %t8
   %t9 = add nsw i64 %t6, 1                    ; <i64> [#uses=2]
   %t10 = icmp slt i64 %t9, %arg               ; <i1> [#uses=1]
   br i1 %t10, label %bb5, label %bb11
@@ -38,7 +38,7 @@ bb12:                                             ; preds = %bb11, %bb
 ; CHECK-NOT: {{[us]}}rem
 ; CHECK: ret
 
-define i32 @f(i64* %arg, i64 %arg1, i64 %arg2, i64 %arg3) nounwind {
+define i32 @f(ptr %arg, i64 %arg1, i64 %arg2, i64 %arg3) nounwind {
 bb:
   %t = icmp sgt i64 %arg1, 0                      ; <i1> [#uses=1]
   br i1 %t, label %bb4, label %bb54
@@ -78,16 +78,16 @@ bb21:                                             ; preds = %bb21, %bb20
   %t26 = add nsw i64 %t24, %t22                   ; <i64> [#uses=1]
   %t27 = mul i64 %t11, %arg1                      ; <i64> [#uses=1]
   %t28 = add nsw i64 %t25, %t22                   ; <i64> [#uses=1]
-  %t29 = getelementptr inbounds i64, i64* %arg, i64 %t26 ; <i64*> [#uses=1]
+  %t29 = getelementptr inbounds i64, ptr %arg, i64 %t26 ; <ptr> [#uses=1]
   %t30 = add nsw i64 %t27, %t22                   ; <i64> [#uses=1]
-  %t31 = getelementptr inbounds i64, i64* %arg, i64 %t28 ; <i64*> [#uses=1]
+  %t31 = getelementptr inbounds i64, ptr %arg, i64 %t28 ; <ptr> [#uses=1]
   %t32 = zext i32 %t23 to i64                     ; <i64> [#uses=1]
-  %t33 = load i64, i64* %t29                           ; <i64> [#uses=1]
-  %t34 = getelementptr inbounds i64, i64* %arg, i64 %t30 ; <i64*> [#uses=1]
-  %t35 = load i64, i64* %t31                           ; <i64> [#uses=1]
+  %t33 = load i64, ptr %t29                           ; <i64> [#uses=1]
+  %t34 = getelementptr inbounds i64, ptr %arg, i64 %t30 ; <ptr> [#uses=1]
+  %t35 = load i64, ptr %t31                           ; <i64> [#uses=1]
   %t36 = add nsw i64 %t32, %t33                   ; <i64> [#uses=1]
   %t37 = add nsw i64 %t36, %t35                   ; <i64> [#uses=1]
-  %t38 = load i64, i64* %t34                           ; <i64> [#uses=1]
+  %t38 = load i64, ptr %t34                           ; <i64> [#uses=1]
   %t39 = add nsw i64 %t37, %t38                   ; <i64> [#uses=1]
   %t40 = trunc i64 %t39 to i32                    ; <i32> [#uses=2]
   %t41 = add nsw i64 %t22, 1                      ; <i64> [#uses=2]

diff  --git a/llvm/test/Transforms/IndVarSimplify/eliminate-sat.ll b/llvm/test/Transforms/IndVarSimplify/eliminate-sat.ll
index a124cf7531edc..9fcfc7c9b349a 100644
--- a/llvm/test/Transforms/IndVarSimplify/eliminate-sat.ll
+++ b/llvm/test/Transforms/IndVarSimplify/eliminate-sat.ll
@@ -6,14 +6,14 @@ declare i32 @llvm.sadd.sat.i32(i32, i32)
 declare i32 @llvm.usub.sat.i32(i32, i32)
 declare i32 @llvm.ssub.sat.i32(i32, i32)
 
-define void @uadd_sat(i32* %p) {
+define void @uadd_sat(ptr %p) {
 ; CHECK-LABEL: @uadd_sat(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[SAT1:%.*]] = add nuw nsw i32 [[I]], 1
-; CHECK-NEXT:    store volatile i32 [[SAT1]], i32* [[P:%.*]]
+; CHECK-NEXT:    store volatile i32 [[SAT1]], ptr [[P:%.*]]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i32 [[I]], 1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ne i32 [[I_INC]], 100
 ; CHECK-NEXT:    br i1 [[CMP]], label [[LOOP]], label [[END:%.*]]
@@ -26,7 +26,7 @@ entry:
 loop:
   %i = phi i32 [ 0, %entry ], [ %i.inc, %loop ]
   %sat = call i32 @llvm.uadd.sat.i32(i32 %i, i32 1)
-  store volatile i32 %sat, i32* %p
+  store volatile i32 %sat, ptr %p
   %i.inc = add nuw nsw i32 %i, 1
   %cmp = icmp ne i32 %i.inc, 100
   br i1 %cmp, label %loop, label %end
@@ -35,14 +35,14 @@ end:
   ret void
 }
 
-define void @sadd_sat(i32* %p) {
+define void @sadd_sat(ptr %p) {
 ; CHECK-LABEL: @sadd_sat(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[SAT1:%.*]] = add nuw nsw i32 [[I]], 1
-; CHECK-NEXT:    store volatile i32 [[SAT1]], i32* [[P:%.*]]
+; CHECK-NEXT:    store volatile i32 [[SAT1]], ptr [[P:%.*]]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i32 [[I]], 1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ne i32 [[I_INC]], 100
 ; CHECK-NEXT:    br i1 [[CMP]], label [[LOOP]], label [[END:%.*]]
@@ -55,7 +55,7 @@ entry:
 loop:
   %i = phi i32 [ 0, %entry ], [ %i.inc, %loop ]
   %sat = call i32 @llvm.sadd.sat.i32(i32 %i, i32 1)
-  store volatile i32 %sat, i32* %p
+  store volatile i32 %sat, ptr %p
   %i.inc = add nuw nsw i32 %i, 1
   %cmp = icmp ne i32 %i.inc, 100
   br i1 %cmp, label %loop, label %end
@@ -64,14 +64,14 @@ end:
   ret void
 }
 
-define void @usub_sat(i32* %p) {
+define void @usub_sat(ptr %p) {
 ; CHECK-LABEL: @usub_sat(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 1, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[SAT1:%.*]] = sub nuw nsw i32 [[I]], 1
-; CHECK-NEXT:    store volatile i32 [[SAT1]], i32* [[P:%.*]]
+; CHECK-NEXT:    store volatile i32 [[SAT1]], ptr [[P:%.*]]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i32 [[I]], 1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ne i32 [[I_INC]], 100
 ; CHECK-NEXT:    br i1 [[CMP]], label [[LOOP]], label [[END:%.*]]
@@ -84,7 +84,7 @@ entry:
 loop:
   %i = phi i32 [ 1, %entry ], [ %i.inc, %loop ]
   %sat = call i32 @llvm.usub.sat.i32(i32 %i, i32 1)
-  store volatile i32 %sat, i32* %p
+  store volatile i32 %sat, ptr %p
   %i.inc = add nuw nsw i32 %i, 1
   %cmp = icmp ne i32 %i.inc, 100
   br i1 %cmp, label %loop, label %end
@@ -93,14 +93,14 @@ end:
   ret void
 }
 
-define void @ssub_sat(i32* %p) {
+define void @ssub_sat(ptr %p) {
 ; CHECK-LABEL: @ssub_sat(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[SAT1:%.*]] = sub nsw i32 [[I]], 1
-; CHECK-NEXT:    store volatile i32 [[SAT1]], i32* [[P:%.*]]
+; CHECK-NEXT:    store volatile i32 [[SAT1]], ptr [[P:%.*]]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i32 [[I]], 1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ne i32 [[I_INC]], 100
 ; CHECK-NEXT:    br i1 [[CMP]], label [[LOOP]], label [[END:%.*]]
@@ -113,7 +113,7 @@ entry:
 loop:
   %i = phi i32 [ 0, %entry ], [ %i.inc, %loop ]
   %sat = call i32 @llvm.ssub.sat.i32(i32 %i, i32 1)
-  store volatile i32 %sat, i32* %p
+  store volatile i32 %sat, ptr %p
   %i.inc = add nuw nsw i32 %i, 1
   %cmp = icmp ne i32 %i.inc, 100
   br i1 %cmp, label %loop, label %end

diff  --git a/llvm/test/Transforms/IndVarSimplify/exit_value_test3.ll b/llvm/test/Transforms/IndVarSimplify/exit_value_test3.ll
index b3c2ebd85d6a0..aba7532f5ed92 100644
--- a/llvm/test/Transforms/IndVarSimplify/exit_value_test3.ll
+++ b/llvm/test/Transforms/IndVarSimplify/exit_value_test3.ll
@@ -8,7 +8,7 @@
 ; CHECK: [[LABEL:^[a-zA-Z0-9_.]+]]:
 ; CHECK-NOT: br {{.*}} [[LABEL]]
 
-define i32 @_Z3fooPKcjj(i8* nocapture readnone %s, i32 %len, i32 %c) #0 {
+define i32 @_Z3fooPKcjj(ptr nocapture readnone %s, i32 %len, i32 %c) #0 {
 entry:
   br label %while.cond
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/finite-exit-comparisons.ll b/llvm/test/Transforms/IndVarSimplify/finite-exit-comparisons.ll
index a3aa80f18a495..038129e9a7cf2 100644
--- a/llvm/test/Transforms/IndVarSimplify/finite-exit-comparisons.ll
+++ b/llvm/test/Transforms/IndVarSimplify/finite-exit-comparisons.ll
@@ -220,7 +220,7 @@ define void @slt_neg_well_defined_infinite(i16 %n) mustprogress {
 ; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i8 [ [[IV_NEXT:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ]
-; CHECK-NEXT:    store volatile i8 [[IV]], i8* @G, align 1
+; CHECK-NEXT:    store volatile i8 [[IV]], ptr @G, align 1
 ; CHECK-NEXT:    [[IV_NEXT]] = add i8 [[IV]], 1
 ; CHECK-NEXT:    [[ZEXT:%.*]] = zext i8 [[IV_NEXT]] to i16
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i16 [[ZEXT]], [[N:%.*]]
@@ -233,7 +233,7 @@ entry:
 
 for.body:                                         ; preds = %entry, %for.body
   %iv = phi i8 [ %iv.next, %for.body ], [ 0, %entry ]
-  store volatile i8 %iv, i8* @G
+  store volatile i8 %iv, ptr @G
   %iv.next = add i8 %iv, 1
   %zext = zext i8 %iv.next to i16
   %cmp = icmp slt i16 %zext, %n

diff  --git a/llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll b/llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll
index a5b472ed72adf..599e69c814d9b 100644
--- a/llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll
+++ b/llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll
@@ -10,8 +10,8 @@ define void @sitofp_fptosi_range() {
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[IV_INT:%.*]] = phi i32 [ 100, [[ENTRY:%.*]] ], [ [[DEC_INT:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[IDXPROM:%.*]] = sext i32 [[IV_INT]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[IDXPROM]]
-; CHECK-NEXT:    store i32 [[IV_INT]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[IDXPROM]]
+; CHECK-NEXT:    store i32 [[IV_INT]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[DEC_INT]] = add nsw i32 [[IV_INT]], -1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i32 [[DEC_INT]], 0
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
@@ -26,8 +26,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = sitofp i32 %iv.int to float
   %conv = fptosi float %indvar.conv to i32
   %idxprom = sext i32 %conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom
-  store i32 %conv, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom
+  store i32 %conv, ptr %arrayidx, align 4
   %dec.int = add nsw i32 %iv.int, -1
   %cmp = icmp ugt i32 %dec.int, 0
   br i1 %cmp, label %for.body, label %cleanup
@@ -46,8 +46,8 @@ define void @sitofp_fptosi_range_overflow() {
 ; CHECK-NEXT:    [[INDVAR_CONV:%.*]] = sitofp i32 [[IV_INT]] to float
 ; CHECK-NEXT:    [[CONV:%.*]] = fptosi float [[INDVAR_CONV]] to i32
 ; CHECK-NEXT:    [[IDXPROM:%.*]] = sext i32 [[CONV]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[IDXPROM]]
-; CHECK-NEXT:    store i32 [[CONV]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[IDXPROM]]
+; CHECK-NEXT:    store i32 [[CONV]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[DEC_INT]] = add nsw i32 [[IV_INT]], -1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i32 [[DEC_INT]], 0
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
@@ -62,8 +62,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = sitofp i32 %iv.int to float
   %conv = fptosi float %indvar.conv to i32
   %idxprom = sext i32 %conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom
-  store i32 %conv, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom
+  store i32 %conv, ptr %arrayidx, align 4
   %dec.int = add nsw i32 %iv.int, -1
   %cmp = icmp ugt i32 %dec.int, 0
   br i1 %cmp, label %for.body, label %cleanup
@@ -81,8 +81,8 @@ define void @sitofp_fptosi_range_trunc() {
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[IV_INT:%.*]] = phi i64 [ 100, [[ENTRY:%.*]] ], [ [[DEC_INT:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[IV_INT_TRUNC:%.*]] = trunc i64 [[IV_INT]] to i32
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[IV_INT]]
-; CHECK-NEXT:    store i32 [[IV_INT_TRUNC]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[IV_INT]]
+; CHECK-NEXT:    store i32 [[IV_INT_TRUNC]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[DEC_INT]] = add nsw i64 [[IV_INT]], -1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i64 [[DEC_INT]], 0
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
@@ -97,8 +97,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = sitofp i64 %iv.int to float
   %idxprom32 = fptosi float %indvar.conv to i32
   %idxprom64 = fptosi float %indvar.conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom64
-  store i32 %idxprom32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom64
+  store i32 %idxprom32, ptr %arrayidx, align 4
   %dec.int = add nsw i64 %iv.int, -1
   %cmp = icmp ugt i64 %dec.int, 0
   br i1 %cmp, label %for.body, label %cleanup
@@ -116,8 +116,8 @@ define void @sitofp_fptosi_range_sext() {
 ; CHECK-NEXT:    [[IV_INT:%.*]] = phi i16 [ 100, [[ENTRY:%.*]] ], [ [[DEC_INT:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[IV_INT_SEXT1:%.*]] = sext i16 [[IV_INT]] to i32
 ; CHECK-NEXT:    [[IV_INT_SEXT:%.*]] = sext i16 [[IV_INT]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[IV_INT_SEXT]]
-; CHECK-NEXT:    store i32 [[IV_INT_SEXT1]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[IV_INT_SEXT]]
+; CHECK-NEXT:    store i32 [[IV_INT_SEXT1]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[DEC_INT]] = add nsw i16 [[IV_INT]], -1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt i16 [[DEC_INT]], -3
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
@@ -132,8 +132,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = sitofp i16 %iv.int to float
   %idxprom32 = fptosi float %indvar.conv to i32
   %idxprom64 = fptosi float %indvar.conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom64
-  store i32 %idxprom32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom64
+  store i32 %idxprom32, ptr %arrayidx, align 4
   %dec.int = add nsw i16 %iv.int, -1
   %cmp = icmp sgt i16 %dec.int, -3
   br i1 %cmp, label %for.body, label %cleanup
@@ -152,8 +152,8 @@ define void @sitofp_fptoui_range_zext() {
 ; CHECK-NEXT:    [[IV_INT:%.*]] = phi i16 [ 100, [[ENTRY:%.*]] ], [ [[DEC_INT:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[IV_INT_ZEXT1:%.*]] = zext i16 [[IV_INT]] to i32
 ; CHECK-NEXT:    [[IV_INT_ZEXT:%.*]] = zext i16 [[IV_INT]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[IV_INT_ZEXT]]
-; CHECK-NEXT:    store i32 [[IV_INT_ZEXT1]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[IV_INT_ZEXT]]
+; CHECK-NEXT:    store i32 [[IV_INT_ZEXT1]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[DEC_INT]] = add nsw i16 [[IV_INT]], -1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i16 [[DEC_INT]], 0
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
@@ -168,8 +168,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = sitofp i16 %iv.int to float
   %idxprom32 = fptoui float %indvar.conv to i32
   %idxprom64 = fptoui float %indvar.conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom64
-  store i32 %idxprom32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom64
+  store i32 %idxprom32, ptr %arrayidx, align 4
   %dec.int = add nsw i16 %iv.int, -1
   %cmp = icmp ugt i16 %dec.int, 0
   br i1 %cmp, label %for.body, label %cleanup
@@ -189,8 +189,8 @@ define void @sitofp_fptoui_range_zext_postinc() {
 ; CHECK-NEXT:    [[INC_INT]] = add nuw nsw i16 [[IV_INT]], 2
 ; CHECK-NEXT:    [[INC_INT_ZEXT1:%.*]] = zext i16 [[INC_INT]] to i32
 ; CHECK-NEXT:    [[INC_INT_ZEXT:%.*]] = zext i16 [[INC_INT]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[INC_INT_ZEXT]]
-; CHECK-NEXT:    store i32 [[INC_INT_ZEXT1]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[INC_INT_ZEXT]]
+; CHECK-NEXT:    store i32 [[INC_INT_ZEXT1]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ult i16 [[INC_INT]], 200
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
 ; CHECK:       cleanup:
@@ -205,8 +205,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = sitofp i16 %inc.int to float     ; The 'postinc IV' %inc.int passes to sitofp
   %idxprom32 = fptoui float %indvar.conv to i32
   %idxprom64 = fptoui float %indvar.conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom64
-  store i32 %idxprom32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom64
+  store i32 %idxprom32, ptr %arrayidx, align 4
   %cmp = icmp ult i16 %inc.int, 200
   br i1 %cmp, label %for.body, label %cleanup
 
@@ -224,8 +224,8 @@ define void @uitofp_fptosi_range_zext() {
 ; CHECK-NEXT:    [[IV_INT:%.*]] = phi i16 [ 100, [[ENTRY:%.*]] ], [ [[INC_INT:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[IV_INT_ZEXT1:%.*]] = zext i16 [[IV_INT]] to i32
 ; CHECK-NEXT:    [[IV_INT_ZEXT:%.*]] = zext i16 [[IV_INT]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[IV_INT_ZEXT]]
-; CHECK-NEXT:    store i32 [[IV_INT_ZEXT1]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[IV_INT_ZEXT]]
+; CHECK-NEXT:    store i32 [[IV_INT_ZEXT1]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[INC_INT]] = add nuw nsw i16 [[IV_INT]], 2
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ult i16 [[INC_INT]], 200
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
@@ -240,8 +240,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = uitofp i16 %iv.int to float
   %idxprom32 = fptosi float %indvar.conv to i32
   %idxprom64 = fptosi float %indvar.conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom64
-  store i32 %idxprom32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom64
+  store i32 %idxprom32, ptr %arrayidx, align 4
   %inc.int = add nsw i16 %iv.int, 2
   %cmp = icmp ult i16 %inc.int, 200
   br i1 %cmp, label %for.body, label %cleanup
@@ -258,8 +258,8 @@ define void @sitofp_fptoui_range() {
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[IV_INT:%.*]] = phi i32 [ 100, [[ENTRY:%.*]] ], [ [[DEC_INT:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[IDXPROM:%.*]] = zext i32 [[IV_INT]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[IDXPROM]]
-; CHECK-NEXT:    store i32 [[IV_INT]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[IDXPROM]]
+; CHECK-NEXT:    store i32 [[IV_INT]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[DEC_INT]] = add nsw i32 [[IV_INT]], -1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i32 [[DEC_INT]], 0
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
@@ -274,8 +274,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = sitofp i32 %iv.int to float
   %conv = fptoui float %indvar.conv to i32
   %idxprom = zext i32 %conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom
-  store i32 %conv, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom
+  store i32 %conv, ptr %arrayidx, align 4
   %dec.int = add nsw i32 %iv.int, -1
   %cmp = icmp sgt i32 %dec.int, 0
   br i1 %cmp, label %for.body, label %cleanup
@@ -292,8 +292,8 @@ define void @sitofp_fptoui_range_with_negative () {
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[IV_INT:%.*]] = phi i32 [ 100, [[ENTRY:%.*]] ], [ [[DEC_INT:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[IDXPROM:%.*]] = zext i32 [[IV_INT]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[IDXPROM]]
-; CHECK-NEXT:    store i32 [[IV_INT]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[IDXPROM]]
+; CHECK-NEXT:    store i32 [[IV_INT]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[DEC_INT]] = add nsw i32 [[IV_INT]], -1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt i32 [[DEC_INT]], -100
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
@@ -308,8 +308,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = sitofp i32 %iv.int to float
   %conv = fptoui float %indvar.conv to i32
   %idxprom = zext i32 %conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom
-  store i32 %conv, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom
+  store i32 %conv, ptr %arrayidx, align 4
   %dec.int = add nsw i32 %iv.int, -1
   %cmp = icmp sgt i32 %dec.int, -100
   br i1 %cmp, label %for.body, label %cleanup
@@ -326,8 +326,8 @@ define void @uitofp_fptoui_range () {
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[IV_INT:%.*]] = phi i32 [ 100, [[ENTRY:%.*]] ], [ [[DEC_INT:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[IDXPROM:%.*]] = zext i32 [[IV_INT]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[IDXPROM]]
-; CHECK-NEXT:    store i32 [[IV_INT]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[IDXPROM]]
+; CHECK-NEXT:    store i32 [[IV_INT]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[DEC_INT]] = add nsw i32 [[IV_INT]], -1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i32 [[DEC_INT]], 3
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
@@ -342,8 +342,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = uitofp i32 %iv.int to float
   %conv = fptoui float %indvar.conv to i32
   %idxprom = zext i32 %conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom
-  store i32 %conv, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom
+  store i32 %conv, ptr %arrayidx, align 4
   %dec.int = add nsw i32 %iv.int, -1
   %cmp = icmp ugt i32 %dec.int, 3
   br i1 %cmp, label %for.body, label %cleanup
@@ -357,7 +357,7 @@ define void @uitofp_fptoui_range_with_negative() {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
 ; CHECK:       for.body:
-; CHECK-NEXT:    store i32 100, i32* getelementptr inbounds ([16777219 x i32], [16777219 x i32]* @array, i64 0, i64 100), align 4
+; CHECK-NEXT:    store i32 100, ptr getelementptr inbounds ([16777219 x i32], ptr @array, i64 0, i64 100), align 4
 ; CHECK-NEXT:    br i1 false, label [[FOR_BODY]], label [[CLEANUP:%.*]]
 ; CHECK:       cleanup:
 ; CHECK-NEXT:    ret void
@@ -370,8 +370,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = uitofp i32 %iv.int to float
   %conv = fptoui float %indvar.conv to i32
   %idxprom = zext i32 %conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom
-  store i32 %conv, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom
+  store i32 %conv, ptr %arrayidx, align 4
   %dec.int = add nsw i32 %iv.int, -1
   %cmp = icmp ugt i32 %dec.int, -100
   br i1 %cmp, label %for.body, label %cleanup
@@ -387,8 +387,8 @@ define void @uitofp_fptosi_range () {
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[IV_INT:%.*]] = phi i32 [ 100, [[ENTRY:%.*]] ], [ [[DEC_INT:%.*]], [[FOR_BODY]] ]
 ; CHECK-NEXT:    [[IDXPROM:%.*]] = sext i32 [[IV_INT]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 [[IDXPROM]]
-; CHECK-NEXT:    store i32 [[IV_INT]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 [[IDXPROM]]
+; CHECK-NEXT:    store i32 [[IV_INT]], ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[DEC_INT]] = add nsw i32 [[IV_INT]], -1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i32 [[DEC_INT]], 3
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
@@ -403,8 +403,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = uitofp i32 %iv.int to float
   %conv = fptosi float %indvar.conv to i32
   %idxprom = sext i32 %conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom
-  store i32 %conv, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom
+  store i32 %conv, ptr %arrayidx, align 4
   %dec.int = add nsw i32 %iv.int, -1
   %cmp = icmp ugt i32 %dec.int, 3
   br i1 %cmp, label %for.body, label %cleanup
@@ -418,7 +418,7 @@ define void @uitofp_fptosi_range_with_negative () {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
 ; CHECK:       for.body:
-; CHECK-NEXT:    store i32 100, i32* getelementptr inbounds ([16777219 x i32], [16777219 x i32]* @array, i64 0, i64 100), align 4
+; CHECK-NEXT:    store i32 100, ptr getelementptr inbounds ([16777219 x i32], ptr @array, i64 0, i64 100), align 4
 ; CHECK-NEXT:    br i1 false, label [[FOR_BODY]], label [[CLEANUP:%.*]]
 ; CHECK:       cleanup:
 ; CHECK-NEXT:    ret void
@@ -431,8 +431,8 @@ for.body:                                         ; preds = %for.body, %entry
   %indvar.conv = uitofp i32 %iv.int to float
   %conv = fptosi float %indvar.conv to i32
   %idxprom = sext i32 %conv to i64
-  %arrayidx = getelementptr inbounds [16777219 x i32], [16777219 x i32]* @array, i64 0, i64 %idxprom
-  store i32 %conv, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [16777219 x i32], ptr @array, i64 0, i64 %idxprom
+  store i32 %conv, ptr %arrayidx, align 4
   %dec.int = add nsw i32 %iv.int, -1
   %cmp = icmp ugt i32 %dec.int, -100
   br i1 %cmp, label %for.body, label %cleanup

diff  --git a/llvm/test/Transforms/IndVarSimplify/full_widening.ll b/llvm/test/Transforms/IndVarSimplify/full_widening.ll
index 92b9b850fb22c..93c6ff29c7433 100644
--- a/llvm/test/Transforms/IndVarSimplify/full_widening.ll
+++ b/llvm/test/Transforms/IndVarSimplify/full_widening.ll
@@ -4,7 +4,7 @@
 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-n8:16:32:64"
 
 ; Make sure that we do not insert trunc in the loop.
-define i32 @test_01(double* %p, double %x, i32* %np, i32* %mp, i32 %k) {
+define i32 @test_01(ptr %p, double %x, ptr %np, ptr %mp, i32 %k) {
 ; CHECK-LABEL: @test_01(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[SMAX:%.*]] = call i32 @llvm.smax.i32(i32 [[K:%.*]], i32 1)
@@ -13,11 +13,11 @@ define i32 @test_01(double* %p, double %x, i32* %np, i32* %mp, i32 %k) {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV_WIDE:%.*]] = phi i64 [ [[CANONICAL_IV_NEXT_I:%.*]], [[LOOP]] ], [ 0, [[ENTRY:%.*]] ]
 ; CHECK-NEXT:    [[CANONICAL_IV_NEXT_I]] = add nuw nsw i64 [[IV_WIDE]], 1
-; CHECK-NEXT:    [[GEP:%.*]] = getelementptr inbounds double, double* [[P:%.*]], i64 [[IV_WIDE]]
-; CHECK-NEXT:    [[LOAD:%.*]] = load atomic double, double* [[GEP]] unordered, align 8
+; CHECK-NEXT:    [[GEP:%.*]] = getelementptr inbounds double, ptr [[P:%.*]], i64 [[IV_WIDE]]
+; CHECK-NEXT:    [[LOAD:%.*]] = load atomic double, ptr [[GEP]] unordered, align 8
 ; CHECK-NEXT:    [[MUL:%.*]] = fmul double [[X:%.*]], [[LOAD]]
-; CHECK-NEXT:    [[GEP2:%.*]] = getelementptr inbounds double, double* [[P]], i64 [[IV_WIDE]]
-; CHECK-NEXT:    store atomic double [[MUL]], double* [[GEP2]] unordered, align 8
+; CHECK-NEXT:    [[GEP2:%.*]] = getelementptr inbounds double, ptr [[P]], i64 [[IV_WIDE]]
+; CHECK-NEXT:    store atomic double [[MUL]], ptr [[GEP2]] unordered, align 8
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[CANONICAL_IV_NEXT_I]], [[WIDE_TRIP_COUNT]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
 ; CHECK:       exit:
@@ -31,11 +31,11 @@ loop:
   %iv.narrow = phi i32 [ %iv.narrow.next, %loop ], [ 0, %entry ]
   %canonical.iv.next.i = add nuw nsw i64 %iv.wide, 1
   %zext = zext i32 %iv.narrow to i64
-  %gep = getelementptr inbounds double, double* %p, i64 %zext
-  %load = load atomic double, double* %gep unordered, align 8
+  %gep = getelementptr inbounds double, ptr %p, i64 %zext
+  %load = load atomic double, ptr %gep unordered, align 8
   %mul = fmul double %x, %load
-  %gep2 = getelementptr inbounds double, double* %p, i64 %zext
-  store atomic double %mul, double* %gep2 unordered, align 8
+  %gep2 = getelementptr inbounds double, ptr %p, i64 %zext
+  store atomic double %mul, ptr %gep2 unordered, align 8
   %iv.narrow.next = add nuw nsw i32 %iv.narrow, 1
   %loop.cond = icmp slt i32 %iv.narrow.next, %k
   br i1 %loop.cond, label %loop, label %exit

diff  --git a/llvm/test/Transforms/IndVarSimplify/indirectbr.ll b/llvm/test/Transforms/IndVarSimplify/indirectbr.ll
index de9ed91a54fd1..9bb029651cb36 100644
--- a/llvm/test/Transforms/IndVarSimplify/indirectbr.ll
+++ b/llvm/test/Transforms/IndVarSimplify/indirectbr.ll
@@ -3,7 +3,7 @@
 ; PR5758
 define zeroext i1 @foo() nounwind {
 entry:
-  indirectbr i8* undef, [label %"202", label %"133"]
+  indirectbr ptr undef, [label %"202", label %"133"]
 
 "132":                                            ; preds = %"133"
   %0 = add i32 %1, 1                              ; <i32> [#uses=1]
@@ -24,7 +24,7 @@ entry:
 ; PR7333
 define void @__atomvec_module__put_vrml_bonds() nounwind {
 bb7.preheader:                                    ; preds = %entry
-  indirectbr i8* undef, [label %bb14, label %bb16]
+  indirectbr ptr undef, [label %bb14, label %bb16]
 
 bb14:                                             ; preds = %bb14, %bb7.preheader
   br label %bb16
@@ -32,8 +32,8 @@ bb14:                                             ; preds = %bb14, %bb7.preheade
 bb16:                                             ; preds = %bb16, %bb14, %bb7.preheader
   %S.31.0 = phi i64 [ %3, %bb16 ], [ 1, %bb7.preheader ], [ 1, %bb14 ] ; <i64> [#uses=2]
   %0 = add nsw i64 %S.31.0, -1                    ; <i64> [#uses=1]
-  %1 = getelementptr inbounds [3 x double], [3 x double]* undef, i64 0, i64 %0 ; <double*> [#uses=1]
-  %2 = load double, double* %1, align 8                   ; <double> [#uses=0]
+  %1 = getelementptr inbounds [3 x double], ptr undef, i64 0, i64 %0 ; <ptr> [#uses=1]
+  %2 = load double, ptr %1, align 8                   ; <double> [#uses=0]
   %3 = add nsw i64 %S.31.0, 1                     ; <i64> [#uses=1]
   br label %bb16
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/infer-poison-flags.ll b/llvm/test/Transforms/IndVarSimplify/infer-poison-flags.ll
index 6d1334504492e..6b28b933687e4 100644
--- a/llvm/test/Transforms/IndVarSimplify/infer-poison-flags.ll
+++ b/llvm/test/Transforms/IndVarSimplify/infer-poison-flags.ll
@@ -10,7 +10,7 @@ define void @add_cr_nsw_nuw() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = add nuw nsw i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], 1000
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -22,7 +22,7 @@ entry:
 loop:
   %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
   %i.next = add i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, 1000
   br i1 %c, label %loop, label %loopexit
 
@@ -37,7 +37,7 @@ define void @add_cr_nuw() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = add nuw i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], -1
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -49,7 +49,7 @@ entry:
 loop:
   %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
   %i.next = add i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, -1
   br i1 %c, label %loop, label %loopexit
 
@@ -64,7 +64,7 @@ define void @add_cr_nsw() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ -10, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = add nsw i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], 10
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -76,7 +76,7 @@ entry:
 loop:
   %i = phi i32 [ -10, %entry ], [ %i.next, %loop ]
   %i.next = add i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, 10
   br i1 %c, label %loop, label %loopexit
 
@@ -91,7 +91,7 @@ define void @add_cr_none() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 10, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = add i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], 0
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -103,7 +103,7 @@ entry:
 loop:
   %i = phi i32 [ 10, %entry ], [ %i.next, %loop ]
   %i.next = add i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, 0
   br i1 %c, label %loop, label %loopexit
 
@@ -118,7 +118,7 @@ define void @add_unknown_none(i32 %n) {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = add i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], [[N:%.*]]
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -130,7 +130,7 @@ entry:
 loop:
   %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
   %i.next = add i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, %n
   br i1 %c, label %loop, label %loopexit
 
@@ -145,7 +145,7 @@ define void @sub_cr_nsw_nuw() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = sub nsw i32 [[I]], -1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], 1000
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -157,7 +157,7 @@ entry:
 loop:
   %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
   %i.next = sub i32 %i, -1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, 1000
   br i1 %c, label %loop, label %loopexit
 
@@ -173,7 +173,7 @@ define void @sub_unknown_none(i32 %n) {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = sub i32 [[I]], -1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], [[N:%.*]]
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -185,7 +185,7 @@ entry:
 loop:
   %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
   %i.next = sub i32 %i, -1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, %n
   br i1 %c, label %loop, label %loopexit
 
@@ -206,7 +206,7 @@ define void @mul_cr_nsw_nuw() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 1, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = mul i32 [[I]], 2
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], 1024
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -218,7 +218,7 @@ entry:
 loop:
   %i = phi i32 [ 1, %entry ], [ %i.next, %loop ]
   %i.next = mul i32 %i, 2
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, 1024
   br i1 %c, label %loop, label %loopexit
 
@@ -234,7 +234,7 @@ define void @shl_cr_nsw_nuw() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 1, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = shl i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], 1024
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -246,7 +246,7 @@ entry:
 loop:
   %i = phi i32 [ 1, %entry ], [ %i.next, %loop ]
   %i.next = shl i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, 1024
   br i1 %c, label %loop, label %loopexit
 
@@ -262,7 +262,7 @@ define void @lshr_cr_nsw_nuw() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 1024, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = lshr i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], 0
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -274,7 +274,7 @@ entry:
 loop:
   %i = phi i32 [ 1024, %entry ], [ %i.next, %loop ]
   %i.next = lshr i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, 0
   br i1 %c, label %loop, label %loopexit
 
@@ -290,7 +290,7 @@ define void @lshr_cr_nuw() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ -1, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = lshr i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], 0
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -302,7 +302,7 @@ entry:
 loop:
   %i = phi i32 [ -1, %entry ], [ %i.next, %loop ]
   %i.next = lshr i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, 0
   br i1 %c, label %loop, label %loopexit
 
@@ -318,7 +318,7 @@ define void @ashr_cr_nsw_nuw() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 1024, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = ashr i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], 0
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -330,7 +330,7 @@ entry:
 loop:
   %i = phi i32 [ 1024, %entry ], [ %i.next, %loop ]
   %i.next = ashr i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, 0
   br i1 %c, label %loop, label %loopexit
 
@@ -346,7 +346,7 @@ define void @ashr_cr_nsw() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ -1024, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = ashr i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[I]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ne i32 [[I_NEXT]], 1
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
 ; CHECK:       loopexit:
@@ -358,7 +358,7 @@ entry:
 loop:
   %i = phi i32 [ -1024, %entry ], [ %i.next, %loop ]
   %i.next = ashr i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %c = icmp ne i32 %i.next, 1
   br i1 %c, label %loop, label %loopexit
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/interesting-invoke-use.ll b/llvm/test/Transforms/IndVarSimplify/interesting-invoke-use.ll
index 2b76229b34571..40c41cde29f8f 100644
--- a/llvm/test/Transforms/IndVarSimplify/interesting-invoke-use.ll
+++ b/llvm/test/Transforms/IndVarSimplify/interesting-invoke-use.ll
@@ -7,11 +7,11 @@
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
 target triple = "i386-pc-linux-gnu"
   %struct.string___XUB = type { i32, i32 }
-  %struct.string___XUP = type { [0 x i8]*, %struct.string___XUB* }
- at .str7 = external constant [24 x i8]            ; <[24 x i8]*> [#uses=1]
- at C.17.316 = external constant %struct.string___XUB              ; <%struct.string___XUB*> [#uses=1]
+  %struct.string___XUP = type { ptr, ptr }
+ at .str7 = external constant [24 x i8]            ; <ptr> [#uses=1]
+ at C.17.316 = external constant %struct.string___XUB              ; <ptr> [#uses=1]
 
-define void @_ada_c35503g() personality i32 (...)* @__gxx_personality_v0 {
+define void @_ada_c35503g() personality ptr @__gxx_personality_v0 {
 entry:
   br label %bb
 
@@ -32,11 +32,11 @@ invcont127:             ; preds = %bb123
   br i1 %2, label %bb178, label %bb128
 
 bb128:          ; preds = %invcont127
-  invoke void @system__img_int__image_integer(%struct.string___XUP* noalias sret(%struct.string___XUP) null, i32 %i.0)
+  invoke void @system__img_int__image_integer(ptr noalias sret(%struct.string___XUP) null, i32 %i.0)
       to label %invcont129 unwind label %lpad266
 
 invcont129:             ; preds = %bb128
-  invoke void @system__string_ops__str_concat(%struct.string___XUP* noalias sret(%struct.string___XUP) null, [0 x i8]* bitcast ([24 x i8]* @.str7 to [0 x i8]*), %struct.string___XUB* @C.17.316, [0 x i8]* null, %struct.string___XUB* null)
+  invoke void @system__string_ops__str_concat(ptr noalias sret(%struct.string___XUP) null, ptr @.str7, ptr @C.17.316, ptr null, ptr null)
       to label %invcont138 unwind label %lpad266
 
 invcont138:             ; preds = %invcont129
@@ -47,15 +47,15 @@ bb178:          ; preds = %invcont127
   br label %bb123
 
 lpad266:                ; preds = %invcont129, %bb128, %bb123
-  %exn = landingpad {i8*, i32}
+  %exn = landingpad {ptr, i32}
             cleanup
   unreachable
 }
 
 declare i32 @__gxx_personality_v0(...)
 
-declare void @system__img_int__image_integer(%struct.string___XUP* noalias sret(%struct.string___XUP), i32)
+declare void @system__img_int__image_integer(ptr noalias sret(%struct.string___XUP), i32)
 
-declare void @system__string_ops__str_concat(%struct.string___XUP* noalias sret(%struct.string___XUP), [0 x i8]*, %struct.string___XUB*, [0 x i8]*, %struct.string___XUB*)
+declare void @system__string_ops__str_concat(ptr noalias sret(%struct.string___XUP), ptr, ptr, ptr, ptr)
 
 declare i32 @report__ident_int(i32)

diff  --git a/llvm/test/Transforms/IndVarSimplify/iv-fold.ll b/llvm/test/Transforms/IndVarSimplify/iv-fold.ll
index 1be4d36d32813..84d069a883e4b 100644
--- a/llvm/test/Transforms/IndVarSimplify/iv-fold.ll
+++ b/llvm/test/Transforms/IndVarSimplify/iv-fold.ll
@@ -6,19 +6,19 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 ;
 ; CHECK-LABEL: @foldIncShr(
 ; CHECK: shr.1 = lshr i32 %0, 5
-define i32 @foldIncShr(i32* %bitmap, i32 %bit_addr, i32 %nbits) nounwind {
+define i32 @foldIncShr(ptr %bitmap, i32 %bit_addr, i32 %nbits) nounwind {
 entry:
   br label %while.body
 
 while.body:
   %0 = phi i32 [ 0, %entry ], [ %inc.2, %while.body ]
   %shr = lshr i32 %0, 5
-  %arrayidx = getelementptr inbounds i32, i32* %bitmap, i32 %shr
-  %tmp6 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %bitmap, i32 %shr
+  %tmp6 = load i32, ptr %arrayidx, align 4
   %inc.1 = add i32 %0, 1
   %shr.1 = lshr i32 %inc.1, 5
-  %arrayidx.1 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.1
-  %tmp6.1 = load i32, i32* %arrayidx.1, align 4
+  %arrayidx.1 = getelementptr inbounds i32, ptr %bitmap, i32 %shr.1
+  %tmp6.1 = load i32, ptr %arrayidx.1, align 4
   %inc.2 = add i32 %inc.1, 1
   %exitcond.3 = icmp eq i32 %inc.2, 128
   br i1 %exitcond.3, label %while.end, label %while.body
@@ -33,19 +33,19 @@ while.end:
 ;
 ; CHECK-LABEL: @noFoldIncShr(
 ; CHECK: shr.1 = lshr i32 %inc.1, 5
-define i32 @noFoldIncShr(i32* %bitmap, i32 %bit_addr, i32 %nbits) nounwind {
+define i32 @noFoldIncShr(ptr %bitmap, i32 %bit_addr, i32 %nbits) nounwind {
 entry:
   br label %while.body
 
 while.body:
   %0 = phi i32 [ 0, %entry ], [ %inc.3, %while.body ]
   %shr = lshr i32 %0, 5
-  %arrayidx = getelementptr inbounds i32, i32* %bitmap, i32 %shr
-  %tmp6 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %bitmap, i32 %shr
+  %tmp6 = load i32, ptr %arrayidx, align 4
   %inc.1 = add i32 %0, 1
   %shr.1 = lshr i32 %inc.1, 5
-  %arrayidx.1 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.1
-  %tmp6.1 = load i32, i32* %arrayidx.1, align 4
+  %arrayidx.1 = getelementptr inbounds i32, ptr %bitmap, i32 %shr.1
+  %tmp6.1 = load i32, ptr %arrayidx.1, align 4
   %inc.3 = add i32 %inc.1, 2
   %exitcond.3 = icmp eq i32 %inc.3, 96
   br i1 %exitcond.3, label %while.end, label %while.body

diff  --git a/llvm/test/Transforms/IndVarSimplify/iv-sext.ll b/llvm/test/Transforms/IndVarSimplify/iv-sext.ll
index 1edf95c2317c8..41ca197c25780 100644
--- a/llvm/test/Transforms/IndVarSimplify/iv-sext.ll
+++ b/llvm/test/Transforms/IndVarSimplify/iv-sext.ll
@@ -6,9 +6,9 @@
 
 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-n32:64"
 
-define void @t(float* %pTmp1, float* %peakWeight, float* %nrgReducePeakrate, i32 %bandEdgeIndex, float %tmp1) nounwind {
+define void @t(ptr %pTmp1, ptr %peakWeight, ptr %nrgReducePeakrate, i32 %bandEdgeIndex, float %tmp1) nounwind {
 entry:
-	%tmp = load float, float* %peakWeight, align 4		; <float> [#uses=1]
+	%tmp = load float, ptr %peakWeight, align 4		; <float> [#uses=1]
 	%tmp2 = icmp sgt i32 %bandEdgeIndex, 0		; <i1> [#uses=1]
 	br i1 %tmp2, label %bb.nph22, label %return
 
@@ -33,13 +33,13 @@ bb:		; preds = %bb8, %bb.nph22
 bb1:		; preds = %bb
 	%tmp5 = add i32 %part.016, -1		; <i32> [#uses=1]
 	%tmp6 = sext i32 %tmp5 to i64		; <i64> [#uses=1]
-	%tmp7 = getelementptr float, float* %pTmp1, i64 %tmp6		; <float*> [#uses=1]
-	%tmp8 = load float, float* %tmp7, align 4		; <float> [#uses=1]
+	%tmp7 = getelementptr float, ptr %pTmp1, i64 %tmp6		; <ptr> [#uses=1]
+	%tmp8 = load float, ptr %tmp7, align 4		; <float> [#uses=1]
 	%tmp9 = fadd float %tmp8, %distERBlo.120		; <float> [#uses=1]
 	%tmp10 = add i32 %part.016, -1		; <i32> [#uses=1]
 	%tmp11 = sext i32 %tmp10 to i64		; <i64> [#uses=1]
-	%tmp12 = getelementptr float, float* %pTmp1, i64 %tmp11		; <float*> [#uses=1]
-	%tmp13 = load float, float* %tmp12, align 4		; <float> [#uses=1]
+	%tmp12 = getelementptr float, ptr %pTmp1, i64 %tmp11		; <ptr> [#uses=1]
+	%tmp13 = load float, ptr %tmp12, align 4		; <float> [#uses=1]
 	%tmp14 = fsub float %distERBhi.121, %tmp13		; <float> [#uses=1]
 	br label %bb3.preheader
 
@@ -57,12 +57,12 @@ bb2:		; preds = %bb3, %bb.nph
 	%loPart.02 = phi i32 [ %tmp24, %bb3 ], [ %loPart.118, %bb.nph ]		; <i32> [#uses=3]
 	%peakCount.01 = phi float [ %tmp23, %bb3 ], [ %peakCount.117, %bb.nph ]		; <float> [#uses=1]
 	%tmp16 = sext i32 %loPart.02 to i64		; <i64> [#uses=1]
-	%tmp17 = getelementptr float, float* %pTmp1, i64 %tmp16		; <float*> [#uses=1]
-	%tmp18 = load float, float* %tmp17, align 4		; <float> [#uses=1]
+	%tmp17 = getelementptr float, ptr %pTmp1, i64 %tmp16		; <ptr> [#uses=1]
+	%tmp18 = load float, ptr %tmp17, align 4		; <float> [#uses=1]
 	%tmp19 = fsub float %distERBlo.03, %tmp18		; <float> [#uses=3]
 	%tmp20 = sext i32 %loPart.02 to i64		; <i64> [#uses=1]
-	%tmp21 = getelementptr float, float* %peakWeight, i64 %tmp20		; <float*> [#uses=1]
-	%tmp22 = load float, float* %tmp21, align 4		; <float> [#uses=1]
+	%tmp21 = getelementptr float, ptr %peakWeight, i64 %tmp20		; <ptr> [#uses=1]
+	%tmp22 = load float, ptr %tmp21, align 4		; <float> [#uses=1]
 	%tmp23 = fsub float %peakCount.01, %tmp22		; <float> [#uses=2]
 	%tmp24 = add i32 %loPart.02, 1		; <i32> [#uses=2]
 	br label %bb3
@@ -97,13 +97,13 @@ bb4:		; preds = %bb5, %bb.nph12
 	%hiPart.08 = phi i32 [ %tmp31, %bb5 ], [ %hiPart.119, %bb.nph12 ]		; <i32> [#uses=2]
 	%peakCount.27 = phi float [ %tmp35, %bb5 ], [ %peakCount.0.lcssa, %bb.nph12 ]		; <float> [#uses=1]
 	%tmp27 = sext i32 %hiPart.08 to i64		; <i64> [#uses=1]
-	%tmp28 = getelementptr float, float* %pTmp1, i64 %tmp27		; <float*> [#uses=1]
-	%tmp29 = load float, float* %tmp28, align 4		; <float> [#uses=1]
+	%tmp28 = getelementptr float, ptr %pTmp1, i64 %tmp27		; <ptr> [#uses=1]
+	%tmp29 = load float, ptr %tmp28, align 4		; <float> [#uses=1]
 	%tmp30 = fadd float %tmp29, %distERBhi.29		; <float> [#uses=3]
 	%tmp31 = add i32 %hiPart.08, 1		; <i32> [#uses=4]
 	%tmp32 = sext i32 %tmp31 to i64		; <i64> [#uses=1]
-	%tmp33 = getelementptr float, float* %peakWeight, i64 %tmp32		; <float*> [#uses=1]
-	%tmp34 = load float, float* %tmp33, align 4		; <float> [#uses=1]
+	%tmp33 = getelementptr float, ptr %peakWeight, i64 %tmp32		; <ptr> [#uses=1]
+	%tmp34 = load float, ptr %tmp33, align 4		; <float> [#uses=1]
 	%tmp35 = fadd float %tmp34, %peakCount.27		; <float> [#uses=2]
 	br label %bb5
 
@@ -132,8 +132,8 @@ bb7:		; preds = %bb5.bb7_crit_edge, %bb5.preheader
 	%tmp42 = fadd float %tmp41, 1.000000e+00		; <float> [#uses=1]
 	%tmp43 = fdiv float 1.000000e+00, %tmp42		; <float> [#uses=1]
 	%tmp44 = sext i32 %part.016 to i64		; <i64> [#uses=1]
-	%tmp45 = getelementptr float, float* %nrgReducePeakrate, i64 %tmp44		; <float*> [#uses=1]
-	store float %tmp43, float* %tmp45, align 4
+	%tmp45 = getelementptr float, ptr %nrgReducePeakrate, i64 %tmp44		; <ptr> [#uses=1]
+	store float %tmp43, ptr %tmp45, align 4
 	%tmp46 = add i32 %part.016, 1		; <i32> [#uses=2]
 	br label %bb8
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/iv-zext.ll b/llvm/test/Transforms/IndVarSimplify/iv-zext.ll
index 650d730c1a077..7cefb17fcfd76 100644
--- a/llvm/test/Transforms/IndVarSimplify/iv-zext.ll
+++ b/llvm/test/Transforms/IndVarSimplify/iv-zext.ll
@@ -4,26 +4,26 @@
 
 target datalayout = "p:64:64:64-n32:64"
 
-define void @foo(double* %d, i64 %n) nounwind {
+define void @foo(ptr %d, i64 %n) nounwind {
 entry:
 	br label %loop
 
 loop:
 	%indvar = phi i64 [ 0, %entry ], [ %indvar.next, %loop ]
 	%indvar.i8 = and i64 %indvar, 255
-	%t0 = getelementptr double, double* %d, i64 %indvar.i8
-	%t1 = load double, double* %t0
+	%t0 = getelementptr double, ptr %d, i64 %indvar.i8
+	%t1 = load double, ptr %t0
 	%t2 = fmul double %t1, 0.1
-	store double %t2, double* %t0
+	store double %t2, ptr %t0
 	%indvar.i24 = and i64 %indvar, 16777215
-	%t3 = getelementptr double, double* %d, i64 %indvar.i24
-	%t4 = load double, double* %t3
+	%t3 = getelementptr double, ptr %d, i64 %indvar.i24
+	%t4 = load double, ptr %t3
 	%t5 = fmul double %t4, 2.3
-	store double %t5, double* %t3
-	%t6 = getelementptr double, double* %d, i64 %indvar
-	%t7 = load double, double* %t6
+	store double %t5, ptr %t3
+	%t6 = getelementptr double, ptr %d, i64 %indvar
+	%t7 = load double, ptr %t6
 	%t8 = fmul double %t7, 4.5
-	store double %t8, double* %t6
+	store double %t8, ptr %t6
 	%indvar.next = add i64 %indvar, 1
 	%exitcond = icmp eq i64 %indvar.next, 10
 	br i1 %exitcond, label %return, label %loop

diff  --git a/llvm/test/Transforms/IndVarSimplify/lftr-dead-ivs.ll b/llvm/test/Transforms/IndVarSimplify/lftr-dead-ivs.ll
index 31143c172e52c..6c15eb4af4f13 100644
--- a/llvm/test/Transforms/IndVarSimplify/lftr-dead-ivs.ll
+++ b/llvm/test/Transforms/IndVarSimplify/lftr-dead-ivs.ll
@@ -26,11 +26,11 @@ define void @neg_dynamically_dead_inbounds(i1 %always_false) #0 {
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I_0:%.*]] = phi i8 [ 0, [[ENTRY:%.*]] ], [ [[TMP4:%.*]], [[CONT:%.*]] ]
-; CHECK-NEXT:    [[P_0:%.*]] = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), [[ENTRY]] ], [ [[TMP3:%.*]], [[CONT]] ]
-; CHECK-NEXT:    [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
+; CHECK-NEXT:    [[P_0:%.*]] = phi ptr [ @data, [[ENTRY]] ], [ [[TMP3:%.*]], [[CONT]] ]
+; CHECK-NEXT:    [[TMP3]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
 ; CHECK-NEXT:    br i1 [[ALWAYS_FALSE:%.*]], label [[NEVER_EXECUTED:%.*]], label [[CONT]]
 ; CHECK:       never_executed:
-; CHECK-NEXT:    store volatile i8 0, i8* [[TMP3]], align 1
+; CHECK-NEXT:    store volatile i8 0, ptr [[TMP3]], align 1
 ; CHECK-NEXT:    br label [[CONT]]
 ; CHECK:       cont:
 ; CHECK-NEXT:    [[TMP4]] = add nuw i8 [[I_0]], 1
@@ -44,12 +44,12 @@ entry:
 
 loop:
   %i.0 = phi i8 [ 0, %entry ], [ %tmp4, %cont ]
-  %p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %entry ], [ %tmp3, %cont ]
-  %tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
+  %p.0 = phi ptr [ @data, %entry ], [ %tmp3, %cont ]
+  %tmp3 = getelementptr inbounds i8, ptr %p.0, i64 1
   br i1 %always_false, label %never_executed, label %cont
 
 never_executed:
-  store volatile i8 0, i8* %tmp3
+  store volatile i8 0, ptr %tmp3
   br label %cont
 
 cont:
@@ -63,17 +63,17 @@ exit:
 
 ; Similiar to above, but shows how we currently guard non-constant
 ; memory operands in a manner which hides the latent miscompile.
-define void @neg_dynamically_dead_inbounds2(i8* %a, i1 %always_false) #0 {
+define void @neg_dynamically_dead_inbounds2(ptr %a, i1 %always_false) #0 {
 ; CHECK-LABEL: @neg_dynamically_dead_inbounds2(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I_0:%.*]] = phi i8 [ 0, [[ENTRY:%.*]] ], [ [[TMP4:%.*]], [[CONT:%.*]] ]
-; CHECK-NEXT:    [[P_0:%.*]] = phi i8* [ [[A:%.*]], [[ENTRY]] ], [ [[TMP3:%.*]], [[CONT]] ]
-; CHECK-NEXT:    [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
+; CHECK-NEXT:    [[P_0:%.*]] = phi ptr [ [[A:%.*]], [[ENTRY]] ], [ [[TMP3:%.*]], [[CONT]] ]
+; CHECK-NEXT:    [[TMP3]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
 ; CHECK-NEXT:    br i1 [[ALWAYS_FALSE:%.*]], label [[NEVER_EXECUTED:%.*]], label [[CONT]]
 ; CHECK:       never_executed:
-; CHECK-NEXT:    store volatile i8 0, i8* [[TMP3]], align 1
+; CHECK-NEXT:    store volatile i8 0, ptr [[TMP3]], align 1
 ; CHECK-NEXT:    br label [[CONT]]
 ; CHECK:       cont:
 ; CHECK-NEXT:    [[TMP4]] = add nuw i8 [[I_0]], 1
@@ -87,12 +87,12 @@ entry:
 
 loop:
   %i.0 = phi i8 [ 0, %entry ], [ %tmp4, %cont ]
-  %p.0 = phi i8* [ %a, %entry ], [ %tmp3, %cont ]
-  %tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
+  %p.0 = phi ptr [ %a, %entry ], [ %tmp3, %cont ]
+  %tmp3 = getelementptr inbounds i8, ptr %p.0, i64 1
   br i1 %always_false, label %never_executed, label %cont
 
 never_executed:
-  store volatile i8 0, i8* %tmp3
+  store volatile i8 0, ptr %tmp3
   br label %cont
 
 cont:
@@ -109,10 +109,10 @@ define void @dom_store_preinc() #0 {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
-; CHECK-NEXT:    [[P_0:%.*]] = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
-; CHECK-NEXT:    store volatile i8 0, i8* [[P_0]], align 1
-; CHECK-NEXT:    [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
-; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i8* [[P_0]], getelementptr ([240 x i8], [240 x i8]* @data, i64 1, i64 5)
+; CHECK-NEXT:    [[P_0:%.*]] = phi ptr [ @data, [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
+; CHECK-NEXT:    store volatile i8 0, ptr [[P_0]], align 1
+; CHECK-NEXT:    [[TMP3]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
+; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne ptr [[P_0]], getelementptr (i8, ptr @data, i64 245)
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret void
@@ -122,9 +122,9 @@ entry:
 
 loop:
   %i.0 = phi i8 [ 0, %entry ], [ %tmp4, %loop ]
-  %p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %entry ], [ %tmp3, %loop ]
-  store volatile i8 0, i8* %p.0
-  %tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
+  %p.0 = phi ptr [ @data, %entry ], [ %tmp3, %loop ]
+  store volatile i8 0, ptr %p.0
+  %tmp3 = getelementptr inbounds i8, ptr %p.0, i64 1
   %tmp4 = add i8 %i.0, 1
   %tmp5 = icmp ult i8 %tmp4, -10
   br i1 %tmp5, label %loop, label %exit
@@ -138,10 +138,10 @@ define void @dom_store_postinc() #0 {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
-; CHECK-NEXT:    [[P_0:%.*]] = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
-; CHECK-NEXT:    [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
-; CHECK-NEXT:    store volatile i8 0, i8* [[TMP3]], align 1
-; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i8* [[TMP3]], getelementptr ([240 x i8], [240 x i8]* @data, i64 1, i64 6)
+; CHECK-NEXT:    [[P_0:%.*]] = phi ptr [ @data, [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
+; CHECK-NEXT:    [[TMP3]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
+; CHECK-NEXT:    store volatile i8 0, ptr [[TMP3]], align 1
+; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne ptr [[TMP3]], getelementptr (i8, ptr @data, i64 246)
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret void
@@ -151,9 +151,9 @@ entry:
 
 loop:
   %i.0 = phi i8 [ 0, %entry ], [ %tmp4, %loop ]
-  %p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %entry ], [ %tmp3, %loop ]
-  %tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
-  store volatile i8 0, i8* %tmp3
+  %p.0 = phi ptr [ @data, %entry ], [ %tmp3, %loop ]
+  %tmp3 = getelementptr inbounds i8, ptr %p.0, i64 1
+  store volatile i8 0, ptr %tmp3
   %tmp4 = add i8 %i.0, 1
   %tmp5 = icmp ult i8 %tmp4, -10
   br i1 %tmp5, label %loop, label %exit
@@ -167,10 +167,10 @@ define i8 @dom_load() #0 {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
-; CHECK-NEXT:    [[P_0:%.*]] = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
-; CHECK-NEXT:    [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
-; CHECK-NEXT:    [[V:%.*]] = load i8, i8* [[TMP3]], align 1
-; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i8* [[TMP3]], getelementptr ([240 x i8], [240 x i8]* @data, i64 1, i64 6)
+; CHECK-NEXT:    [[P_0:%.*]] = phi ptr [ @data, [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
+; CHECK-NEXT:    [[TMP3]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
+; CHECK-NEXT:    [[V:%.*]] = load i8, ptr [[TMP3]], align 1
+; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne ptr [[TMP3]], getelementptr (i8, ptr @data, i64 246)
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    [[V_LCSSA:%.*]] = phi i8 [ [[V]], [[LOOP]] ]
@@ -181,9 +181,9 @@ entry:
 
 loop:
   %i.0 = phi i8 [ 0, %entry ], [ %tmp4, %loop ]
-  %p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %entry ], [ %tmp3, %loop ]
-  %tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
-  %v = load i8, i8* %tmp3
+  %p.0 = phi ptr [ @data, %entry ], [ %tmp3, %loop ]
+  %tmp3 = getelementptr inbounds i8, ptr %p.0, i64 1
+  %v = load i8, ptr %tmp3
   %tmp4 = add i8 %i.0, 1
   %tmp5 = icmp ult i8 %tmp4, -10
   br i1 %tmp5, label %loop, label %exit

diff  --git a/llvm/test/Transforms/IndVarSimplify/lftr-multi-exit.ll b/llvm/test/Transforms/IndVarSimplify/lftr-multi-exit.ll
index 45151b4bf36bc..0898c6c2dae34 100644
--- a/llvm/test/Transforms/IndVarSimplify/lftr-multi-exit.ll
+++ b/llvm/test/Transforms/IndVarSimplify/lftr-multi-exit.ll
@@ -19,7 +19,7 @@ define void @analyzeable_early_exit(i32 %n) {
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
 ; CHECK:       latch:
 ; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
-; CHECK-NEXT:    store i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[EXITCOND1:%.*]] = icmp ne i32 [[IV_NEXT]], 1000
 ; CHECK-NEXT:    br i1 [[EXITCOND1]], label [[LOOP]], label [[EXIT]]
 ; CHECK:       exit:
@@ -35,7 +35,7 @@ loop:
 
 latch:
   %iv.next = add i32 %iv, 1
-  store i32 %iv, i32* @A
+  store i32 %iv, ptr @A
   %c = icmp ult i32 %iv.next, 1000
   br i1 %c, label %loop, label %exit
 
@@ -49,12 +49,12 @@ define void @unanalyzeable_early_exit() {
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LATCH:%.*]] ]
-; CHECK-NEXT:    [[VOL:%.*]] = load volatile i32, i32* @A, align 4
+; CHECK-NEXT:    [[VOL:%.*]] = load volatile i32, ptr @A, align 4
 ; CHECK-NEXT:    [[EARLYCND:%.*]] = icmp ne i32 [[VOL]], 0
 ; CHECK-NEXT:    br i1 [[EARLYCND]], label [[LATCH]], label [[EXIT:%.*]]
 ; CHECK:       latch:
 ; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
-; CHECK-NEXT:    store i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i32 [[IV_NEXT]], 1000
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT]]
 ; CHECK:       exit:
@@ -65,13 +65,13 @@ entry:
 
 loop:
   %iv = phi i32 [ 0, %entry], [ %iv.next, %latch]
-  %vol = load volatile i32, i32* @A
+  %vol = load volatile i32, ptr @A
   %earlycnd = icmp ne i32 %vol, 0
   br i1 %earlycnd, label %latch, label %exit
 
 latch:
   %iv.next = add i32 %iv, 1
-  store i32 %iv, i32* @A
+  store i32 %iv, ptr @A
   %c = icmp ult i32 %iv.next, 1000
   br i1 %c, label %loop, label %exit
 
@@ -89,12 +89,12 @@ define void @multiple_early_exits(i32 %n, i32 %m) {
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i32 [[IV]], [[N:%.*]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[CONTINUE:%.*]], label [[EXIT:%.*]]
 ; CHECK:       continue:
-; CHECK-NEXT:    store volatile i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[EXITCOND1:%.*]] = icmp ne i32 [[IV]], [[M:%.*]]
 ; CHECK-NEXT:    br i1 [[EXITCOND1]], label [[LATCH]], label [[EXIT]]
 ; CHECK:       latch:
 ; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
-; CHECK-NEXT:    store volatile i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[EXITCOND2:%.*]] = icmp ne i32 [[IV_NEXT]], 1000
 ; CHECK-NEXT:    br i1 [[EXITCOND2]], label [[LOOP]], label [[EXIT]]
 ; CHECK:       exit:
@@ -109,13 +109,13 @@ loop:
   br i1 %earlycnd, label %continue, label %exit
 
 continue:
-  store volatile i32 %iv, i32* @A
+  store volatile i32 %iv, ptr @A
   %earlycnd2 = icmp ult i32 %iv, %m
   br i1 %earlycnd2, label %latch, label %exit
 
 latch:
   %iv.next = add i32 %iv, 1
-  store volatile i32 %iv, i32* @A
+  store volatile i32 %iv, ptr @A
   %c = icmp ult i32 %iv.next, 1000
   br i1 %c, label %loop, label %exit
 
@@ -136,7 +136,7 @@ define void @compound_early_exit(i32 %n, i32 %m) {
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
 ; CHECK:       latch:
 ; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
-; CHECK-NEXT:    store volatile i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[EXITCOND1:%.*]] = icmp ne i32 [[IV_NEXT]], 1000
 ; CHECK-NEXT:    br i1 [[EXITCOND1]], label [[LOOP]], label [[EXIT]]
 ; CHECK:       exit:
@@ -154,7 +154,7 @@ loop:
 
 latch:
   %iv.next = add i32 %iv, 1
-  store volatile i32 %iv, i32* @A
+  store volatile i32 %iv, ptr @A
   %c = icmp ult i32 %iv.next, 1000
   br i1 %c, label %loop, label %exit
 
@@ -173,8 +173,8 @@ define void @unanalyzeable_latch(i32 %n) {
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
 ; CHECK:       latch:
 ; CHECK-NEXT:    [[IV_NEXT]] = add i32 [[IV]], 1
-; CHECK-NEXT:    store i32 [[IV]], i32* @A, align 4
-; CHECK-NEXT:    [[VOL:%.*]] = load volatile i32, i32* @A, align 4
+; CHECK-NEXT:    store i32 [[IV]], ptr @A, align 4
+; CHECK-NEXT:    [[VOL:%.*]] = load volatile i32, ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ult i32 [[VOL]], 1000
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[EXIT]]
 ; CHECK:       exit:
@@ -190,8 +190,8 @@ loop:
 
 latch:
   %iv.next = add i32 %iv, 1
-  store i32 %iv, i32* @A
-  %vol = load volatile i32, i32* @A
+  store i32 %iv, ptr @A
+  %vol = load volatile i32, ptr @A
   %c = icmp ult i32 %vol, 1000
   br i1 %c, label %loop, label %exit
 
@@ -209,7 +209,7 @@ define void @single_exit_no_latch(i32 %n) {
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
 ; CHECK:       latch:
 ; CHECK-NEXT:    [[IV_NEXT]] = add i32 [[IV]], 1
-; CHECK-NEXT:    store i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    br label [[LOOP]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret void
@@ -224,7 +224,7 @@ loop:
 
 latch:
   %iv.next = add i32 %iv, 1
-  store i32 %iv, i32* @A
+  store i32 %iv, ptr @A
   br label %loop
 
 exit:
@@ -242,11 +242,11 @@ define void @no_latch_exit(i32 %n, i32 %m) {
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i32 [[IV]], [[N:%.*]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[CONTINUE:%.*]], label [[EXIT:%.*]]
 ; CHECK:       continue:
-; CHECK-NEXT:    store volatile i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[EXITCOND1:%.*]] = icmp ne i32 [[IV]], [[M:%.*]]
 ; CHECK-NEXT:    br i1 [[EXITCOND1]], label [[LATCH]], label [[EXIT]]
 ; CHECK:       latch:
-; CHECK-NEXT:    store volatile i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[IV_NEXT]] = add i32 [[IV]], 1
 ; CHECK-NEXT:    br label [[LOOP]]
 ; CHECK:       exit:
@@ -261,12 +261,12 @@ loop:
   br i1 %earlycnd, label %continue, label %exit
 
 continue:
-  store volatile i32 %iv, i32* @A
+  store volatile i32 %iv, ptr @A
   %earlycnd2 = icmp ult i32 %iv, %m
   br i1 %earlycnd2, label %latch, label %exit
 
 latch:
-  store volatile i32 %iv, i32* @A
+  store volatile i32 %iv, ptr @A
   %iv.next = add i32 %iv, 1
   br label %loop
 
@@ -286,7 +286,7 @@ define void @combine_ivs(i32 %n) {
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
 ; CHECK:       latch:
 ; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
-; CHECK-NEXT:    store volatile i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[EXITCOND1:%.*]] = icmp ne i32 [[IV_NEXT]], 999
 ; CHECK-NEXT:    br i1 [[EXITCOND1]], label [[LOOP]], label [[EXIT]]
 ; CHECK:       exit:
@@ -304,7 +304,7 @@ loop:
 latch:
   %iv.next = add i32 %iv, 1
   %iv2.next = add i32 %iv2, 1
-  store volatile i32 %iv, i32* @A
+  store volatile i32 %iv, ptr @A
   %c = icmp ult i32 %iv2.next, 1000
   br i1 %c, label %loop, label %exit
 
@@ -323,7 +323,7 @@ define void @combine_ivs2(i32 %n) {
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
 ; CHECK:       latch:
 ; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
-; CHECK-NEXT:    store volatile i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[EXITCOND1:%.*]] = icmp ne i32 [[IV_NEXT]], 1000
 ; CHECK-NEXT:    br i1 [[EXITCOND1]], label [[LOOP]], label [[EXIT]]
 ; CHECK:       exit:
@@ -341,7 +341,7 @@ loop:
 latch:
   %iv.next = add i32 %iv, 1
   %iv2.next = sub i32 %iv2, 1
-  store volatile i32 %iv, i32* @A
+  store volatile i32 %iv, ptr @A
   %c = icmp ugt i32 %iv2.next, 0
   br i1 %c, label %loop, label %exit
 
@@ -361,7 +361,7 @@ define void @simplify_exit_test(i32 %n) {
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
 ; CHECK:       latch:
 ; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
-; CHECK-NEXT:    store volatile i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[EXITCOND1:%.*]] = icmp ne i32 [[IV_NEXT]], 65
 ; CHECK-NEXT:    br i1 [[EXITCOND1]], label [[LOOP]], label [[EXIT]]
 ; CHECK:       exit:
@@ -378,7 +378,7 @@ loop:
 latch:
   %iv.next = add i32 %iv, 1
   %fx = shl i32 %iv, 4
-  store volatile i32 %iv, i32* @A
+  store volatile i32 %iv, ptr @A
   %c = icmp ult i32 %fx, 1024
   br i1 %c, label %loop, label %exit
 
@@ -395,13 +395,13 @@ define void @simplify_exit_test2(i32 %n) {
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LATCH:%.*]] ]
-; CHECK-NEXT:    [[VOL:%.*]] = load volatile i32, i32* @A, align 4
+; CHECK-NEXT:    [[VOL:%.*]] = load volatile i32, ptr @A, align 4
 ; CHECK-NEXT:    [[EARLYCND:%.*]] = icmp ne i32 [[VOL]], 0
 ; CHECK-NEXT:    br i1 [[EARLYCND]], label [[LATCH]], label [[EXIT:%.*]]
 ; CHECK:       latch:
 ; CHECK-NEXT:    [[IV_NEXT]] = add i32 [[IV]], 1
 ; CHECK-NEXT:    [[FX:%.*]] = udiv i32 [[IV]], 4
-; CHECK-NEXT:    store volatile i32 [[IV]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV]], ptr @A, align 4
 ; CHECK-NEXT:    [[C:%.*]] = icmp ult i32 [[FX]], 1024
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[EXIT]]
 ; CHECK:       exit:
@@ -412,14 +412,14 @@ entry:
 
 loop:
   %iv = phi i32 [ 0, %entry], [ %iv.next, %latch]
-  %vol = load volatile i32, i32* @A
+  %vol = load volatile i32, ptr @A
   %earlycnd = icmp ne i32 %vol, 0
   br i1 %earlycnd, label %latch, label %exit
 
 latch:
   %iv.next = add i32 %iv, 1
   %fx = udiv i32 %iv, 4
-  store volatile i32 %iv, i32* @A
+  store volatile i32 %iv, ptr @A
   %c = icmp ult i32 %fx, 1024
   br i1 %c, label %loop, label %exit
 
@@ -441,12 +441,12 @@ define void @nested(i32 %n) {
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[IV1:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV1_NEXT:%.*]], [[OUTER_LATCH:%.*]] ]
-; CHECK-NEXT:    store volatile i32 [[IV1]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV1]], ptr @A, align 4
 ; CHECK-NEXT:    [[IV1_NEXT]] = add nuw nsw i32 [[IV1]], 1
 ; CHECK-NEXT:    br label [[INNER:%.*]]
 ; CHECK:       inner:
 ; CHECK-NEXT:    [[IV2:%.*]] = phi i32 [ 0, [[OUTER]] ], [ [[IV2_NEXT:%.*]], [[INNER_LATCH:%.*]] ]
-; CHECK-NEXT:    store volatile i32 [[IV2]], i32* @A, align 4
+; CHECK-NEXT:    store volatile i32 [[IV2]], ptr @A, align 4
 ; CHECK-NEXT:    [[IV2_NEXT]] = add nuw nsw i32 [[IV2]], 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i32 [[IV2]], 20
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[INNER_LATCH]], label [[EXIT_LOOPEXIT:%.*]]
@@ -468,13 +468,13 @@ entry:
 
 outer:
   %iv1 = phi i32 [ 0, %entry ], [ %iv1.next, %outer_latch ]
-  store volatile i32 %iv1, i32* @A
+  store volatile i32 %iv1, ptr @A
   %iv1.next = add i32 %iv1, 1
   br label %inner
 
 inner:
   %iv2 = phi i32 [ 0, %outer ], [ %iv2.next, %inner_latch ]
-  store volatile i32 %iv2, i32* @A
+  store volatile i32 %iv2, ptr @A
   %iv2.next = add i32 %iv2, 1
   %innertest = icmp ult i32 %iv2, 20
   br i1 %innertest, label %inner_latch, label %exit

diff  --git a/llvm/test/Transforms/IndVarSimplify/lftr-pr20680.ll b/llvm/test/Transforms/IndVarSimplify/lftr-pr20680.ll
index 080cecb6c07e8..02de829421f4c 100644
--- a/llvm/test/Transforms/IndVarSimplify/lftr-pr20680.ll
+++ b/llvm/test/Transforms/IndVarSimplify/lftr-pr20680.ll
@@ -12,9 +12,9 @@ target datalayout = "n8:16:32:64"
 define void @f() {
 ; CHECK-LABEL: @f(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @a, align 4
 ; CHECK-NEXT:    [[TOBOOL2:%.*]] = icmp eq i32 [[TMP0]], 0
-; CHECK-NEXT:    [[TMP1:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr @a, align 4
 ; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[TMP1]], 0
 ; CHECK-NEXT:    br label [[FOR_COND2_PREHEADER:%.*]]
 ; CHECK:       for.cond2.preheader:
@@ -38,7 +38,7 @@ define void @f() {
 ; CHECK:       cond.false.us.us:
 ; CHECK-NEXT:    br label [[COND_END_US_US]]
 ; CHECK:       cond.end.us.us:
-; CHECK-NEXT:    [[TMP4:%.*]] = load i32, i32* @b, align 4
+; CHECK-NEXT:    [[TMP4:%.*]] = load i32, ptr @b, align 4
 ; CHECK-NEXT:    [[CMP91_US_US:%.*]] = icmp slt i32 [[TMP4]], 1
 ; CHECK-NEXT:    br i1 [[CMP91_US_US]], label [[FOR_INC_LR_PH_US_US:%.*]], label [[FOR_COND2_LOOPEXIT_US_US:%.*]]
 ; CHECK:       for.cond2.loopexit.us.us:
@@ -46,7 +46,7 @@ define void @f() {
 ; CHECK:       for.inc.lr.ph.us.us:
 ; CHECK-NEXT:    br label [[FOR_INC_US_US:%.*]]
 ; CHECK:       for.cond8.for.cond2.loopexit_crit_edge.us.us:
-; CHECK-NEXT:    store i32 1, i32* @b, align 4
+; CHECK-NEXT:    store i32 1, ptr @b, align 4
 ; CHECK-NEXT:    br label [[FOR_COND2_LOOPEXIT_US_US]]
 ; CHECK:       for.inc.us.us:
 ; CHECK-NEXT:    [[TMP5:%.*]] = phi i32 [ [[TMP4]], [[FOR_INC_LR_PH_US_US]] ], [ [[INC_US_US:%.*]], [[FOR_INC_US_US]] ]
@@ -62,7 +62,7 @@ define void @f() {
 ; CHECK:       cond.false.us:
 ; CHECK-NEXT:    br label [[COND_END_US]]
 ; CHECK:       cond.end.us:
-; CHECK-NEXT:    [[TMP6:%.*]] = load i32, i32* @b, align 4
+; CHECK-NEXT:    [[TMP6:%.*]] = load i32, ptr @b, align 4
 ; CHECK-NEXT:    [[CMP91_US:%.*]] = icmp slt i32 [[TMP6]], 1
 ; CHECK-NEXT:    br i1 [[CMP91_US]], label [[FOR_INC_LR_PH_US:%.*]], label [[FOR_COND2_LOOPEXIT_US:%.*]]
 ; CHECK:       for.inc.us:
@@ -75,7 +75,7 @@ define void @f() {
 ; CHECK:       for.inc.lr.ph.us:
 ; CHECK-NEXT:    br label [[FOR_INC_US]]
 ; CHECK:       for.cond8.for.cond2.loopexit_crit_edge.us:
-; CHECK-NEXT:    store i32 1, i32* @b, align 4
+; CHECK-NEXT:    store i32 1, ptr @b, align 4
 ; CHECK-NEXT:    br label [[FOR_COND2_LOOPEXIT_US]]
 ; CHECK:       for.cond2.for.inc13_crit_edge.us-lcssa.us.us-lcssa:
 ; CHECK-NEXT:    br label [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA_US]]
@@ -93,7 +93,7 @@ define void @f() {
 ; CHECK:       cond.false.us4:
 ; CHECK-NEXT:    br label [[COND_END_US5]]
 ; CHECK:       cond.end.us5:
-; CHECK-NEXT:    [[TMP8:%.*]] = load i32, i32* @b, align 4
+; CHECK-NEXT:    [[TMP8:%.*]] = load i32, ptr @b, align 4
 ; CHECK-NEXT:    [[CMP91_US7:%.*]] = icmp slt i32 [[TMP8]], 1
 ; CHECK-NEXT:    br i1 [[CMP91_US7]], label [[FOR_INC_LR_PH_US12:%.*]], label [[FOR_COND2_LOOPEXIT_US11:%.*]]
 ; CHECK:       for.inc.us8:
@@ -106,14 +106,14 @@ define void @f() {
 ; CHECK:       for.inc.lr.ph.us12:
 ; CHECK-NEXT:    br label [[FOR_INC_US8]]
 ; CHECK:       for.cond8.for.cond2.loopexit_crit_edge.us13:
-; CHECK-NEXT:    store i32 1, i32* @b, align 4
+; CHECK-NEXT:    store i32 1, ptr @b, align 4
 ; CHECK-NEXT:    br label [[FOR_COND2_LOOPEXIT_US11]]
 ; CHECK:       for.cond2.for.inc13_crit_edge.us-lcssa.us-lcssa.us:
 ; CHECK-NEXT:    br label [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA:%.*]]
 ; CHECK:       for.body3.lr.ph.split.split:
 ; CHECK-NEXT:    br label [[FOR_BODY3:%.*]]
 ; CHECK:       for.cond8.for.cond2.loopexit_crit_edge:
-; CHECK-NEXT:    store i32 1, i32* @b, align 4
+; CHECK-NEXT:    store i32 1, ptr @b, align 4
 ; CHECK-NEXT:    br label [[FOR_COND2_LOOPEXIT:%.*]]
 ; CHECK:       for.cond2.loopexit:
 ; CHECK-NEXT:    br i1 false, label [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA_US_LCSSA:%.*]], label [[FOR_BODY3]]
@@ -122,7 +122,7 @@ define void @f() {
 ; CHECK:       cond.false:
 ; CHECK-NEXT:    br label [[COND_END]]
 ; CHECK:       cond.end:
-; CHECK-NEXT:    [[TMP10:%.*]] = load i32, i32* @b, align 4
+; CHECK-NEXT:    [[TMP10:%.*]] = load i32, ptr @b, align 4
 ; CHECK-NEXT:    [[CMP91:%.*]] = icmp slt i32 [[TMP10]], 1
 ; CHECK-NEXT:    br i1 [[CMP91]], label [[FOR_INC_LR_PH:%.*]], label [[FOR_COND2_LOOPEXIT]]
 ; CHECK:       for.inc.lr.ph:
@@ -139,7 +139,7 @@ define void @f() {
 ; CHECK-NEXT:    br label [[FOR_COND2_FOR_INC13_CRIT_EDGE]]
 ; CHECK:       for.cond2.for.inc13_crit_edge:
 ; CHECK-NEXT:    [[COND_LCSSA:%.*]] = phi i32 [ [[COND_LCSSA_PH]], [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA]] ], [ [[COND_LCSSA_PH_US]], [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA_US]] ]
-; CHECK-NEXT:    store i32 [[COND_LCSSA]], i32* @c, align 4
+; CHECK-NEXT:    store i32 [[COND_LCSSA]], ptr @c, align 4
 ; CHECK-NEXT:    br label [[FOR_INC13]]
 ; CHECK:       for.inc13:
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i32 [[INDVARS_IV]], 1
@@ -151,9 +151,9 @@ define void @f() {
 
 ; br i1 {{.*}}, label %[[for_inc13]], label %
 entry:
-  %0 = load i32, i32* @a, align 4
+  %0 = load i32, ptr @a, align 4
   %tobool2 = icmp eq i32 %0, 0
-  %1 = load i32, i32* @a, align 4
+  %1 = load i32, ptr @a, align 4
   %tobool = icmp eq i32 %1, 0
   br label %for.cond2.preheader
 
@@ -189,7 +189,7 @@ cond.false.us.us:                                 ; preds = %for.body3.us.us
 
 cond.end.us.us:                                   ; preds = %cond.false.us.us, %for.body3.us.us
   %cond.us.us = phi i32 [ %div, %cond.false.us.us ], [ %conv7, %for.body3.us.us ]
-  %4 = load i32, i32* @b, align 4
+  %4 = load i32, ptr @b, align 4
   %cmp91.us.us = icmp slt i32 %4, 1
   br i1 %cmp91.us.us, label %for.inc.lr.ph.us.us, label %for.cond2.loopexit.us.us
 
@@ -201,7 +201,7 @@ for.inc.lr.ph.us.us:                              ; preds = %cond.end.us.us
 
 for.cond8.for.cond2.loopexit_crit_edge.us.us:     ; preds = %for.inc.us.us
   %inc.lcssa.us.us = phi i32 [ %inc.us.us, %for.inc.us.us ]
-  store i32 %inc.lcssa.us.us, i32* @b, align 4
+  store i32 %inc.lcssa.us.us, ptr @b, align 4
   br label %for.cond2.loopexit.us.us
 
 for.inc.us.us:                                    ; preds = %for.inc.us.us, %for.inc.lr.ph.us.us
@@ -225,7 +225,7 @@ cond.false.us:                                    ; preds = %for.body3.us
 
 cond.end.us:                                      ; preds = %cond.false.us, %for.body3.us
   %cond.us = phi i32 [ %div, %cond.false.us ], [ %conv7, %for.body3.us ]
-  %6 = load i32, i32* @b, align 4
+  %6 = load i32, ptr @b, align 4
   %cmp91.us = icmp slt i32 %6, 1
   br i1 %cmp91.us, label %for.inc.lr.ph.us, label %for.cond2.loopexit.us
 
@@ -243,7 +243,7 @@ for.inc.lr.ph.us:                                 ; preds = %cond.end.us
 
 for.cond8.for.cond2.loopexit_crit_edge.us:        ; preds = %for.inc.us
   %inc.lcssa.us = phi i32 [ %inc.us, %for.inc.us ]
-  store i32 %inc.lcssa.us, i32* @b, align 4
+  store i32 %inc.lcssa.us, ptr @b, align 4
   br label %for.cond2.loopexit.us
 
 for.cond2.for.inc13_crit_edge.us-lcssa.us.us-lcssa: ; preds = %for.cond2.loopexit.us
@@ -271,7 +271,7 @@ cond.false.us4:                                   ; preds = %for.body3.us3
 
 cond.end.us5:                                     ; preds = %cond.false.us4, %for.body3.us3
   %cond.us6 = phi i32 [ %div, %cond.false.us4 ], [ %conv7, %for.body3.us3 ]
-  %8 = load i32, i32* @b, align 4
+  %8 = load i32, ptr @b, align 4
   %cmp91.us7 = icmp slt i32 %8, 1
   br i1 %cmp91.us7, label %for.inc.lr.ph.us12, label %for.cond2.loopexit.us11
 
@@ -289,7 +289,7 @@ for.inc.lr.ph.us12:                               ; preds = %cond.end.us5
 
 for.cond8.for.cond2.loopexit_crit_edge.us13:      ; preds = %for.inc.us8
   %inc.lcssa.us14 = phi i32 [ %inc.us9, %for.inc.us8 ]
-  store i32 %inc.lcssa.us14, i32* @b, align 4
+  store i32 %inc.lcssa.us14, ptr @b, align 4
   br label %for.cond2.loopexit.us11
 
 for.cond2.for.inc13_crit_edge.us-lcssa.us-lcssa.us: ; preds = %for.cond2.loopexit.us11
@@ -301,7 +301,7 @@ for.body3.lr.ph.split.split:                      ; preds = %for.body3.lr.ph.spl
 
 for.cond8.for.cond2.loopexit_crit_edge:           ; preds = %for.inc
   %inc.lcssa = phi i32 [ %inc, %for.inc ]
-  store i32 %inc.lcssa, i32* @b, align 4
+  store i32 %inc.lcssa, ptr @b, align 4
   br label %for.cond2.loopexit
 
 for.cond2.loopexit:                               ; preds = %cond.end, %for.cond8.for.cond2.loopexit_crit_edge
@@ -315,7 +315,7 @@ cond.false:                                       ; preds = %for.body3
 
 cond.end:                                         ; preds = %cond.false, %for.body3
   %cond = phi i32 [ %div, %cond.false ], [ %conv7, %for.body3 ]
-  %10 = load i32, i32* @b, align 4
+  %10 = load i32, ptr @b, align 4
   %cmp91 = icmp slt i32 %10, 1
   br i1 %cmp91, label %for.inc.lr.ph, label %for.cond2.loopexit
 
@@ -338,7 +338,7 @@ for.cond2.for.inc13_crit_edge.us-lcssa:           ; preds = %for.cond2.for.inc13
 
 for.cond2.for.inc13_crit_edge:                    ; preds = %for.cond2.for.inc13_crit_edge.us-lcssa, %for.cond2.for.inc13_crit_edge.us-lcssa.us
   %cond.lcssa = phi i32 [ %cond.lcssa.ph, %for.cond2.for.inc13_crit_edge.us-lcssa ], [ %cond.lcssa.ph.us, %for.cond2.for.inc13_crit_edge.us-lcssa.us ]
-  store i32 %cond.lcssa, i32* @c, align 4
+  store i32 %cond.lcssa, ptr @c, align 4
   br label %for.inc13
 
 for.inc13:                                        ; preds = %for.cond2.for.inc13_crit_edge, %for.cond2.preheader

diff  --git a/llvm/test/Transforms/IndVarSimplify/lftr-pr41998.ll b/llvm/test/Transforms/IndVarSimplify/lftr-pr41998.ll
index 2974e7197b7a6..b7f4756b2757f 100644
--- a/llvm/test/Transforms/IndVarSimplify/lftr-pr41998.ll
+++ b/llvm/test/Transforms/IndVarSimplify/lftr-pr41998.ll
@@ -3,7 +3,7 @@
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 
-define void @test_int(i32 %start, i32* %p) {
+define void @test_int(i32 %start, ptr %p) {
 ; CHECK-LABEL: @test_int(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = trunc i32 [[START:%.*]] to i3
@@ -12,7 +12,7 @@ define void @test_int(i32 %start, i32* %p) {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I2:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I2_INC:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I2_INC]] = add nuw nsw i32 [[I2]], 1
-; CHECK-NEXT:    store volatile i32 [[I2_INC]], i32* [[P:%.*]]
+; CHECK-NEXT:    store volatile i32 [[I2_INC]], ptr [[P:%.*]], align 4
 ; CHECK-NEXT:    [[LFTR_WIDEIV:%.*]] = trunc i32 [[I2_INC]] to i3
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i3 [[LFTR_WIDEIV]], [[TMP1]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[END:%.*]], label [[LOOP]]
@@ -27,7 +27,7 @@ loop:
   %i2 = phi i32 [ 0, %entry ], [ %i2.inc, %loop ]
   %i.inc = add nuw i32 %i, 1
   %i2.inc = add nuw i32 %i2, 1
-  store volatile i32 %i2.inc, i32* %p
+  store volatile i32 %i2.inc, ptr %p
   %and = and i32 %i.inc, 7
   %cmp = icmp eq i32 %and, 0
   br i1 %cmp, label %end, label %loop
@@ -45,13 +45,13 @@ define void @test_ptr(i32 %start) {
 ; CHECK-NEXT:    [[TMP1:%.*]] = sub i3 -1, [[TMP0]]
 ; CHECK-NEXT:    [[TMP2:%.*]] = zext i3 [[TMP1]] to i64
 ; CHECK-NEXT:    [[TMP3:%.*]] = add nuw nsw i64 [[TMP2]], 1
-; CHECK-NEXT:    [[SCEVGEP:%.*]] = getelementptr [256 x i8], [256 x i8]* @data, i64 0, i64 [[TMP3]]
+; CHECK-NEXT:    [[UGLYGEP:%.*]] = getelementptr i8, ptr @data, i64 [[TMP3]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
-; CHECK-NEXT:    [[P:%.*]] = phi i8* [ getelementptr inbounds ([256 x i8], [256 x i8]* @data, i64 0, i64 0), [[ENTRY:%.*]] ], [ [[P_INC:%.*]], [[LOOP]] ]
-; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i8, i8* [[P]], i64 1
-; CHECK-NEXT:    store volatile i8 0, i8* [[P_INC]]
-; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i8* [[P_INC]], [[SCEVGEP]]
+; CHECK-NEXT:    [[P:%.*]] = phi ptr [ @data, [[ENTRY:%.*]] ], [ [[P_INC:%.*]], [[LOOP]] ]
+; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i8, ptr [[P]], i64 1
+; CHECK-NEXT:    store volatile i8 0, ptr [[P_INC]], align 1
+; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq ptr [[P_INC]], [[UGLYGEP]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[END:%.*]], label [[LOOP]]
 ; CHECK:       end:
 ; CHECK-NEXT:    ret void
@@ -61,10 +61,10 @@ entry:
 
 loop:
   %i = phi i32 [ %start, %entry ], [ %i.inc, %loop ]
-  %p = phi i8* [ getelementptr inbounds ([256 x i8], [256 x i8]* @data, i64 0, i64 0), %entry ], [ %p.inc, %loop ]
+  %p = phi ptr [ @data, %entry ], [ %p.inc, %loop ]
   %i.inc = add nuw i32 %i, 1
-  %p.inc = getelementptr inbounds i8, i8* %p, i64 1
-  store volatile i8 0, i8* %p.inc
+  %p.inc = getelementptr inbounds i8, ptr %p, i64 1
+  store volatile i8 0, ptr %p.inc
   %and = and i32 %i.inc, 7
   %cmp = icmp eq i32 %and, 0
   br i1 %cmp, label %end, label %loop

diff  --git a/llvm/test/Transforms/IndVarSimplify/lftr-promote.ll b/llvm/test/Transforms/IndVarSimplify/lftr-promote.ll
index f537cde99a157..037662db9baca 100644
--- a/llvm/test/Transforms/IndVarSimplify/lftr-promote.ll
+++ b/llvm/test/Transforms/IndVarSimplify/lftr-promote.ll
@@ -7,7 +7,7 @@
 
 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"
 
-define void @foo(double* %p, i32 %n) nounwind {
+define void @foo(ptr %p, i32 %n) nounwind {
 ; CHECK-LABEL: @foo(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[TMP0:%.*]] = icmp sgt i32 [[N:%.*]], 0
@@ -17,12 +17,12 @@ define void @foo(double* %p, i32 %n) nounwind {
 ; CHECK:       bb2:
 ; CHECK-NEXT:    [[I_01:%.*]] = phi i32 [ [[TMP7:%.*]], [[BB3:%.*]] ], [ 0, [[BB_NPH]] ]
 ; CHECK-NEXT:    [[TMP1:%.*]] = sext i32 [[I_01]] to i64
-; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr double, double* [[P:%.*]], i64 [[TMP1]]
-; CHECK-NEXT:    [[TMP3:%.*]] = load double, double* [[TMP2]], align 8
+; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr double, ptr [[P:%.*]], i64 [[TMP1]]
+; CHECK-NEXT:    [[TMP3:%.*]] = load double, ptr [[TMP2]], align 8
 ; CHECK-NEXT:    [[TMP4:%.*]] = fmul double [[TMP3]], 1.100000e+00
 ; CHECK-NEXT:    [[TMP5:%.*]] = sext i32 [[I_01]] to i64
-; CHECK-NEXT:    [[TMP6:%.*]] = getelementptr double, double* [[P]], i64 [[TMP5]]
-; CHECK-NEXT:    store double [[TMP4]], double* [[TMP6]], align 8
+; CHECK-NEXT:    [[TMP6:%.*]] = getelementptr double, ptr [[P]], i64 [[TMP5]]
+; CHECK-NEXT:    store double [[TMP4]], ptr [[TMP6]], align 8
 ; CHECK-NEXT:    [[TMP7]] = add nuw nsw i32 [[I_01]], 1
 ; CHECK-NEXT:    br label [[BB3]]
 ; CHECK:       bb3:
@@ -44,12 +44,12 @@ bb.nph:		; preds = %entry
 bb2:		; preds = %bb3, %bb.nph
   %i.01 = phi i32 [ %7, %bb3 ], [ 0, %bb.nph ]
   %1 = sext i32 %i.01 to i64
-  %2 = getelementptr double, double* %p, i64 %1
-  %3 = load double, double* %2, align 8
+  %2 = getelementptr double, ptr %p, i64 %1
+  %3 = load double, ptr %2, align 8
   %4 = fmul double %3, 1.100000e+00
   %5 = sext i32 %i.01 to i64
-  %6 = getelementptr double, double* %p, i64 %5
-  store double %4, double* %6, align 8
+  %6 = getelementptr double, ptr %p, i64 %5
+  store double %4, ptr %6, align 8
   %7 = add i32 %i.01, 1
   br label %bb3
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/lftr_disabled.ll b/llvm/test/Transforms/IndVarSimplify/lftr_disabled.ll
index 952b5d0ae7a12..5bb570a987919 100644
--- a/llvm/test/Transforms/IndVarSimplify/lftr_disabled.ll
+++ b/llvm/test/Transforms/IndVarSimplify/lftr_disabled.ll
@@ -16,7 +16,7 @@ define i32 @quadratic_setlt() {
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 7, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
 ; CHECK-NEXT:    [[I_NEXT]] = add nuw nsw i32 [[I]], 1
-; CHECK-NEXT:    store i32 [[I]], i32* @A
+; CHECK-NEXT:    store i32 [[I]], ptr @A
 ; CHECK-NEXT:    [[I2:%.*]] = mul i32 [[I]], [[I]]
 ; CHECK-NEXT:    [[C:%.*]] = icmp slt i32 [[I2]], 1000
 ; CHECK-NEXT:    br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
@@ -29,7 +29,7 @@ entry:
 loop:
   %i = phi i32 [ 7, %entry ], [ %i.next, %loop ]
   %i.next = add i32 %i, 1
-  store i32 %i, i32* @A
+  store i32 %i, ptr @A
   %i2 = mul i32 %i, %i
   %c = icmp slt i32 %i2, 1000
   br i1 %c, label %loop, label %loopexit

diff  --git a/llvm/test/Transforms/IndVarSimplify/loop_evaluate7.ll b/llvm/test/Transforms/IndVarSimplify/loop_evaluate7.ll
index 81070258662a6..4385876cc767a 100644
--- a/llvm/test/Transforms/IndVarSimplify/loop_evaluate7.ll
+++ b/llvm/test/Transforms/IndVarSimplify/loop_evaluate7.ll
@@ -4,7 +4,7 @@
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
 target triple = "i386-pc-linux-gnu"
 
-define i8* @string_expandtabs(i32 %n, i8* %m) nounwind {
+define ptr @string_expandtabs(i32 %n, ptr %m) nounwind {
 entry:
 	br i1 undef, label %bb33, label %bb1
 
@@ -21,27 +21,27 @@ bb19:		; preds = %bb30
 	br i1 undef, label %bb20, label %bb29
 
 bb20:		; preds = %bb19
-	%0 = load i32, i32* undef, align 4		; <i32> [#uses=1]
+	%0 = load i32, ptr undef, align 4		; <i32> [#uses=1]
 	%1 = sub i32 %0, %n		; <i32> [#uses=1]
 	br label %bb23
 
 bb21:		; preds = %bb23
-	%2 = icmp ult i8* %q.0, %m		; <i1> [#uses=1]
+	%2 = icmp ult ptr %q.0, %m		; <i1> [#uses=1]
 	br i1 %2, label %bb22, label %overflow2
 
 bb22:		; preds = %bb21
-	%3 = getelementptr i8, i8* %q.0, i32 1		; <i8*> [#uses=1]
+	%3 = getelementptr i8, ptr %q.0, i32 1		; <ptr> [#uses=1]
 	br label %bb23
 
 bb23:		; preds = %bb22, %bb20
 	%i.2 = phi i32 [ %1, %bb20 ], [ %4, %bb22 ]		; <i32> [#uses=1]
-	%q.0 = phi i8* [ undef, %bb20 ], [ %3, %bb22 ]		; <i8*> [#uses=3]
+	%q.0 = phi ptr [ undef, %bb20 ], [ %3, %bb22 ]		; <ptr> [#uses=3]
 	%4 = add i32 %i.2, -1		; <i32> [#uses=2]
 	%5 = icmp eq i32 %4, -1		; <i1> [#uses=1]
 	br i1 %5, label %bb29, label %bb21
 
 bb29:		; preds = %bb23, %bb19
-	%q.1 = phi i8* [ undef, %bb19 ], [ %q.0, %bb23 ]		; <i8*> [#uses=0]
+	%q.1 = phi ptr [ undef, %bb19 ], [ %q.0, %bb23 ]		; <ptr> [#uses=0]
 	br label %bb30
 
 bb30:		; preds = %bb29, %bb17
@@ -54,8 +54,8 @@ bb32:		; preds = %overflow2
 	br label %overflow1
 
 overflow1:		; preds = %bb32, %overflow2, %bb1
-	ret i8* null
+	ret ptr null
 
 bb33:		; preds = %bb30, %bb15, %entry
-	ret i8* undef
+	ret ptr undef
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/loop_evaluate8.ll b/llvm/test/Transforms/IndVarSimplify/loop_evaluate8.ll
index 56bf6cb26e7a5..e0a98e02b9a72 100644
--- a/llvm/test/Transforms/IndVarSimplify/loop_evaluate8.ll
+++ b/llvm/test/Transforms/IndVarSimplify/loop_evaluate8.ll
@@ -6,7 +6,7 @@
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
 target triple = "i386-pc-linux-gnu"
 
-define i8* @string_expandtabs() nounwind {
+define ptr @string_expandtabs() nounwind {
 ; CHECK-LABEL: @string_expandtabs(
 ; CHECK-NOT: select
 entry:
@@ -25,27 +25,27 @@ bb19:		; preds = %bb30
 	br i1 undef, label %bb20, label %bb29
 
 bb20:		; preds = %bb19
-	%0 = load i32, i32* undef, align 4		; <i32> [#uses=1]
+	%0 = load i32, ptr undef, align 4		; <i32> [#uses=1]
 	%1 = sub i32 %0, undef		; <i32> [#uses=1]
 	br label %bb23
 
 bb21:		; preds = %bb23
-	%2 = icmp ult i8* %q.0, undef		; <i1> [#uses=1]
+	%2 = icmp ult ptr %q.0, undef		; <i1> [#uses=1]
 	br i1 %2, label %bb22, label %overflow2
 
 bb22:		; preds = %bb21
-	%3 = getelementptr i8, i8* %q.0, i32 1		; <i8*> [#uses=1]
+	%3 = getelementptr i8, ptr %q.0, i32 1		; <ptr> [#uses=1]
 	br label %bb23
 
 bb23:		; preds = %bb22, %bb20
 	%i.2 = phi i32 [ %1, %bb20 ], [ %4, %bb22 ]		; <i32> [#uses=1]
-	%q.0 = phi i8* [ undef, %bb20 ], [ %3, %bb22 ]		; <i8*> [#uses=3]
+	%q.0 = phi ptr [ undef, %bb20 ], [ %3, %bb22 ]		; <ptr> [#uses=3]
 	%4 = add i32 %i.2, -1		; <i32> [#uses=2]
 	%5 = icmp eq i32 %4, -1		; <i1> [#uses=1]
 	br i1 %5, label %bb29, label %bb21
 
 bb29:		; preds = %bb23, %bb19
-	%q.1 = phi i8* [ undef, %bb19 ], [ %q.0, %bb23 ]		; <i8*> [#uses=0]
+	%q.1 = phi ptr [ undef, %bb19 ], [ %q.0, %bb23 ]		; <ptr> [#uses=0]
 	br label %bb30
 
 bb30:		; preds = %bb29, %bb17
@@ -58,8 +58,8 @@ bb32:		; preds = %overflow2
 	br label %overflow1
 
 overflow1:		; preds = %bb32, %overflow2, %bb1
-	ret i8* null
+	ret ptr null
 
 bb33:		; preds = %bb30, %bb15, %entry
-	ret i8* undef
+	ret ptr undef
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/loop_evaluate9.ll b/llvm/test/Transforms/IndVarSimplify/loop_evaluate9.ll
index 0f0356789aa35..8ed6fb332d46b 100644
--- a/llvm/test/Transforms/IndVarSimplify/loop_evaluate9.ll
+++ b/llvm/test/Transforms/IndVarSimplify/loop_evaluate9.ll
@@ -11,7 +11,7 @@
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
 target triple = "i386-pc-linux-gnu"
 	%struct.cc70a02__complex_integers__complex_type = type { i8, i8 }
- at .str = internal constant [13 x i8] c"fc70a00.adb\00\00", align 1		; <[13 x i8]*> [#uses=1]
+ at .str = internal constant [13 x i8] c"fc70a00.adb\00\00", align 1		; <ptr> [#uses=1]
 
 define void @_ada_cc70a02() {
 ; CHECK-LABEL: @_ada_cc70a02(
@@ -30,7 +30,7 @@ bb1.i:		; preds = %bb2.i, %entry
 	br i1 %tmp1, label %bb.i.i, label %bb1.i.i
 
 bb.i.i:		; preds = %bb1.i
-	tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn
+	tail call void @__gnat_rcheck_12(ptr @.str, i32 24) noreturn
 	unreachable
 
 bb1.i.i:		; preds = %bb1.i
@@ -41,7 +41,7 @@ bb1.i.i:		; preds = %bb1.i
 	br i1 %tmp3, label %bb2.i.i, label %cc70a02__complex_integers__Oadd.153.exit.i
 
 bb2.i.i:		; preds = %bb1.i.i
-	tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn
+	tail call void @__gnat_rcheck_12(ptr @.str, i32 24) noreturn
 	unreachable
 
 cc70a02__complex_integers__Oadd.153.exit.i:		; preds = %bb1.i.i
@@ -72,14 +72,14 @@ return:		; preds = %cc70a02__complex_multiplication.170.exit
 	ret void
 }
 
-declare fastcc void @cc70a02__complex_integers__complex.164(%struct.cc70a02__complex_integers__complex_type* noalias nocapture sret(%struct.cc70a02__complex_integers__complex_type), i8 signext, i8 signext) nounwind
+declare fastcc void @cc70a02__complex_integers__complex.164(ptr noalias nocapture sret(%struct.cc70a02__complex_integers__complex_type), i8 signext, i8 signext) nounwind
 
-declare fastcc void @cc70a02__complex_integers__Osubtract.149(%struct.cc70a02__complex_integers__complex_type* noalias sret(%struct.cc70a02__complex_integers__complex_type), %struct.cc70a02__complex_integers__complex_type* byval(%struct.cc70a02__complex_integers__complex_type) align 4)
+declare fastcc void @cc70a02__complex_integers__Osubtract.149(ptr noalias sret(%struct.cc70a02__complex_integers__complex_type), ptr byval(%struct.cc70a02__complex_integers__complex_type) align 4)
 
-declare fastcc void @cc70a02__complex_integers__Oadd.153(%struct.cc70a02__complex_integers__complex_type* noalias sret(%struct.cc70a02__complex_integers__complex_type), %struct.cc70a02__complex_integers__complex_type* byval(%struct.cc70a02__complex_integers__complex_type) align 4, %struct.cc70a02__complex_integers__complex_type* byval(%struct.cc70a02__complex_integers__complex_type) align 4)
+declare fastcc void @cc70a02__complex_integers__Oadd.153(ptr noalias sret(%struct.cc70a02__complex_integers__complex_type), ptr byval(%struct.cc70a02__complex_integers__complex_type) align 4, ptr byval(%struct.cc70a02__complex_integers__complex_type) align 4)
 
-declare fastcc void @cc70a02__complex_multiplication.170(%struct.cc70a02__complex_integers__complex_type* noalias sret(%struct.cc70a02__complex_integers__complex_type), %struct.cc70a02__complex_integers__complex_type* byval(%struct.cc70a02__complex_integers__complex_type) align 4)
+declare fastcc void @cc70a02__complex_multiplication.170(ptr noalias sret(%struct.cc70a02__complex_integers__complex_type), ptr byval(%struct.cc70a02__complex_integers__complex_type) align 4)
 
-declare void @__gnat_rcheck_12(i8*, i32) noreturn
+declare void @__gnat_rcheck_12(ptr, i32) noreturn
 
 declare void @exit(i32)

diff  --git a/llvm/test/Transforms/IndVarSimplify/lrev-existing-umin.ll b/llvm/test/Transforms/IndVarSimplify/lrev-existing-umin.ll
index 149d68217c9b1..305ecb9ffe756 100644
--- a/llvm/test/Transforms/IndVarSimplify/lrev-existing-umin.ll
+++ b/llvm/test/Transforms/IndVarSimplify/lrev-existing-umin.ll
@@ -3,7 +3,7 @@
 
 ; Do not rewrite the user outside the loop because we must keep the instruction
 ; inside the loop due to store. Rewrite doesn't give us any profit.
-define void @f(i32 %length.i.88, i32 %length.i, i8* %tmp12, i32 %tmp10, i8* %tmp8) {
+define void @f(i32 %length.i.88, i32 %length.i, ptr %tmp12, i32 %tmp10, ptr %tmp8) {
 ; CHECK-LABEL: @f(
 ; CHECK-NEXT:  not_zero11.preheader:
 ; CHECK-NEXT:    [[TMP13:%.*]] = icmp ugt i32 [[LENGTH_I:%.*]], [[LENGTH_I_88:%.*]]
@@ -15,13 +15,13 @@ define void @f(i32 %length.i.88, i32 %length.i, i8* %tmp12, i32 %tmp10, i8* %tmp
 ; CHECK:       not_zero11:
 ; CHECK-NEXT:    [[V_1:%.*]] = phi i32 [ [[TMP22:%.*]], [[NOT_ZERO11]] ], [ 0, [[NOT_ZERO11_PREHEADER1]] ]
 ; CHECK-NEXT:    [[TMP16:%.*]] = zext i32 [[V_1]] to i64
-; CHECK-NEXT:    [[TMP17:%.*]] = getelementptr inbounds i8, i8* [[TMP8:%.*]], i64 [[TMP16]]
-; CHECK-NEXT:    [[TMP18:%.*]] = load i8, i8* [[TMP17]], align 1
+; CHECK-NEXT:    [[TMP17:%.*]] = getelementptr inbounds i8, ptr [[TMP8:%.*]], i64 [[TMP16]]
+; CHECK-NEXT:    [[TMP18:%.*]] = load i8, ptr [[TMP17]], align 1
 ; CHECK-NEXT:    [[TMP19:%.*]] = zext i8 [[TMP18]] to i32
 ; CHECK-NEXT:    [[TMP20:%.*]] = or i32 [[TMP19]], [[TMP10:%.*]]
 ; CHECK-NEXT:    [[TMP21:%.*]] = trunc i32 [[TMP20]] to i8
-; CHECK-NEXT:    [[ADDR22:%.*]] = getelementptr inbounds i8, i8* [[TMP12:%.*]], i64 [[TMP16]]
-; CHECK-NEXT:    store i8 [[TMP21]], i8* [[ADDR22]], align 1
+; CHECK-NEXT:    [[ADDR22:%.*]] = getelementptr inbounds i8, ptr [[TMP12:%.*]], i64 [[TMP16]]
+; CHECK-NEXT:    store i8 [[TMP21]], ptr [[ADDR22]], align 1
 ; CHECK-NEXT:    [[TMP22]] = add nuw nsw i32 [[V_1]], 1
 ; CHECK-NEXT:    [[TMP23:%.*]] = icmp slt i32 [[TMP22]], [[TMP14]]
 ; CHECK-NEXT:    br i1 [[TMP23]], label [[NOT_ZERO11]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -43,13 +43,13 @@ not_zero11.preheader:
 not_zero11:
   %v_1 = phi i32 [ %tmp22, %not_zero11 ], [ 0, %not_zero11.preheader ]
   %tmp16 = zext i32 %v_1 to i64
-  %tmp17 = getelementptr inbounds i8, i8* %tmp8, i64 %tmp16
-  %tmp18 = load i8, i8* %tmp17, align 1
+  %tmp17 = getelementptr inbounds i8, ptr %tmp8, i64 %tmp16
+  %tmp18 = load i8, ptr %tmp17, align 1
   %tmp19 = zext i8 %tmp18 to i32
   %tmp20 = or i32 %tmp19, %tmp10
   %tmp21 = trunc i32 %tmp20 to i8
-  %addr22 = getelementptr inbounds i8, i8* %tmp12, i64 %tmp16
-  store i8 %tmp21, i8* %addr22, align 1
+  %addr22 = getelementptr inbounds i8, ptr %tmp12, i64 %tmp16
+  store i8 %tmp21, ptr %addr22, align 1
   %tmp22 = add nuw nsw i32 %v_1, 1
   %tmp23 = icmp slt i32 %tmp22, %tmp14
   br i1 %tmp23, label %not_zero11, label %main.exit.selector
@@ -66,7 +66,7 @@ not_zero11.postloop:
 }
 
 ; Rewrite the user outside the loop because there is no hard users inside the loop.
-define void @f1(i32 %length.i.88, i32 %length.i, i8* %tmp12, i32 %tmp10, i8* %tmp8) {
+define void @f1(i32 %length.i.88, i32 %length.i, ptr %tmp12, i32 %tmp10, ptr %tmp8) {
 ; CHECK-LABEL: @f1(
 ; CHECK-NEXT:  not_zero11.preheader:
 ; CHECK-NEXT:    [[TMP13:%.*]] = icmp ugt i32 [[LENGTH_I:%.*]], [[LENGTH_I_88:%.*]]
@@ -78,12 +78,12 @@ define void @f1(i32 %length.i.88, i32 %length.i, i8* %tmp12, i32 %tmp10, i8* %tm
 ; CHECK:       not_zero11:
 ; CHECK-NEXT:    [[V_1:%.*]] = phi i32 [ [[TMP22:%.*]], [[NOT_ZERO11]] ], [ 0, [[NOT_ZERO11_PREHEADER1]] ]
 ; CHECK-NEXT:    [[TMP16:%.*]] = zext i32 [[V_1]] to i64
-; CHECK-NEXT:    [[TMP17:%.*]] = getelementptr inbounds i8, i8* [[TMP8:%.*]], i64 [[TMP16]]
-; CHECK-NEXT:    [[TMP18:%.*]] = load i8, i8* [[TMP17]], align 1
+; CHECK-NEXT:    [[TMP17:%.*]] = getelementptr inbounds i8, ptr [[TMP8:%.*]], i64 [[TMP16]]
+; CHECK-NEXT:    [[TMP18:%.*]] = load i8, ptr [[TMP17]], align 1
 ; CHECK-NEXT:    [[TMP19:%.*]] = zext i8 [[TMP18]] to i32
 ; CHECK-NEXT:    [[TMP20:%.*]] = or i32 [[TMP19]], [[TMP10:%.*]]
 ; CHECK-NEXT:    [[TMP21:%.*]] = trunc i32 [[TMP20]] to i8
-; CHECK-NEXT:    [[ADDR22:%.*]] = getelementptr inbounds i8, i8* [[TMP12:%.*]], i64 [[TMP16]]
+; CHECK-NEXT:    [[ADDR22:%.*]] = getelementptr inbounds i8, ptr [[TMP12:%.*]], i64 [[TMP16]]
 ; CHECK-NEXT:    [[TMP22]] = add nuw nsw i32 [[V_1]], 1
 ; CHECK-NEXT:    br i1 false, label [[NOT_ZERO11]], label [[MAIN_EXIT_SELECTOR:%.*]]
 ; CHECK:       main.exit.selector:
@@ -103,12 +103,12 @@ not_zero11.preheader:
 not_zero11:
   %v_1 = phi i32 [ %tmp22, %not_zero11 ], [ 0, %not_zero11.preheader ]
   %tmp16 = zext i32 %v_1 to i64
-  %tmp17 = getelementptr inbounds i8, i8* %tmp8, i64 %tmp16
-  %tmp18 = load i8, i8* %tmp17, align 1
+  %tmp17 = getelementptr inbounds i8, ptr %tmp8, i64 %tmp16
+  %tmp18 = load i8, ptr %tmp17, align 1
   %tmp19 = zext i8 %tmp18 to i32
   %tmp20 = or i32 %tmp19, %tmp10
   %tmp21 = trunc i32 %tmp20 to i8
-  %addr22 = getelementptr inbounds i8, i8* %tmp12, i64 %tmp16
+  %addr22 = getelementptr inbounds i8, ptr %tmp12, i64 %tmp16
   %tmp22 = add nuw nsw i32 %v_1, 1
   %tmp23 = icmp slt i32 %tmp22, %tmp14
   br i1 %tmp23, label %not_zero11, label %main.exit.selector

diff  --git a/llvm/test/Transforms/IndVarSimplify/masked-iv.ll b/llvm/test/Transforms/IndVarSimplify/masked-iv.ll
index 87064873c4950..d66a2a47a7f26 100644
--- a/llvm/test/Transforms/IndVarSimplify/masked-iv.ll
+++ b/llvm/test/Transforms/IndVarSimplify/masked-iv.ll
@@ -3,7 +3,7 @@
 ; Indvars should do the IV arithmetic in the canonical IV type (i64),
 ; and only use one truncation.
 
-define void @foo(i64* %A, i64* %B, i64 %n, i64 %a, i64 %s) nounwind {
+define void @foo(ptr %A, ptr %B, i64 %n, i64 %a, i64 %s) nounwind {
 ; CHECK-LABEL: @foo(
 ; CHECK-NOT: trunc
 ; CHECK: and
@@ -18,8 +18,8 @@ bb.preheader:		; preds = %entry
 bb:		; preds = %bb, %bb.preheader
 	%i.01 = phi i64 [ %t6, %bb ], [ %a, %bb.preheader ]		; <i64> [#uses=3]
 	%t1 = and i64 %i.01, 255		; <i64> [#uses=1]
-	%t2 = getelementptr i64, i64* %A, i64 %t1		; <i64*> [#uses=1]
-	store i64 %i.01, i64* %t2, align 8
+	%t2 = getelementptr i64, ptr %A, i64 %t1		; <ptr> [#uses=1]
+	store i64 %i.01, ptr %t2, align 8
 	%t6 = add i64 %i.01, %s		; <i64> [#uses=1]
 	br label %bb
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/monotonic_checks.ll b/llvm/test/Transforms/IndVarSimplify/monotonic_checks.ll
index 7e7731d3425dd..a1c07b0a24638 100644
--- a/llvm/test/Transforms/IndVarSimplify/monotonic_checks.ll
+++ b/llvm/test/Transforms/IndVarSimplify/monotonic_checks.ll
@@ -3,10 +3,10 @@
 
 ; Monotonic decrementing iv. we should be able to prove that %iv.next <s len
 ; basing on its nsw and the fact that its starting value <s len.
-define i32 @test_01(i32* %p) {
+define i32 @test_01(ptr %p) {
 ; CHECK-LABEL: @test_01(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, [[RNG0:!range !.*]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, [[RNG0:!range !.*]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ [[LEN]], [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ]
@@ -21,7 +21,7 @@ define i32 @test_01(i32* %p) {
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
-  %len = load i32, i32* %p, !range !0
+  %len = load i32, ptr %p, !range !0
   br label %loop
 
 loop:
@@ -42,10 +42,10 @@ exit:
 }
 
 ; We should not remove this range check because signed overflow is possible here (start at len = 0).
-define i32 @test_01_neg(i32* %p) {
+define i32 @test_01_neg(ptr %p) {
 ; CHECK-LABEL: @test_01_neg(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, [[RNG0]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, [[RNG0]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ [[LEN]], [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ]
@@ -61,7 +61,7 @@ define i32 @test_01_neg(i32* %p) {
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
-  %len = load i32, i32* %p, !range !0
+  %len = load i32, ptr %p, !range !0
   br label %loop
 
 loop:
@@ -83,10 +83,10 @@ exit:
 
 ; Monotonic incrementing iv. we should be able to prove that %iv.next >s len
 ; basing on its nsw and the fact that its starting value >s len.
-define i32 @test_02(i32* %p) {
+define i32 @test_02(ptr %p) {
 ; CHECK-LABEL: @test_02(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, [[RNG1:!range !.*]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, [[RNG1:!range !.*]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ [[LEN]], [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ]
@@ -101,7 +101,7 @@ define i32 @test_02(i32* %p) {
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
-  %len = load i32, i32* %p, !range !1
+  %len = load i32, ptr %p, !range !1
   br label %loop
 
 loop:
@@ -122,10 +122,10 @@ exit:
 }
 
 ; We should not remove this range check because signed overflow is possible here (start at len = -1).
-define i32 @test_02_neg(i32* %p) {
+define i32 @test_02_neg(ptr %p) {
 ; CHECK-LABEL: @test_02_neg(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, [[RNG1]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, [[RNG1]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ [[LEN]], [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ]
@@ -141,7 +141,7 @@ define i32 @test_02_neg(i32* %p) {
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
-  %len = load i32, i32* %p, !range !1
+  %len = load i32, ptr %p, !range !1
   br label %loop
 
 loop:
@@ -161,10 +161,10 @@ exit:
   ret i32 0
 }
 
-define i32 @test_03(i32* %p) {
+define i32 @test_03(ptr %p) {
 ; CHECK-LABEL: @test_03(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, [[RNG2:!range !.*]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, [[RNG2:!range !.*]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ [[LEN]], [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ]
@@ -179,7 +179,7 @@ define i32 @test_03(i32* %p) {
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
-  %len = load i32, i32* %p, !range !2
+  %len = load i32, ptr %p, !range !2
   br label %loop
 
 loop:
@@ -199,10 +199,10 @@ exit:
   ret i32 0
 }
 
-define i32 @test_04(i32* %p) {
+define i32 @test_04(ptr %p) {
 ; CHECK-LABEL: @test_04(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, [[RNG2]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, [[RNG2]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ [[LEN]], [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ]
@@ -217,7 +217,7 @@ define i32 @test_04(i32* %p) {
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
-  %len = load i32, i32* %p, !range !2
+  %len = load i32, ptr %p, !range !2
   br label %loop
 
 loop:

diff  --git a/llvm/test/Transforms/IndVarSimplify/negative_ranges.ll b/llvm/test/Transforms/IndVarSimplify/negative_ranges.ll
index 6a44180078489..b7c7457ff9c6b 100644
--- a/llvm/test/Transforms/IndVarSimplify/negative_ranges.ll
+++ b/llvm/test/Transforms/IndVarSimplify/negative_ranges.ll
@@ -3,11 +3,11 @@
 
 declare i1 @cond()
 
-define i32 @test_01(i32* %p, i32* %s) {
+define i32 @test_01(ptr %p, ptr %s) {
 ; CHECK-LABEL: @test_01(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[START:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0:![0-9]+]]
-; CHECK-NEXT:    [[END:%.*]] = load i32, i32* [[S:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[START:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT:    [[END:%.*]] = load i32, ptr [[S:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ [[START]], [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ]
@@ -25,8 +25,8 @@ define i32 @test_01(i32* %p, i32* %s) {
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
-  %start = load i32, i32* %p, !range !0
-  %end = load i32, i32* %s, !range !0
+  %start = load i32, ptr %p, !range !0
+  %end = load i32, ptr %s, !range !0
   br label %loop
 
 loop:
@@ -50,11 +50,11 @@ side_exit:
   ret i32 0
 }
 
-define i32 @test_02(i32* %p, i32* %s) {
+define i32 @test_02(ptr %p, ptr %s) {
 ; CHECK-LABEL: @test_02(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[START:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0]]
-; CHECK-NEXT:    [[END:%.*]] = load i32, i32* [[S:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[START:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[END:%.*]] = load i32, ptr [[S:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ [[START]], [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ]
@@ -72,8 +72,8 @@ define i32 @test_02(i32* %p, i32* %s) {
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
-  %start = load i32, i32* %p, !range !0
-  %end = load i32, i32* %s, !range !0
+  %start = load i32, ptr %p, !range !0
+  %end = load i32, ptr %s, !range !0
   br label %loop
 
 loop:

diff  --git a/llvm/test/Transforms/IndVarSimplify/outer_phi.ll b/llvm/test/Transforms/IndVarSimplify/outer_phi.ll
index 79ecf1665b8c7..03303fb431326 100644
--- a/llvm/test/Transforms/IndVarSimplify/outer_phi.ll
+++ b/llvm/test/Transforms/IndVarSimplify/outer_phi.ll
@@ -398,10 +398,10 @@ exit:
 
 ; Same as test_01, but non-negativity of %b is known without context.
 ; FIXME: We can remove 2nd check in loop.
-define i32 @test_05(i32 %a, i32* %bp) {
+define i32 @test_05(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_05(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG0:![0-9]+]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT_LCSSA:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -427,7 +427,7 @@ define i32 @test_05(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !0
+  %b = load i32, ptr %bp, !range !0
   br label %outer
 
 outer:
@@ -462,10 +462,10 @@ exit:
 
 
 ; Same as test_01a, but non-negativity of %b is known without context.
-define i32 @test_05a(i32 %a, i32* %bp) {
+define i32 @test_05a(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_05a(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT_LCSSA:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -490,7 +490,7 @@ define i32 @test_05a(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !0
+  %b = load i32, ptr %bp, !range !0
   br label %outer
 
 outer:
@@ -524,10 +524,10 @@ exit:
 }
 
 ; Similar to test_05a, but inverted 2nd condition.
-define i32 @test_05b(i32 %a, i32* %bp) {
+define i32 @test_05b(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_05b(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT_LCSSA:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -552,7 +552,7 @@ define i32 @test_05b(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !0
+  %b = load i32, ptr %bp, !range !0
   br label %outer
 
 outer:
@@ -586,10 +586,10 @@ exit:
 }
 
 ; We should prove implication: iv <s b, b <s 0 => iv <u b.
-define i32 @test_05c(i32 %a, i32* %bp) {
+define i32 @test_05c(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_05c(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG1:![0-9]+]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG1:![0-9]+]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT_LCSSA:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -614,7 +614,7 @@ define i32 @test_05c(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !1
+  %b = load i32, ptr %bp, !range !1
   br label %outer
 
 outer:
@@ -648,10 +648,10 @@ exit:
 }
 
 ; Same as test_05c, but 2nd condition reversed.
-define i32 @test_05d(i32 %a, i32* %bp) {
+define i32 @test_05d(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_05d(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG1]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG1]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT_LCSSA:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -676,7 +676,7 @@ define i32 @test_05d(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !1
+  %b = load i32, ptr %bp, !range !1
   br label %outer
 
 outer:
@@ -711,10 +711,10 @@ exit:
 
 
 ; Same as test_05a, but 1st condition inverted.
-define i32 @test_05e(i32 %a, i32* %bp) {
+define i32 @test_05e(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_05e(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT_LCSSA:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -739,7 +739,7 @@ define i32 @test_05e(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !0
+  %b = load i32, ptr %bp, !range !0
   br label %outer
 
 outer:
@@ -773,10 +773,10 @@ exit:
 }
 
 ; Same as test_05b, but 1st condition inverted.
-define i32 @test_05f(i32 %a, i32* %bp) {
+define i32 @test_05f(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_05f(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT_LCSSA:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -801,7 +801,7 @@ define i32 @test_05f(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !0
+  %b = load i32, ptr %bp, !range !0
   br label %outer
 
 outer:
@@ -835,10 +835,10 @@ exit:
 }
 
 ; Same as test_05c, but 1st condition inverted.
-define i32 @test_05g(i32 %a, i32* %bp) {
+define i32 @test_05g(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_05g(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG1]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG1]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT_LCSSA:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -863,7 +863,7 @@ define i32 @test_05g(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !1
+  %b = load i32, ptr %bp, !range !1
   br label %outer
 
 outer:
@@ -897,10 +897,10 @@ exit:
 }
 
 ; Same as test_05d, but 1st condition inverted.
-define i32 @test_05h(i32 %a, i32* %bp) {
+define i32 @test_05h(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_05h(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG1]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG1]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT_LCSSA:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -925,7 +925,7 @@ define i32 @test_05h(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !1
+  %b = load i32, ptr %bp, !range !1
   br label %outer
 
 outer:
@@ -960,10 +960,10 @@ exit:
 
 ; Same as test_02, but non-negativity of %b is known without context.
 ; FIXME: We can remove 2nd check in loop.
-define i32 @test_06(i32 %a, i32* %bp) {
+define i32 @test_06(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_06(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[OUTER_MERGE:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -989,7 +989,7 @@ define i32 @test_06(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !0
+  %b = load i32, ptr %bp, !range !0
   br label %outer
 
 outer:
@@ -1025,10 +1025,10 @@ exit:
 
 ; Same as test_03, but non-negativity of %b is known without context.
 ; FIXME: We can remove 2nd check in loop.
-define i32 @test_07(i32 %a, i32* %bp) {
+define i32 @test_07(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_07(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[OUTER_MERGE:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -1063,7 +1063,7 @@ define i32 @test_07(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !0
+  %b = load i32, ptr %bp, !range !0
   br label %outer
 
 outer:
@@ -1103,10 +1103,10 @@ exit:
 
 ; Same as test_04, but non-negativity of %b is known without context.
 ; FIXME: We can remove 2nd check in loop.
-define i32 @test_08(i32 %a, i32* %bp) {
+define i32 @test_08(i32 %a, ptr %bp) {
 ; CHECK-LABEL: @test_08(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[B:%.*]] = load i32, i32* [[BP:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[B:%.*]] = load i32, ptr [[BP:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    br label [[OUTER:%.*]]
 ; CHECK:       outer:
 ; CHECK-NEXT:    [[OUTER_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[OUTER_MERGE:%.*]], [[OUTER_BACKEDGE:%.*]] ]
@@ -1146,7 +1146,7 @@ define i32 @test_08(i32 %a, i32* %bp) {
 ; CHECK-NEXT:    ret i32 1
 ;
 entry:
-  %b = load i32, i32* %bp, !range !0
+  %b = load i32, ptr %bp, !range !0
   br label %outer
 
 outer:

diff  --git a/llvm/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll b/llvm/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll
index 1a51b8ced4f17..8ee01bfba1648 100644
--- a/llvm/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll
+++ b/llvm/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll
@@ -13,7 +13,7 @@ entry:
 	br label %bb38.i
 
 bb14.i27:
-	%t0 = load i64, i64* @ue, align 8
+	%t0 = load i64, ptr @ue, align 8
 	%t1 = sub i64 %t0, %i.0.i35
 	%t2 = add i64 %t1, 1
 	br i1 undef, label %bb15.i28, label %bb19.i31

diff  --git a/llvm/test/Transforms/IndVarSimplify/post-inc-range.ll b/llvm/test/Transforms/IndVarSimplify/post-inc-range.ll
index 2fdf0913a65a0..5c22ba1044b60 100644
--- a/llvm/test/Transforms/IndVarSimplify/post-inc-range.ll
+++ b/llvm/test/Transforms/IndVarSimplify/post-inc-range.ll
@@ -7,7 +7,7 @@ target datalayout = "p:64:64:64-n32:64"
 ; icmp slt i32 %i.inc, %limit
 ; In order to do this indvars need to prove that the narrow IV def (%i.inc)
 ; is not-negative from the range check inside of the loop.
-define void @test(i32* %base, i32 %limit, i32 %start) {
+define void @test(ptr %base, i32 %limit, i32 %start) {
 ; CHECK-LABEL: @test(
 ; CHECK-NEXT:  for.body.lr.ph:
 ; CHECK-NEXT:    [[UMAX:%.*]] = call i32 @llvm.umax.i32(i32 [[START:%.*]], i32 64)
@@ -43,8 +43,8 @@ for.body:
 
 continue:
   %i.i64 = zext i32 %i to i64
-  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
-  %val = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %base, i64 %i.i64
+  %val = load i32, ptr %arrayidx, align 4
   br label %for.inc
 
 for.inc:
@@ -59,7 +59,7 @@ exit:
   ret void
 }
 
-define void @test_false_edge(i32* %base, i32 %limit, i32 %start) {
+define void @test_false_edge(ptr %base, i32 %limit, i32 %start) {
 ; CHECK-LABEL: @test_false_edge(
 ; CHECK-NEXT:  for.body.lr.ph:
 ; CHECK-NEXT:    [[UMAX:%.*]] = call i32 @llvm.umax.i32(i32 [[START:%.*]], i32 65)
@@ -95,8 +95,8 @@ for.body:
 
 continue:
   %i.i64 = zext i32 %i to i64
-  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
-  %val = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %base, i64 %i.i64
+  %val = load i32, ptr %arrayidx, align 4
   br label %for.inc
 
 for.inc:
@@ -111,7 +111,7 @@ exit:
   ret void
 }
 
-define void @test_range_metadata(i32* %array_length_ptr, i32* %base,
+define void @test_range_metadata(ptr %array_length_ptr, ptr %base,
 ; CHECK-LABEL: @test_range_metadata(
 ; CHECK-NEXT:  for.body.lr.ph:
 ; CHECK-NEXT:    [[TMP0:%.*]] = zext i32 [[START:%.*]] to i64
@@ -119,7 +119,7 @@ define void @test_range_metadata(i32* %array_length_ptr, i32* %base,
 ; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ [[TMP0]], [[FOR_BODY_LR_PH:%.*]] ]
-; CHECK-NEXT:    [[ARRAY_LENGTH:%.*]] = load i32, i32* [[ARRAY_LENGTH_PTR:%.*]], align 4, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT:    [[ARRAY_LENGTH:%.*]] = load i32, ptr [[ARRAY_LENGTH_PTR:%.*]], align 4, !range [[RNG0:![0-9]+]]
 ; CHECK-NEXT:    [[TMP2:%.*]] = zext i32 [[ARRAY_LENGTH]] to i64
 ; CHECK-NEXT:    [[WITHIN_LIMITS:%.*]] = icmp ult i64 [[INDVARS_IV]], [[TMP2]]
 ; CHECK-NEXT:    br i1 [[WITHIN_LIMITS]], label [[CONTINUE:%.*]], label [[FOR_END:%.*]]
@@ -141,14 +141,14 @@ for.body.lr.ph:
 
 for.body:
   %i = phi i32 [ %start, %for.body.lr.ph ], [ %i.inc, %for.inc ]
-  %array_length = load i32, i32* %array_length_ptr, !range !{i32 0, i32 64 }
+  %array_length = load i32, ptr %array_length_ptr, !range !{i32 0, i32 64 }
   %within_limits = icmp ult i32 %i, %array_length
   br i1 %within_limits, label %continue, label %for.end
 
 continue:
   %i.i64 = zext i32 %i to i64
-  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
-  %val = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %base, i64 %i.i64
+  %val = load i32, ptr %arrayidx, align 4
   br label %for.inc
 
 for.inc:
@@ -165,14 +165,14 @@ exit:
 
 ; Negative version of the test above, we don't know anything about
 ; array_length_ptr range.
-define void @test_neg(i32* %array_length_ptr, i32* %base,
+define void @test_neg(ptr %array_length_ptr, ptr %base,
 ; CHECK-LABEL: @test_neg(
 ; CHECK-NEXT:  for.body.lr.ph:
 ; CHECK-NEXT:    [[TMP0:%.*]] = zext i32 [[START:%.*]] to i64
 ; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ [[TMP0]], [[FOR_BODY_LR_PH:%.*]] ]
-; CHECK-NEXT:    [[ARRAY_LENGTH:%.*]] = load i32, i32* [[ARRAY_LENGTH_PTR:%.*]], align 4
+; CHECK-NEXT:    [[ARRAY_LENGTH:%.*]] = load i32, ptr [[ARRAY_LENGTH_PTR:%.*]], align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = zext i32 [[ARRAY_LENGTH]] to i64
 ; CHECK-NEXT:    [[WITHIN_LIMITS:%.*]] = icmp ult i64 [[INDVARS_IV]], [[TMP1]]
 ; CHECK-NEXT:    br i1 [[WITHIN_LIMITS]], label [[CONTINUE:%.*]], label [[FOR_END:%.*]]
@@ -195,14 +195,14 @@ for.body.lr.ph:
 
 for.body:
   %i = phi i32 [ %start, %for.body.lr.ph ], [ %i.inc, %for.inc ]
-  %array_length = load i32, i32* %array_length_ptr
+  %array_length = load i32, ptr %array_length_ptr
   %within_limits = icmp ult i32 %i, %array_length
   br i1 %within_limits, label %continue, label %for.end
 
 continue:
   %i.i64 = zext i32 %i to i64
-  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
-  %val = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %base, i64 %i.i64
+  %val = load i32, ptr %arrayidx, align 4
   br label %for.inc
 
 for.inc:
@@ -217,7 +217,7 @@ exit:
   ret void
 }
 
-define void @test_transitive_use(i32* %base, i32 %limit, i32 %start) {
+define void @test_transitive_use(ptr %base, i32 %limit, i32 %start) {
 ; CHECK-LABEL: @test_transitive_use(
 ; CHECK-NEXT:  for.body.lr.ph:
 ; CHECK-NEXT:    [[TMP0:%.*]] = zext i32 [[START:%.*]] to i64
@@ -270,8 +270,8 @@ guarded:
 
 continue.2:
   %i.i64 = zext i32 %i to i64
-  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
-  %val = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %base, i64 %i.i64
+  %val = load i32, ptr %arrayidx, align 4
   br label %for.inc
 
 for.inc:
@@ -289,7 +289,7 @@ exit:
 
 declare void @llvm.experimental.guard(i1, ...)
 
-define void @test_guard_one_bb(i32* %base, i32 %limit, i32 %start) {
+define void @test_guard_one_bb(ptr %base, i32 %limit, i32 %start) {
 ; CHECK-LABEL: @test_guard_one_bb(
 ; CHECK-NEXT:  for.body.lr.ph:
 ; CHECK-NEXT:    [[TMP0:%.*]] = zext i32 [[START:%.*]] to i64
@@ -315,8 +315,8 @@ for.body:
   %i = phi i32 [ %start, %for.body.lr.ph ], [ %i.inc, %for.body ]
   %within_limits = icmp ult i32 %i, 64
   %i.i64 = zext i32 %i to i64
-  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
-  %val = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %base, i64 %i.i64
+  %val = load i32, ptr %arrayidx, align 4
   call void(i1, ...) @llvm.experimental.guard(i1 %within_limits) [ "deopt"() ]
   %i.inc = add nsw nuw i32 %i, 1
   %cmp = icmp slt i32 %i.inc, %limit
@@ -329,7 +329,7 @@ exit:
   ret void
 }
 
-define void @test_guard_in_the_same_bb(i32* %base, i32 %limit, i32 %start) {
+define void @test_guard_in_the_same_bb(ptr %base, i32 %limit, i32 %start) {
 ; CHECK-LABEL: @test_guard_in_the_same_bb(
 ; CHECK-NEXT:  for.body.lr.ph:
 ; CHECK-NEXT:    [[TMP0:%.*]] = zext i32 [[START:%.*]] to i64
@@ -357,8 +357,8 @@ for.body:
   %i = phi i32 [ %start, %for.body.lr.ph ], [ %i.inc, %for.inc ]
   %within_limits = icmp ult i32 %i, 64
   %i.i64 = zext i32 %i to i64
-  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
-  %val = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %base, i64 %i.i64
+  %val = load i32, ptr %arrayidx, align 4
   br label %for.inc
 
 for.inc:
@@ -374,7 +374,7 @@ exit:
   ret void
 }
 
-define void @test_guard_in_idom(i32* %base, i32 %limit, i32 %start) {
+define void @test_guard_in_idom(ptr %base, i32 %limit, i32 %start) {
 ; CHECK-LABEL: @test_guard_in_idom(
 ; CHECK-NEXT:  for.body.lr.ph:
 ; CHECK-NEXT:    [[TMP0:%.*]] = zext i32 [[START:%.*]] to i64
@@ -403,8 +403,8 @@ for.body:
   %within_limits = icmp ult i32 %i, 64
   call void(i1, ...) @llvm.experimental.guard(i1 %within_limits) [ "deopt"() ]
   %i.i64 = zext i32 %i to i64
-  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
-  %val = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %base, i64 %i.i64
+  %val = load i32, ptr %arrayidx, align 4
   br label %for.inc
 
 for.inc:
@@ -419,7 +419,7 @@ exit:
   ret void
 }
 
-define void @test_guard_merge_ranges(i32* %base, i32 %limit, i32 %start) {
+define void @test_guard_merge_ranges(ptr %base, i32 %limit, i32 %start) {
 ; CHECK-LABEL: @test_guard_merge_ranges(
 ; CHECK-NEXT:  for.body.lr.ph:
 ; CHECK-NEXT:    [[TMP0:%.*]] = zext i32 [[START:%.*]] to i64
@@ -450,8 +450,8 @@ for.body:
   %within_limits.2 = icmp ult i32 %i, 2147483647
   call void(i1, ...) @llvm.experimental.guard(i1 %within_limits.2) [ "deopt"() ]
   %i.i64 = zext i32 %i to i64
-  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
-  %val = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %base, i64 %i.i64
+  %val = load i32, ptr %arrayidx, align 4
   %i.inc = add nsw nuw i32 %i, 1
   %cmp = icmp slt i32 %i.inc, %limit
   br i1 %cmp, label %for.body, label %for.end

diff  --git a/llvm/test/Transforms/IndVarSimplify/pr18223.ll b/llvm/test/Transforms/IndVarSimplify/pr18223.ll
index f70757a6057b1..9046895bece77 100644
--- a/llvm/test/Transforms/IndVarSimplify/pr18223.ll
+++ b/llvm/test/Transforms/IndVarSimplify/pr18223.ll
@@ -8,7 +8,7 @@
 define i32 @main() #0 {
 ; CHECK-LABEL: @main(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* @c, align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @c, align 4
 ; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0
 ; CHECK-NEXT:    br i1 [[TOBOOL]], label [[FOR_BODY_PREHEADER:%.*]], label [[EXIT:%.*]]
 ; CHECK:       for.body.preheader:
@@ -24,7 +24,7 @@ define i32 @main() #0 {
 ; CHECK-NEXT:    ret i32 [[RET]]
 ;
 entry:
-  %0 = load i32, i32* @c, align 4
+  %0 = load i32, ptr @c, align 4
   %tobool = icmp eq i32 %0, 0
   br i1 %tobool, label %for.body, label %exit
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/pr22222.ll b/llvm/test/Transforms/IndVarSimplify/pr22222.ll
index d4dac2fef3070..6eb1dc2ece691 100644
--- a/llvm/test/Transforms/IndVarSimplify/pr22222.ll
+++ b/llvm/test/Transforms/IndVarSimplify/pr22222.ll
@@ -20,7 +20,7 @@ define i32 @main() {
 ; CHECK-NEXT:    br i1 false, label [[FOR_COND1_PREHEADER]], label [[FOR_END6:%.*]]
 ; CHECK:       for.end6:
 ; CHECK-NEXT:    [[OR_LCSSA_LCSSA:%.*]] = phi i32 [ -1, [[FOR_END]] ]
-; CHECK-NEXT:    store i32 [[OR_LCSSA_LCSSA]], i32* @a, align 4
+; CHECK-NEXT:    store i32 [[OR_LCSSA_LCSSA]], ptr @a, align 4
 ; CHECK-NEXT:    [[CMP7:%.*]] = icmp eq i32 [[OR_LCSSA_LCSSA]], -1
 ; CHECK-NEXT:    br i1 [[CMP7]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
 ; CHECK:       if.then:
@@ -30,7 +30,7 @@ define i32 @main() {
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
-  %a.promoted13 = load i32, i32* @a, align 4
+  %a.promoted13 = load i32, ptr @a, align 4
   br label %for.cond1.preheader
 
 for.cond1.preheader:                              ; preds = %entry, %for.end
@@ -52,7 +52,7 @@ for.end:                                          ; preds = %for.body3
 
 for.end6:                                         ; preds = %for.end
   %or.lcssa.lcssa = phi i32 [ %or.lcssa, %for.end ]
-  store i32 %or.lcssa.lcssa, i32* @a, align 4
+  store i32 %or.lcssa.lcssa, ptr @a, align 4
   %cmp7 = icmp eq i32 %or.lcssa.lcssa, -1
   br i1 %cmp7, label %if.end, label %if.then
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/pr24952.ll b/llvm/test/Transforms/IndVarSimplify/pr24952.ll
index b09bf19a2520c..60412d23bf5db 100644
--- a/llvm/test/Transforms/IndVarSimplify/pr24952.ll
+++ b/llvm/test/Transforms/IndVarSimplify/pr24952.ll
@@ -13,8 +13,8 @@ define void @f() {
   %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
   %iv.inc = add i32 %iv, 1
 
-  %x.gep = getelementptr i32, i32* %x, i32 %iv
-  %eql = icmp eq i32* %x.gep, %y
+  %x.gep = getelementptr i32, ptr %x, i32 %iv
+  %eql = icmp eq ptr %x.gep, %y
 ; CHECK-NOT: @use(i1 true)
   call void @use(i1 %eql)
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/pr26974.ll b/llvm/test/Transforms/IndVarSimplify/pr26974.ll
index 0d2d435311c83..1daaf34eaaeba 100644
--- a/llvm/test/Transforms/IndVarSimplify/pr26974.ll
+++ b/llvm/test/Transforms/IndVarSimplify/pr26974.ll
@@ -13,7 +13,7 @@ entry:
   br label %for.body
 
 for.cond1.preheader:                              ; preds = %for.body
-  %0 = load i32, i32* @c, align 4
+  %0 = load i32, ptr @c, align 4
   br i1 undef, label %for.cond1.us.preheader, label %for.cond1
 
 for.cond1.us.preheader:                           ; preds = %for.cond1.preheader

diff  --git a/llvm/test/Transforms/IndVarSimplify/pr32045.ll b/llvm/test/Transforms/IndVarSimplify/pr32045.ll
index 008301dbcb207..a1d28c7a6ae73 100644
--- a/llvm/test/Transforms/IndVarSimplify/pr32045.ll
+++ b/llvm/test/Transforms/IndVarSimplify/pr32045.ll
@@ -3,14 +3,14 @@
 ; This is not an IndVarSimplify bug, but the original symptom
 ; manifested as one.
 
-define i32 @foo(i32 %a, i32 %b, i32 %c, i32* %sink) {
+define i32 @foo(i32 %a, i32 %b, i32 %c, ptr %sink) {
 ; CHECK-LABEL: @foo(
 ; CHECK:       for.end:
 ; CHECK-NEXT:    [[SHR:%.*]] = ashr i32 %neg3, -1
 ; CHECK-NEXT:    [[SUB:%.*]] = sub nsw i32 0, [[SHR]]
 ; CHECK-NEXT:    [[SHR1:%.*]] = ashr i32 [[SUB]], [[B:%.*]]
 ; CHECK-NEXT:    [[NEG:%.*]] = xor i32 [[SHR1]], -1
-; CHECK-NEXT:    store i32 [[NEG]], i32* %sink
+; CHECK-NEXT:    store i32 [[NEG]], ptr %sink
 ;
 entry:
   %tobool2 = icmp eq i32 %a, 0
@@ -31,7 +31,7 @@ for.end:
   %sub = sub nsw i32 0, %shr
   %shr1 = ashr i32 %sub, %b
   %neg = xor i32 %shr1, -1
-  store i32 %neg, i32* %sink
+  store i32 %neg, ptr %sink
   br i1 false, label %exit, label %preheader
 
 exit:

diff  --git a/llvm/test/Transforms/IndVarSimplify/pr55925.ll b/llvm/test/Transforms/IndVarSimplify/pr55925.ll
index 5a608df9f7a89..94ac4bbfdeef7 100644
--- a/llvm/test/Transforms/IndVarSimplify/pr55925.ll
+++ b/llvm/test/Transforms/IndVarSimplify/pr55925.ll
@@ -8,7 +8,7 @@ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
 
 declare i32 @foo(i32)
 
-define void @test(i8* %p) personality i8* undef {
+define void @test(ptr %p) personality ptr undef {
 ; CHECK-LABEL: @test(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
@@ -24,7 +24,7 @@ define void @test(i8* %p) personality i8* undef {
 ; CHECK-NEXT:    [[TMP1:%.*]] = call i32 @foo(i32 [[TMP0]])
 ; CHECK-NEXT:    br label [[LOOP]]
 ; CHECK:       exit:
-; CHECK-NEXT:    [[LP:%.*]] = landingpad { i8*, i32 }
+; CHECK-NEXT:    [[LP:%.*]] = landingpad { ptr, i32 }
 ; CHECK-NEXT:    cleanup
 ; CHECK-NEXT:    ret void
 ;
@@ -38,18 +38,18 @@ loop:
 
 loop.latch:
   %ext = zext i32 %iv to i64
-  %tmp5 = getelementptr inbounds i8, i8* %p, i64 %ext
+  %tmp5 = getelementptr inbounds i8, ptr %p, i64 %ext
   %iv.next = add nuw i32 %iv, 1
   call i32 @foo(i32 %res)
   br label %loop
 
 exit:
-  %lp = landingpad { i8*, i32 }
+  %lp = landingpad { ptr, i32 }
   cleanup
   ret void
 }
 
-define void @test_critedge(i1 %c, i8* %p) personality i8* undef {
+define void @test_critedge(i1 %c, ptr %p) personality ptr undef {
 ; CHECK-LABEL: @test_critedge(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
@@ -70,7 +70,7 @@ define void @test_critedge(i1 %c, i8* %p) personality i8* undef {
 ; CHECK-NEXT:    [[TMP1:%.*]] = call i32 @foo(i32 [[PHI]])
 ; CHECK-NEXT:    br label [[LOOP]]
 ; CHECK:       exit:
-; CHECK-NEXT:    [[LP:%.*]] = landingpad { i8*, i32 }
+; CHECK-NEXT:    [[LP:%.*]] = landingpad { ptr, i32 }
 ; CHECK-NEXT:    cleanup
 ; CHECK-NEXT:    ret void
 ;
@@ -91,13 +91,13 @@ loop.other:
 loop.latch:
   %phi = phi i32 [ %res, %loop.invoke ], [ 0, %loop.other ]
   %ext = zext i32 %iv to i64
-  %tmp5 = getelementptr inbounds i8, i8* %p, i64 %ext
+  %tmp5 = getelementptr inbounds i8, ptr %p, i64 %ext
   %iv.next = add nuw i32 %iv, 1
   call i32 @foo(i32 %phi)
   br label %loop
 
 exit:
-  %lp = landingpad { i8*, i32 }
+  %lp = landingpad { ptr, i32 }
   cleanup
   ret void
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/preserve-memoryssa.ll b/llvm/test/Transforms/IndVarSimplify/preserve-memoryssa.ll
index a999621ab8e41..bda77a61eabbb 100644
--- a/llvm/test/Transforms/IndVarSimplify/preserve-memoryssa.ll
+++ b/llvm/test/Transforms/IndVarSimplify/preserve-memoryssa.ll
@@ -14,8 +14,8 @@ for.cond.cleanup27:                               ; preds = %for.cond26
   unreachable
 
 for.body28:                                       ; preds = %for.cond26
-  %v_69.imag = load volatile i16, i16* getelementptr inbounds ({ i16, i16 }, { i16, i16 }* @v_69, i32 0, i32 1), align 1
-  %.real42 = load i32, i32* undef, align 1
-  store i32 %.real42, i32* undef, align 1
+  %v_69.imag = load volatile i16, ptr getelementptr inbounds ({ i16, i16 }, ptr @v_69, i32 0, i32 1), align 1
+  %.real42 = load i32, ptr undef, align 1
+  store i32 %.real42, ptr undef, align 1
   br label %for.cond26
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll b/llvm/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll
index 7d1209d4cbb1d..a135e33ac0936 100644
--- a/llvm/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll
+++ b/llvm/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll
@@ -8,7 +8,7 @@
 target datalayout = "n8:16:32:64"
 
 
-define void @foo(i32* nocapture %d, i32 %n) nounwind {
+define void @foo(ptr nocapture %d, i32 %n) nounwind {
 entry:
 	%0 = icmp sgt i32 %n, 0		; <i1> [#uses=1]
 	br i1 %0, label %bb.nph, label %return
@@ -25,8 +25,8 @@ bb:		; preds = %bb1, %bb.nph
 	%p.01 = phi i8 [ %4, %bb1 ], [ -1, %bb.nph ]		; <i8> [#uses=2]
 	%1 = sext i8 %p.01 to i32		; <i32> [#uses=1]
 	%2 = sext i32 %i.02 to i64		; <i64> [#uses=1]
-	%3 = getelementptr i32, i32* %d, i64 %2		; <i32*> [#uses=1]
-	store i32 %1, i32* %3, align 4
+	%3 = getelementptr i32, ptr %d, i64 %2		; <ptr> [#uses=1]
+	store i32 %1, ptr %3, align 4
 	%4 = add i8 %p.01, 1		; <i8> [#uses=1]
 	%5 = add i32 %i.02, 1		; <i32> [#uses=2]
 	br label %bb1

diff  --git a/llvm/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll b/llvm/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
index 9dc9d7226b2d1..8819df6d013fe 100644
--- a/llvm/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
+++ b/llvm/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
@@ -6,7 +6,7 @@ target datalayout = "n8:16:32:64"
 
 ; CHECK-NOT: sext
 
-define i64 @test(i64* nocapture %first, i32 %count) nounwind readonly {
+define i64 @test(ptr nocapture %first, i32 %count) nounwind readonly {
 ; CHECK-LABEL: @test(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[T0:%.*]] = icmp sgt i32 [[COUNT:%.*]], 0
@@ -17,8 +17,8 @@ define i64 @test(i64* nocapture %first, i32 %count) nounwind readonly {
 ; CHECK:       bb:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[BB1:%.*]] ], [ 0, [[BB_NPH]] ]
 ; CHECK-NEXT:    [[RESULT_02:%.*]] = phi i64 [ [[T5:%.*]], [[BB1]] ], [ 0, [[BB_NPH]] ]
-; CHECK-NEXT:    [[T2:%.*]] = getelementptr i64, i64* [[FIRST:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    [[T3:%.*]] = load i64, i64* [[T2]], align 8
+; CHECK-NEXT:    [[T2:%.*]] = getelementptr i64, ptr [[FIRST:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    [[T3:%.*]] = load i64, ptr [[T2]], align 8
 ; CHECK-NEXT:    [[T4:%.*]] = lshr i64 [[T3]], 4
 ; CHECK-NEXT:    [[T5]] = add i64 [[T4]], [[RESULT_02]]
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
@@ -44,8 +44,8 @@ bb:		; preds = %bb1, %bb.nph
   %result.02 = phi i64 [ %t5, %bb1 ], [ 0, %bb.nph ]		; <i64> [#uses=1]
   %n.01 = phi i32 [ %t6, %bb1 ], [ 0, %bb.nph ]		; <i32> [#uses=2]
   %t1 = sext i32 %n.01 to i64		; <i64> [#uses=1]
-  %t2 = getelementptr i64, i64* %first, i64 %t1		; <i64*> [#uses=1]
-  %t3 = load i64, i64* %t2, align 8		; <i64> [#uses=1]
+  %t2 = getelementptr i64, ptr %first, i64 %t1		; <ptr> [#uses=1]
+  %t3 = load i64, ptr %t2, align 8		; <i64> [#uses=1]
   %t4 = lshr i64 %t3, 4		; <i64> [#uses=1]
   %t5 = add i64 %t4, %result.02		; <i64> [#uses=2]
   %t6 = add i32 %n.01, 1		; <i32> [#uses=2]
@@ -64,7 +64,7 @@ bb2:		; preds = %bb1.bb2_crit_edge, %entry
   ret i64 %result.0.lcssa
 }
 
-define void @foo(i16 signext %N, i32* nocapture %P) nounwind {
+define void @foo(i16 signext %N, ptr nocapture %P) nounwind {
 ; CHECK-LABEL: @foo(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[T0:%.*]] = icmp sgt i16 [[N:%.*]], 0
@@ -74,8 +74,8 @@ define void @foo(i16 signext %N, i32* nocapture %P) nounwind {
 ; CHECK-NEXT:    br label [[BB:%.*]]
 ; CHECK:       bb:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[BB1:%.*]] ], [ 0, [[BB_NPH]] ]
-; CHECK-NEXT:    [[T2:%.*]] = getelementptr i32, i32* [[P:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    store i32 123, i32* [[T2]], align 4
+; CHECK-NEXT:    [[T2:%.*]] = getelementptr i32, ptr [[P:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    store i32 123, ptr [[T2]], align 4
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
 ; CHECK-NEXT:    br label [[BB1]]
 ; CHECK:       bb1:
@@ -96,8 +96,8 @@ bb.nph:		; preds = %entry
 bb:		; preds = %bb1, %bb.nph
   %i.01 = phi i16 [ %t3, %bb1 ], [ 0, %bb.nph ]		; <i16> [#uses=2]
   %t1 = sext i16 %i.01 to i64		; <i64> [#uses=1]
-  %t2 = getelementptr i32, i32* %P, i64 %t1		; <i32*> [#uses=1]
-  store i32 123, i32* %t2, align 4
+  %t2 = getelementptr i32, ptr %P, i64 %t1		; <ptr> [#uses=1]
+  store i32 123, ptr %t2, align 4
   %t3 = add i16 %i.01, 1		; <i16> [#uses=2]
   br label %bb1
 
@@ -114,15 +114,15 @@ return:		; preds = %bb1.return_crit_edge, %entry
 
 ; Test cases from PR1301:
 
-define void @kinds__srangezero([21 x i32]* nocapture %a) nounwind {
+define void @kinds__srangezero(ptr nocapture %a) nounwind {
 ; CHECK-LABEL: @kinds__srangezero(
 ; CHECK-NEXT:  bb.thread:
 ; CHECK-NEXT:    br label [[BB:%.*]]
 ; CHECK:       bb:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i32 [ [[INDVARS_IV_NEXT:%.*]], [[BB]] ], [ -10, [[BB_THREAD:%.*]] ]
 ; CHECK-NEXT:    [[TMP4:%.*]] = add nsw i32 [[INDVARS_IV]], 10
-; CHECK-NEXT:    [[TMP5:%.*]] = getelementptr [21 x i32], [21 x i32]* [[A:%.*]], i32 0, i32 [[TMP4]]
-; CHECK-NEXT:    store i32 0, i32* [[TMP5]], align 4
+; CHECK-NEXT:    [[TMP5:%.*]] = getelementptr [21 x i32], ptr [[A:%.*]], i32 0, i32 [[TMP4]]
+; CHECK-NEXT:    store i32 0, ptr [[TMP5]], align 4
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i32 [[INDVARS_IV]], 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i32 [[INDVARS_IV_NEXT]], 11
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[RETURN:%.*]], label [[BB]]
@@ -136,8 +136,8 @@ bb:             ; preds = %bb, %bb.thread
   %i.0.reg2mem.0 = phi i8 [ -10, %bb.thread ], [ %tmp7, %bb ]           ; <i8> [#uses=2]
   %tmp12 = sext i8 %i.0.reg2mem.0 to i32                ; <i32> [#uses=1]
   %tmp4 = add i32 %tmp12, 10            ; <i32> [#uses=1]
-  %tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4                ; <i32*> [#uses=1]
-  store i32 0, i32* %tmp5
+  %tmp5 = getelementptr [21 x i32], ptr %a, i32 0, i32 %tmp4                ; <ptr> [#uses=1]
+  store i32 0, ptr %tmp5
   %tmp7 = add i8 %i.0.reg2mem.0, 1              ; <i8> [#uses=2]
   %0 = icmp sgt i8 %tmp7, 10            ; <i1> [#uses=1]
   br i1 %0, label %return, label %bb
@@ -146,15 +146,15 @@ return:         ; preds = %bb
   ret void
 }
 
-define void @kinds__urangezero([21 x i32]* nocapture %a) nounwind {
+define void @kinds__urangezero(ptr nocapture %a) nounwind {
 ; CHECK-LABEL: @kinds__urangezero(
 ; CHECK-NEXT:  bb.thread:
 ; CHECK-NEXT:    br label [[BB:%.*]]
 ; CHECK:       bb:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i32 [ [[INDVARS_IV_NEXT:%.*]], [[BB]] ], [ 10, [[BB_THREAD:%.*]] ]
 ; CHECK-NEXT:    [[TMP4:%.*]] = add nsw i32 [[INDVARS_IV]], -10
-; CHECK-NEXT:    [[TMP5:%.*]] = getelementptr [21 x i32], [21 x i32]* [[A:%.*]], i32 0, i32 [[TMP4]]
-; CHECK-NEXT:    store i32 0, i32* [[TMP5]], align 4
+; CHECK-NEXT:    [[TMP5:%.*]] = getelementptr [21 x i32], ptr [[A:%.*]], i32 0, i32 [[TMP4]]
+; CHECK-NEXT:    store i32 0, ptr [[TMP5]], align 4
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i32 [[INDVARS_IV]], 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i32 [[INDVARS_IV_NEXT]], 31
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[RETURN:%.*]], label [[BB]]
@@ -168,8 +168,8 @@ bb:             ; preds = %bb, %bb.thread
   %i.0.reg2mem.0 = phi i8 [ 10, %bb.thread ], [ %tmp7, %bb ]            ; <i8> [#uses=2]
   %tmp12 = sext i8 %i.0.reg2mem.0 to i32                ; <i32> [#uses=1]
   %tmp4 = add i32 %tmp12, -10           ; <i32> [#uses=1]
-  %tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4                ; <i32*> [#uses=1]
-  store i32 0, i32* %tmp5
+  %tmp5 = getelementptr [21 x i32], ptr %a, i32 0, i32 %tmp4                ; <ptr> [#uses=1]
+  store i32 0, ptr %tmp5
   %tmp7 = add i8 %i.0.reg2mem.0, 1              ; <i8> [#uses=2]
   %0 = icmp sgt i8 %tmp7, 30            ; <i1> [#uses=1]
   br i1 %0, label %return, label %bb
@@ -178,10 +178,10 @@ return:         ; preds = %bb
   ret void
 }
 
-define void @promote_latch_condition_decrementing_loop_01(i32* %p, i32* %a) {
+define void @promote_latch_condition_decrementing_loop_01(ptr %p, ptr %a) {
 ; CHECK-LABEL: @promote_latch_condition_decrementing_loop_01(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0:![0-9]+]]
 ; CHECK-NEXT:    [[LEN_MINUS_1:%.*]] = add i32 [[LEN]], -1
 ; CHECK-NEXT:    [[ZERO_CHECK:%.*]] = icmp eq i32 [[LEN]], 0
 ; CHECK-NEXT:    br i1 [[ZERO_CHECK]], label [[LOOPEXIT:%.*]], label [[PREHEADER:%.*]]
@@ -194,15 +194,15 @@ define void @promote_latch_condition_decrementing_loop_01(i32* %p, i32* %a) {
 ; CHECK-NEXT:    ret void
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[LOOP]] ], [ [[TMP0]], [[PREHEADER]] ]
-; CHECK-NEXT:    [[EL:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    store atomic i32 0, i32* [[EL]] unordered, align 4
+; CHECK-NEXT:    [[EL:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    store atomic i32 0, ptr [[EL]] unordered, align 4
 ; CHECK-NEXT:    [[LOOPCOND:%.*]] = icmp slt i64 [[INDVARS_IV]], 1
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], -1
 ; CHECK-NEXT:    br i1 [[LOOPCOND]], label [[LOOPEXIT_LOOPEXIT:%.*]], label [[LOOP]]
 ;
 
 entry:
-  %len = load i32, i32* %p, align 4, !range !0
+  %len = load i32, ptr %p, align 4, !range !0
   %len.minus.1 = add nsw i32 %len, -1
   %zero_check = icmp eq i32 %len, 0
   br i1 %zero_check, label %loopexit, label %preheader
@@ -216,17 +216,17 @@ loopexit:
 loop:
   %iv = phi i32 [ %iv.next, %loop ], [ %len.minus.1, %preheader ]
   %iv.wide = zext i32 %iv to i64
-  %el = getelementptr inbounds i32, i32* %a, i64 %iv.wide
-  store atomic i32 0, i32* %el unordered, align 4
+  %el = getelementptr inbounds i32, ptr %a, i64 %iv.wide
+  store atomic i32 0, ptr %el unordered, align 4
   %iv.next = add nsw i32 %iv, -1
   %loopcond = icmp slt i32 %iv, 1
   br i1 %loopcond, label %loopexit, label %loop
 }
 
-define void @promote_latch_condition_decrementing_loop_02(i32* %p, i32* %a) {
+define void @promote_latch_condition_decrementing_loop_02(ptr %p, ptr %a) {
 ; CHECK-LABEL: @promote_latch_condition_decrementing_loop_02(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    [[ZERO_CHECK:%.*]] = icmp eq i32 [[LEN]], 0
 ; CHECK-NEXT:    br i1 [[ZERO_CHECK]], label [[LOOPEXIT:%.*]], label [[PREHEADER:%.*]]
 ; CHECK:       preheader:
@@ -238,15 +238,15 @@ define void @promote_latch_condition_decrementing_loop_02(i32* %p, i32* %a) {
 ; CHECK-NEXT:    ret void
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[LOOP]] ], [ [[TMP0]], [[PREHEADER]] ]
-; CHECK-NEXT:    [[EL:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    store atomic i32 0, i32* [[EL]] unordered, align 4
+; CHECK-NEXT:    [[EL:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    store atomic i32 0, ptr [[EL]] unordered, align 4
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], -1
 ; CHECK-NEXT:    [[LOOPCOND:%.*]] = icmp slt i64 [[INDVARS_IV]], 1
 ; CHECK-NEXT:    br i1 [[LOOPCOND]], label [[LOOPEXIT_LOOPEXIT:%.*]], label [[LOOP]]
 ;
 
 entry:
-  %len = load i32, i32* %p, align 4, !range !0
+  %len = load i32, ptr %p, align 4, !range !0
   %zero_check = icmp eq i32 %len, 0
   br i1 %zero_check, label %loopexit, label %preheader
 
@@ -259,17 +259,17 @@ loopexit:
 loop:
   %iv = phi i32 [ %iv.next, %loop ], [ %len, %preheader ]
   %iv.wide = zext i32 %iv to i64
-  %el = getelementptr inbounds i32, i32* %a, i64 %iv.wide
-  store atomic i32 0, i32* %el unordered, align 4
+  %el = getelementptr inbounds i32, ptr %a, i64 %iv.wide
+  store atomic i32 0, ptr %el unordered, align 4
   %iv.next = add nsw i32 %iv, -1
   %loopcond = icmp slt i32 %iv, 1
   br i1 %loopcond, label %loopexit, label %loop
 }
 
-define void @promote_latch_condition_decrementing_loop_03(i32* %p, i32* %a) {
+define void @promote_latch_condition_decrementing_loop_03(ptr %p, ptr %a) {
 ; CHECK-LABEL: @promote_latch_condition_decrementing_loop_03(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    [[ZERO_CHECK:%.*]] = icmp eq i32 [[LEN]], 0
 ; CHECK-NEXT:    br i1 [[ZERO_CHECK]], label [[LOOPEXIT:%.*]], label [[PREHEADER:%.*]]
 ; CHECK:       preheader:
@@ -282,15 +282,15 @@ define void @promote_latch_condition_decrementing_loop_03(i32* %p, i32* %a) {
 ; CHECK-NEXT:    ret void
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[LOOP]] ], [ [[TMP1]], [[PREHEADER]] ]
-; CHECK-NEXT:    [[EL:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    store atomic i32 0, i32* [[EL]] unordered, align 4
+; CHECK-NEXT:    [[EL:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    store atomic i32 0, ptr [[EL]] unordered, align 4
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], -1
 ; CHECK-NEXT:    [[LOOPCOND:%.*]] = icmp slt i64 [[INDVARS_IV]], 1
 ; CHECK-NEXT:    br i1 [[LOOPCOND]], label [[LOOPEXIT_LOOPEXIT:%.*]], label [[LOOP]]
 ;
 
 entry:
-  %len = load i32, i32* %p, align 4, !range !0
+  %len = load i32, ptr %p, align 4, !range !0
   %len.plus.1 = add i32 %len, 1
   %zero_check = icmp eq i32 %len, 0
   br i1 %zero_check, label %loopexit, label %preheader
@@ -304,17 +304,17 @@ loopexit:
 loop:
   %iv = phi i32 [ %iv.next, %loop ], [ %len.plus.1, %preheader ]
   %iv.wide = zext i32 %iv to i64
-  %el = getelementptr inbounds i32, i32* %a, i64 %iv.wide
-  store atomic i32 0, i32* %el unordered, align 4
+  %el = getelementptr inbounds i32, ptr %a, i64 %iv.wide
+  store atomic i32 0, ptr %el unordered, align 4
   %iv.next = add nsw i32 %iv, -1
   %loopcond = icmp slt i32 %iv, 1
   br i1 %loopcond, label %loopexit, label %loop
 }
 
-define void @promote_latch_condition_decrementing_loop_04(i32* %p, i32* %a, i1 %cond) {
+define void @promote_latch_condition_decrementing_loop_04(ptr %p, ptr %a, i1 %cond) {
 ; CHECK-LABEL: @promote_latch_condition_decrementing_loop_04(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    [[LEN_MINUS_1:%.*]] = add nsw i32 [[LEN]], -1
 ; CHECK-NEXT:    br i1 [[COND:%.*]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]]
 ; CHECK:       if.true:
@@ -334,15 +334,15 @@ define void @promote_latch_condition_decrementing_loop_04(i32* %p, i32* %a, i1 %
 ; CHECK-NEXT:    ret void
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[LOOP]] ], [ [[TMP0]], [[PREHEADER]] ]
-; CHECK-NEXT:    [[EL:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    store atomic i32 0, i32* [[EL]] unordered, align 4
+; CHECK-NEXT:    [[EL:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    store atomic i32 0, ptr [[EL]] unordered, align 4
 ; CHECK-NEXT:    [[LOOPCOND:%.*]] = icmp slt i64 [[INDVARS_IV]], 1
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], -1
 ; CHECK-NEXT:    br i1 [[LOOPCOND]], label [[LOOPEXIT_LOOPEXIT:%.*]], label [[LOOP]]
 ;
 
 entry:
-  %len = load i32, i32* %p, align 4, !range !0
+  %len = load i32, ptr %p, align 4, !range !0
   %len.minus.1 = add nsw i32 %len, -1
   br i1 %cond, label %if.true, label %if.false
 
@@ -366,17 +366,17 @@ loopexit:
 loop:
   %iv = phi i32 [ %iv.next, %loop ], [ %iv_start, %preheader ]
   %iv.wide = zext i32 %iv to i64
-  %el = getelementptr inbounds i32, i32* %a, i64 %iv.wide
-  store atomic i32 0, i32* %el unordered, align 4
+  %el = getelementptr inbounds i32, ptr %a, i64 %iv.wide
+  store atomic i32 0, ptr %el unordered, align 4
   %iv.next = add nsw i32 %iv, -1
   %loopcond = icmp slt i32 %iv, 1
   br i1 %loopcond, label %loopexit, label %loop
 }
 
-define void @promote_latch_condition_decrementing_loop_05(i32* %p, i32* %a, i1 %cond) {
+define void @promote_latch_condition_decrementing_loop_05(ptr %p, ptr %a, i1 %cond) {
 ; CHECK-LABEL: @promote_latch_condition_decrementing_loop_05(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[LEN:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    br i1 [[COND:%.*]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]]
 ; CHECK:       if.true:
 ; CHECK-NEXT:    br label [[MERGE:%.*]]
@@ -396,15 +396,15 @@ define void @promote_latch_condition_decrementing_loop_05(i32* %p, i32* %a, i1 %
 ; CHECK-NEXT:    ret void
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[LOOP]] ], [ [[TMP0]], [[PREHEADER]] ]
-; CHECK-NEXT:    [[EL:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    store atomic i32 0, i32* [[EL]] unordered, align 4
+; CHECK-NEXT:    [[EL:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    store atomic i32 0, ptr [[EL]] unordered, align 4
 ; CHECK-NEXT:    [[LOOPCOND:%.*]] = icmp slt i64 [[INDVARS_IV]], 1
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], -1
 ; CHECK-NEXT:    br i1 [[LOOPCOND]], label [[LOOPEXIT_LOOPEXIT:%.*]], label [[LOOP]]
 ;
 
 entry:
-  %len = load i32, i32* %p, align 4, !range !0
+  %len = load i32, ptr %p, align 4, !range !0
   br i1 %cond, label %if.true, label %if.false
 
 if.true:
@@ -428,8 +428,8 @@ loopexit:
 loop:
   %iv = phi i32 [ %iv.next, %loop ], [ %iv_start, %preheader ]
   %iv.wide = zext i32 %iv to i64
-  %el = getelementptr inbounds i32, i32* %a, i64 %iv.wide
-  store atomic i32 0, i32* %el unordered, align 4
+  %el = getelementptr inbounds i32, ptr %a, i64 %iv.wide
+  store atomic i32 0, ptr %el unordered, align 4
   %iv.next = add nsw i32 %iv, -1
   %loopcond = icmp slt i32 %iv, 1
   br i1 %loopcond, label %loopexit, label %loop

diff  --git a/llvm/test/Transforms/IndVarSimplify/replace-sdiv-by-udiv.ll b/llvm/test/Transforms/IndVarSimplify/replace-sdiv-by-udiv.ll
index 9a97929328bc3..9a4113799ed24 100644
--- a/llvm/test/Transforms/IndVarSimplify/replace-sdiv-by-udiv.ll
+++ b/llvm/test/Transforms/IndVarSimplify/replace-sdiv-by-udiv.ll
@@ -1,6 +1,6 @@
 ; RUN: opt < %s -passes=indvars -S | FileCheck %s
 
-define void @test0(i32* %a) {
+define void @test0(ptr %a) {
 ; CHECK-LABEL: @test0(
 entry:
   br label %for.body
@@ -11,8 +11,8 @@ for.body:                                         ; preds = %entry, %for.body
 ; CHECK-NOT: sdiv
 ; CHECK:     udiv
   %idxprom = sext i32 %div to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end
@@ -21,7 +21,7 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
-define void @test1(i32* %a) {
+define void @test1(ptr %a) {
 ; CHECK-LABEL: @test1(
 entry:
   br label %for.body
@@ -32,8 +32,8 @@ for.body:                                         ; preds = %entry, %for.body
 ; CHECK-NOT: sdiv
 ; CHECK:     udiv exact
   %idxprom = sext i32 %div to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end
@@ -42,7 +42,7 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
-define void @test2(i32* %a, i32 %d) {
+define void @test2(ptr %a, i32 %d) {
 ; CHECK-LABEL: @test2(
 entry:
   br label %for.body
@@ -53,8 +53,8 @@ for.body:                                         ; preds = %entry, %for.body
   %div = sdiv i32 %mul, %d
 ; CHECK-NOT: udiv
   %idxprom = sext i32 %div to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end
@@ -63,7 +63,7 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
-define void @test3(i32* %a) {
+define void @test3(ptr %a) {
 ; CHECK-LABEL: @test3(
 entry:
   br label %for.body
@@ -74,8 +74,8 @@ for.body:                                         ; preds = %entry, %for.body
 ; CHECK:     udiv
 ; CHECK-NOT: sdiv
   %idxprom = sext i32 %div to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end
@@ -84,7 +84,7 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
-define void @test4(i32* %a) {
+define void @test4(ptr %a) {
 ; CHECK-LABEL: @test4(
 entry:
   br label %for.body
@@ -96,8 +96,8 @@ for.body:                                         ; preds = %entry, %for.body
 ; CHECK:     udiv
 ; CHECK-NOT: sdiv
   %idxprom = sext i32 %div to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end
@@ -106,7 +106,7 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
-define void @test5(i32* %a) {
+define void @test5(ptr %a) {
 ; CHECK-LABEL: @test5(
 entry:
   br label %for.body
@@ -118,8 +118,8 @@ for.body:                                         ; preds = %entry, %for.body
 ; CHECK:     udiv
 ; CHECK-NOT: sdiv
   %idxprom = sext i32 %div to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end

diff  --git a/llvm/test/Transforms/IndVarSimplify/replace-srem-by-urem.ll b/llvm/test/Transforms/IndVarSimplify/replace-srem-by-urem.ll
index 232f82e0a1dc9..5fc34b2564856 100644
--- a/llvm/test/Transforms/IndVarSimplify/replace-srem-by-urem.ll
+++ b/llvm/test/Transforms/IndVarSimplify/replace-srem-by-urem.ll
@@ -1,6 +1,6 @@
 ; RUN: opt < %s -passes=indvars -S | FileCheck %s
 
-define void @test0(i32* %a) {
+define void @test0(ptr %a) {
 ; CHECK-LABEL: @test0(
 entry:
   br label %for.body
@@ -11,8 +11,8 @@ for.body:                                         ; preds = %entry, %for.body
 ; CHECK-NOT: srem
 ; CHECK:     urem
   %idxprom = sext i32 %rem to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end
@@ -21,7 +21,7 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
-define void @test2(i32* %a, i32 %d) {
+define void @test2(ptr %a, i32 %d) {
 ; CHECK-LABEL: @test2(
 entry:
   br label %for.body
@@ -32,8 +32,8 @@ for.body:                                         ; preds = %entry, %for.body
   %rem = srem i32 %mul, %d
 ; CHECK-NOT: urem
   %idxprom = sext i32 %rem to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end
@@ -42,7 +42,7 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
-define void @test3(i32* %a) {
+define void @test3(ptr %a) {
 ; CHECK-LABEL: @test3(
 entry:
   br label %for.body
@@ -53,8 +53,8 @@ for.body:                                         ; preds = %entry, %for.body
 ; CHECK:     urem
 ; CHECK-NOT: srem
   %idxprom = sext i32 %rem to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end
@@ -63,7 +63,7 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
-define void @test4(i32* %a) {
+define void @test4(ptr %a) {
 ; CHECK-LABEL: @test4(
 entry:
   br label %for.body
@@ -75,8 +75,8 @@ for.body:                                         ; preds = %entry, %for.body
 ; CHECK:     urem
 ; CHECK-NOT: srem
   %idxprom = sext i32 %rem to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end
@@ -85,7 +85,7 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
-define void @test5(i32* %a) {
+define void @test5(ptr %a) {
 ; CHECK-LABEL: @test5(
 entry:
   br label %for.body
@@ -97,8 +97,8 @@ for.body:                                         ; preds = %entry, %for.body
 ; CHECK:     urem
 ; CHECK-NOT: srem
   %idxprom = sext i32 %rem to i64
-  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
-  store i32 %i.01, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
+  store i32 %i.01, ptr %arrayidx, align 4
   %inc = add nsw i32 %i.01, 1
   %cmp = icmp slt i32 %inc, 64
   br i1 %cmp, label %for.body, label %for.end

diff  --git a/llvm/test/Transforms/IndVarSimplify/rewrite-loop-exit-value.ll b/llvm/test/Transforms/IndVarSimplify/rewrite-loop-exit-value.ll
index 3b71343247491..23412ed978d29 100644
--- a/llvm/test/Transforms/IndVarSimplify/rewrite-loop-exit-value.ll
+++ b/llvm/test/Transforms/IndVarSimplify/rewrite-loop-exit-value.ll
@@ -3,10 +3,10 @@
 
 ;; Test that loop's exit value is rewritten to its initial
 ;; value from loop preheader
-define i32 @test1(i32* %var) {
+define i32 @test1(ptr %var) {
 ; CHECK-LABEL: @test1(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[COND:%.*]] = icmp eq i32* [[VAR:%.*]], null
+; CHECK-NEXT:    [[COND:%.*]] = icmp eq ptr [[VAR:%.*]], null
 ; CHECK-NEXT:    br label [[HEADER:%.*]]
 ; CHECK:       header:
 ; CHECK-NEXT:    br i1 [[COND]], label [[LOOP:%.*]], label [[EXIT:%.*]]
@@ -16,7 +16,7 @@ define i32 @test1(i32* %var) {
 ; CHECK-NEXT:    ret i32 0
 ;
 entry:
-  %cond = icmp eq i32* %var, null
+  %cond = icmp eq ptr %var, null
   br label %header
 
 header:
@@ -33,10 +33,10 @@ exit:
 
 ;; Test that we can not rewrite loop exit value if it's not
 ;; a phi node (%indvar is an add instruction in this test).
-define i32 @test2(i32* %var) {
+define i32 @test2(ptr %var) {
 ; CHECK-LABEL: @test2(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[COND:%.*]] = icmp eq i32* [[VAR:%.*]], null
+; CHECK-NEXT:    [[COND:%.*]] = icmp eq ptr [[VAR:%.*]], null
 ; CHECK-NEXT:    br label [[HEADER:%.*]]
 ; CHECK:       header:
 ; CHECK-NEXT:    [[PHI_INDVAR:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INDVAR:%.*]], [[HEADER]] ]
@@ -46,7 +46,7 @@ define i32 @test2(i32* %var) {
 ; CHECK-NEXT:    ret i32 [[INDVAR]]
 ;
 entry:
-  %cond = icmp eq i32* %var, null
+  %cond = icmp eq ptr %var, null
   br label %header
 
 header:
@@ -60,10 +60,10 @@ exit:
 
 ;; Test that we can not rewrite loop exit value if the condition
 ;; is not in loop header.
-define i32 @test3(i32* %var) {
+define i32 @test3(ptr %var) {
 ; CHECK-LABEL: @test3(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[COND1:%.*]] = icmp eq i32* [[VAR:%.*]], null
+; CHECK-NEXT:    [[COND1:%.*]] = icmp eq ptr [[VAR:%.*]], null
 ; CHECK-NEXT:    br label [[HEADER:%.*]]
 ; CHECK:       header:
 ; CHECK-NEXT:    [[PHI_INDVAR:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INDVAR:%.*]], [[HEADER_BACKEDGE:%.*]] ]
@@ -78,7 +78,7 @@ define i32 @test3(i32* %var) {
 ; CHECK-NEXT:    ret i32 [[PHI_INDVAR]]
 ;
 entry:
-  %cond1 = icmp eq i32* %var, null
+  %cond1 = icmp eq ptr %var, null
   br label %header
 
 header:
@@ -123,13 +123,13 @@ exit:
 }
 
 ; A conditionally executed exit.
-define i32 @test5(i1* %addr, i1 %cond2) {
+define i32 @test5(ptr %addr, i1 %cond2) {
 ; CHECK-LABEL: @test5(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[HEADER:%.*]]
 ; CHECK:       header:
 ; CHECK-NEXT:    [[PHI_INDVAR:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INDVAR:%.*]], [[LOOP:%.*]] ]
-; CHECK-NEXT:    [[COND1:%.*]] = load volatile i1, i1* [[ADDR:%.*]], align 1
+; CHECK-NEXT:    [[COND1:%.*]] = load volatile i1, ptr [[ADDR:%.*]], align 1
 ; CHECK-NEXT:    br i1 [[COND1]], label [[LOOP]], label [[MAYBE:%.*]]
 ; CHECK:       maybe:
 ; CHECK-NEXT:    br i1 [[COND2:%.*]], label [[LOOP]], label [[EXIT:%.*]]
@@ -144,7 +144,7 @@ entry:
 
 header:
   %phi_indvar = phi i32 [0, %entry], [%indvar, %loop]
-  %cond1 = load volatile i1, i1* %addr
+  %cond1 = load volatile i1, ptr %addr
   br i1 %cond1, label %loop, label %maybe
 
 maybe:

diff  --git a/llvm/test/Transforms/IndVarSimplify/rlev-add-me.ll b/llvm/test/Transforms/IndVarSimplify/rlev-add-me.ll
index 5873e25b070a8..9ae7d0af2a43e 100644
--- a/llvm/test/Transforms/IndVarSimplify/rlev-add-me.ll
+++ b/llvm/test/Transforms/IndVarSimplify/rlev-add-me.ll
@@ -12,7 +12,7 @@ define i32 @test(i32 %n) {
 ; CHECK-NEXT:    br label [[HEADER:%.*]]
 ; CHECK:       header:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LATCH:%.*]] ]
-; CHECK-NEXT:    [[V:%.*]] = load volatile i32, i32* @G
+; CHECK-NEXT:    [[V:%.*]] = load volatile i32, ptr @G
 ; CHECK-NEXT:    [[CMP1:%.*]] = icmp eq i32 [[V]], 0
 ; CHECK-NEXT:    br i1 [[CMP1]], label [[LATCH]], label [[EXIT1:%.*]]
 ; CHECK:       latch:
@@ -29,7 +29,7 @@ entry:
   br label %header
 header:
   %iv = phi i32 [0, %entry], [%iv.next, %latch]
-  %v = load volatile i32, i32* @G
+  %v = load volatile i32, ptr @G
   %cmp1 = icmp eq i32 %v, 0
   br i1 %cmp1, label %latch, label %exit1
 
@@ -50,7 +50,7 @@ define i32 @test2(i32 %n) {
 ; CHECK-NEXT:    br label [[HEADER:%.*]]
 ; CHECK:       header:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LATCH:%.*]] ]
-; CHECK-NEXT:    [[V:%.*]] = load volatile i32, i32* @G
+; CHECK-NEXT:    [[V:%.*]] = load volatile i32, ptr @G
 ; CHECK-NEXT:    [[CMP1:%.*]] = icmp eq i32 [[V]], 0
 ; CHECK-NEXT:    br i1 [[CMP1]], label [[LATCH]], label [[EXIT1:%.*]]
 ; CHECK:       latch:
@@ -67,7 +67,7 @@ entry:
   br label %header
 header:
   %iv = phi i32 [0, %entry], [%iv.next, %latch]
-  %v = load volatile i32, i32* @G
+  %v = load volatile i32, ptr @G
   %cmp1 = icmp eq i32 %v, 0
   br i1 %cmp1, label %latch, label %exit1
 
@@ -88,7 +88,7 @@ define i32 @neg_wrong_loop(i32 %n) {
 ; CHECK:       wrong_loop:
 ; CHECK-NEXT:    [[IV2:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV2_NEXT:%.*]], [[WRONG_LOOP]] ]
 ; CHECK-NEXT:    [[IV2_NEXT]] = add i32 [[IV2]], 1
-; CHECK-NEXT:    [[UNKNOWN:%.*]] = load volatile i32, i32* @G
+; CHECK-NEXT:    [[UNKNOWN:%.*]] = load volatile i32, ptr @G
 ; CHECK-NEXT:    [[CMP_UNK:%.*]] = icmp eq i32 [[UNKNOWN]], 0
 ; CHECK-NEXT:    br i1 [[CMP_UNK]], label [[HEADER_PREHEADER:%.*]], label [[WRONG_LOOP]]
 ; CHECK:       header.preheader:
@@ -97,7 +97,7 @@ define i32 @neg_wrong_loop(i32 %n) {
 ; CHECK-NEXT:    br label [[HEADER:%.*]]
 ; CHECK:       header:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ 0, [[HEADER_PREHEADER]] ], [ [[IV_NEXT:%.*]], [[LATCH:%.*]] ]
-; CHECK-NEXT:    [[V:%.*]] = load volatile i32, i32* @G
+; CHECK-NEXT:    [[V:%.*]] = load volatile i32, ptr @G
 ; CHECK-NEXT:    [[CMP1:%.*]] = icmp eq i32 [[V]], 0
 ; CHECK-NEXT:    br i1 [[CMP1]], label [[LATCH]], label [[EXIT1:%.*]]
 ; CHECK:       latch:
@@ -117,7 +117,7 @@ entry:
 wrong_loop:
   %iv2 = phi i32 [0, %entry], [%iv2.next, %wrong_loop]
   %iv2.next = add i32 %iv2, 1
-  %unknown = load volatile i32, i32* @G
+  %unknown = load volatile i32, ptr @G
   %cmp_unk = icmp eq i32 %unknown, 0
   br i1 %cmp_unk, label %header.preheader, label %wrong_loop
 
@@ -127,7 +127,7 @@ header.preheader:
 
 header:
   %iv = phi i32 [0, %header.preheader], [%iv.next, %latch]
-  %v = load volatile i32, i32* @G
+  %v = load volatile i32, ptr @G
   %cmp1 = icmp eq i32 %v, 0
   br i1 %cmp1, label %latch, label %exit1
 
@@ -151,7 +151,7 @@ define i32 @test3(i32 %n) {
 ; CHECK:       header:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LATCH:%.*]] ]
 ; CHECK-NEXT:    [[EXPR:%.*]] = udiv i32 [[IV]], 5
-; CHECK-NEXT:    [[V:%.*]] = load volatile i32, i32* @G
+; CHECK-NEXT:    [[V:%.*]] = load volatile i32, ptr @G
 ; CHECK-NEXT:    [[CMP1:%.*]] = icmp eq i32 [[V]], 0
 ; CHECK-NEXT:    br i1 [[CMP1]], label [[LATCH]], label [[EXIT1:%.*]]
 ; CHECK:       latch:
@@ -170,7 +170,7 @@ entry:
 header:
   %iv = phi i32 [0, %entry], [%iv.next, %latch]
   %expr = udiv i32 %iv, 5
-  %v = load volatile i32, i32* @G
+  %v = load volatile i32, ptr @G
   %cmp1 = icmp eq i32 %v, 0
   br i1 %cmp1, label %latch, label %exit1
 
@@ -194,8 +194,8 @@ define i32 @bounded_find(i32 %n) {
 ; CHECK-NEXT:    br label [[HEADER:%.*]]
 ; CHECK:       header:
 ; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LATCH:%.*]] ]
-; CHECK-NEXT:    [[ADDR:%.*]] = getelementptr i32, i32* @G, i32 [[IV]]
-; CHECK-NEXT:    [[V:%.*]] = load i32, i32* [[ADDR]]
+; CHECK-NEXT:    [[ADDR:%.*]] = getelementptr i32, ptr @G, i32 [[IV]]
+; CHECK-NEXT:    [[V:%.*]] = load i32, ptr [[ADDR]]
 ; CHECK-NEXT:    [[CMP1:%.*]] = icmp eq i32 [[V]], 0
 ; CHECK-NEXT:    br i1 [[CMP1]], label [[LATCH]], label [[EXIT1:%.*]]
 ; CHECK:       latch:
@@ -212,8 +212,8 @@ entry:
   br label %header
 header:
   %iv = phi i32 [0, %entry], [%iv.next, %latch]
-  %addr = getelementptr i32, i32* @G, i32 %iv
-  %v = load i32, i32* %addr
+  %addr = getelementptr i32, ptr @G, i32 %iv
+  %v = load i32, ptr %addr
   %cmp1 = icmp eq i32 %v, 0
   br i1 %cmp1, label %latch, label %exit1
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/scevexpander-phi-base-case.ll b/llvm/test/Transforms/IndVarSimplify/scevexpander-phi-base-case.ll
index 9c8f976be8336..f1db0b289167e 100644
--- a/llvm/test/Transforms/IndVarSimplify/scevexpander-phi-base-case.ll
+++ b/llvm/test/Transforms/IndVarSimplify/scevexpander-phi-base-case.ll
@@ -15,7 +15,7 @@ define i32 @test_nested2(i32 %tnr) {
 
 entry:
   %res = alloca i32, align 4
-  store volatile i32 0, i32* %res, align 4
+  store volatile i32 0, ptr %res, align 4
   %call = call i32 @fn()
   br label %for.cond
 
@@ -39,9 +39,9 @@ for.cond.cleanup3:                                ; preds = %for.cond1
   br label %for.end
 
 for.body4:                                        ; preds = %for.cond1
-  %0 = load volatile i32, i32* %res, align 4
+  %0 = load volatile i32, ptr %res, align 4
   %inc = add nsw i32 %0, 1
-  store volatile i32 %inc, i32* %res, align 4
+  store volatile i32 %inc, ptr %res, align 4
   br label %for.inc
 
 for.inc:                                          ; preds = %for.body4
@@ -56,7 +56,7 @@ for.inc6:                                         ; preds = %for.end
   br label %for.cond
 
 for.end8:                                         ; preds = %for.cond.cleanup
-  %1 = load volatile i32, i32* %res, align 4
+  %1 = load volatile i32, ptr %res, align 4
   %cmp9 = icmp eq i32 %1, 45
   %conv = zext i1 %cmp9 to i32
   ret i32 %conv

diff  --git a/llvm/test/Transforms/IndVarSimplify/sentinel.ll b/llvm/test/Transforms/IndVarSimplify/sentinel.ll
index ce01bdfed9aa4..f9ee4a61f4862 100644
--- a/llvm/test/Transforms/IndVarSimplify/sentinel.ll
+++ b/llvm/test/Transforms/IndVarSimplify/sentinel.ll
@@ -4,7 +4,7 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
 target triple = "x86_64-unknown-linux-gnu"
 
-define void @test() personality i32* ()* @snork {
+define void @test() personality ptr @snork {
 ; CHECK-LABEL: @test(
 ; CHECK-NEXT:  bb:
 ; CHECK-NEXT:    br label [[BB4:%.*]]
@@ -14,14 +14,14 @@ define void @test() personality i32* ()* @snork {
 ; CHECK-NEXT:    [[TMP3:%.*]] = phi i32 [ undef, [[BB1:%.*]] ]
 ; CHECK-NEXT:    ret void
 ; CHECK:       bb4:
-; CHECK-NEXT:    [[TMP6:%.*]] = invoke i32 @quux() [ "deopt"(i32 0, i32 0, i32 0, i32 180, i32 0, i32 25, i32 0, i32 7, i8* null, i32 7, i8* null, i32 7, i8* null, i32 3, i32 undef, i32 3, i32 undef, i32 7, i8* null, i32 3, i32 undef, i32 3, i32 undef, i32 3, i32 undef, i32 3, i32 undef, i32 4, double undef, i32 7, i8* null, i32 4, i64 undef, i32 7, i8* null, i32 0, i8 addrspace(1)* undef, i32 3, i32 undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 7, i8* null) ]
+; CHECK-NEXT:    [[TMP6:%.*]] = invoke i32 @quux() [ "deopt"(i32 0, i32 0, i32 0, i32 180, i32 0, i32 25, i32 0, i32 7, ptr null, i32 7, ptr null, i32 7, ptr null, i32 3, i32 undef, i32 3, i32 undef, i32 7, ptr null, i32 3, i32 undef, i32 3, i32 undef, i32 3, i32 undef, i32 3, i32 undef, i32 4, double undef, i32 7, ptr null, i32 4, i64 undef, i32 7, ptr null, i32 0, ptr addrspace(1) undef, i32 3, i32 undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 7, ptr null) ]
 ; CHECK-NEXT:    to label [[BB7:%.*]] unwind label [[BB15:%.*]]
 ; CHECK:       bb7:
 ; CHECK-NEXT:    br label [[BB9:%.*]]
 ; CHECK:       bb9:
 ; CHECK-NEXT:    br i1 true, label [[BB1]], label [[BB9]]
 ; CHECK:       bb15:
-; CHECK-NEXT:    [[TMP16:%.*]] = landingpad { i8*, i32 }
+; CHECK-NEXT:    [[TMP16:%.*]] = landingpad { ptr, i32 }
 ; CHECK-NEXT:    cleanup
 ; CHECK-NEXT:    ret void
 ;
@@ -39,7 +39,7 @@ bb2:                                              ; preds = %bb1
 
 bb4:                                              ; preds = %bb1, %bb
   %tmp5 = phi i32 [ %tmp8, %bb1 ], [ undef, %bb ]
-  %tmp6 = invoke i32 @quux() #2 [ "deopt"(i32 0, i32 0, i32 0, i32 180, i32 0, i32 25, i32 0, i32 7, i8* null, i32 7, i8* null, i32 7, i8* null, i32 3, i32 %tmp5, i32 3, i32 undef, i32 7, i8* null, i32 3, i32 undef, i32 3, i32 undef, i32 3, i32 undef, i32 3, i32 undef, i32 4, double undef, i32 7, i8* null, i32 4, i64 undef, i32 7, i8* null, i32 0, i8 addrspace(1)* undef, i32 3, i32 undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 0, i8 addrspace(1)* undef, i32 7, i8* null) ]
+  %tmp6 = invoke i32 @quux() #2 [ "deopt"(i32 0, i32 0, i32 0, i32 180, i32 0, i32 25, i32 0, i32 7, ptr null, i32 7, ptr null, i32 7, ptr null, i32 3, i32 %tmp5, i32 3, i32 undef, i32 7, ptr null, i32 3, i32 undef, i32 3, i32 undef, i32 3, i32 undef, i32 3, i32 undef, i32 4, double undef, i32 7, ptr null, i32 4, i64 undef, i32 7, ptr null, i32 0, ptr addrspace(1) undef, i32 3, i32 undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 0, ptr addrspace(1) undef, i32 7, ptr null) ]
   to label %bb7 unwind label %bb15
 
 bb7:                                              ; preds = %bb4
@@ -55,12 +55,12 @@ bb9:                                              ; preds = %bb9, %bb7
   br i1 %tmp14, label %bb1, label %bb9
 
 bb15:                                             ; preds = %bb4
-  %tmp16 = landingpad { i8*, i32 }
+  %tmp16 = landingpad { ptr, i32 }
   cleanup
   ret void
 }
 
-declare i32* @snork()
+declare ptr @snork()
 
 declare i32 @quux()
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/shared-exit-between-nested-loop.ll b/llvm/test/Transforms/IndVarSimplify/shared-exit-between-nested-loop.ll
index 360b08eb4afcd..9a46473cc5a0f 100644
--- a/llvm/test/Transforms/IndVarSimplify/shared-exit-between-nested-loop.ll
+++ b/llvm/test/Transforms/IndVarSimplify/shared-exit-between-nested-loop.ll
@@ -20,8 +20,8 @@ if.then:                                          ; preds = %for.cond4
 ; CHECK-NEXT:     br i1 false, label %cleanup, label %for.inc
   %add = add nuw nsw i32 %storemerge2531, 2
   %idxprom8 = zext i32 %add to i64
-  %arrayidx10 = getelementptr inbounds <{ <{ [2 x i32], [2 x i32], [8 x [2 x i32]] }>, [10 x [2 x i32]] }>, <{ <{ [2 x i32], [2 x i32], [8 x [2 x i32]] }>, [10 x [2 x i32]] }>* @__const.e.f, i64 0, i32 1, i64 %idxprom8, i64 0
-  %0 = load i32, i32* %arrayidx10, align 4
+  %arrayidx10 = getelementptr inbounds <{ <{ [2 x i32], [2 x i32], [8 x [2 x i32]] }>, [10 x [2 x i32]] }>, ptr @__const.e.f, i64 0, i32 1, i64 %idxprom8, i64 0
+  %0 = load i32, ptr %arrayidx10, align 4
   %tobool11 = icmp eq i32 %0, 0
   br i1 %tobool11, label %cleanup, label %for.inc
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/sharpen-range.ll b/llvm/test/Transforms/IndVarSimplify/sharpen-range.ll
index a994213deff80..f07e8b07251de 100644
--- a/llvm/test/Transforms/IndVarSimplify/sharpen-range.ll
+++ b/llvm/test/Transforms/IndVarSimplify/sharpen-range.ll
@@ -6,10 +6,10 @@
 
 declare void @abort()
 
-define i1 @bounded_below_slt(i32* nocapture readonly %buffer) {
+define i1 @bounded_below_slt(ptr nocapture readonly %buffer) {
 ; CHECK-LABEL: bounded_below_slt
 entry:
-  %length = load i32, i32* %buffer, !range !0
+  %length = load i32, ptr %buffer, !range !0
   %entry.pred = icmp eq i32 %length, 0
   br i1 %entry.pred, label %abort, label %loop.preheader
 
@@ -40,10 +40,10 @@ oob:
   ret i1 false
 }
 
-define i1 @bounded_below_sle(i32* nocapture readonly %buffer) {
+define i1 @bounded_below_sle(ptr nocapture readonly %buffer) {
 ; CHECK-LABEL: bounded_below_sle
 entry:
-  %length = load i32, i32* %buffer, !range !0
+  %length = load i32, ptr %buffer, !range !0
   %entry.pred = icmp eq i32 %length, 0
   br i1 %entry.pred, label %abort, label %loop.preheader
 
@@ -76,7 +76,7 @@ oob:
 
 ;; Assert that we're not making an incorrect transform.
 
-declare i32 @check(i8*)
+declare i32 @check(ptr)
 
 define void @NoChange() {
 ; CHECK-LABEL: NoChange
@@ -93,8 +93,8 @@ loop.begin:
 loop:
 ; CHECK: loop
   %.sum = add i64 %i.01, -2
-  %v = getelementptr inbounds i8, i8* null, i64 %.sum
-  %r = tail call i32 @check(i8* %v)
+  %v = getelementptr inbounds i8, ptr null, i64 %.sum
+  %r = tail call i32 @check(ptr %v)
   %c = icmp eq i32 %r, 0
   br i1 %c, label %loop.end, label %abort.now
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/shift-range-checks.ll b/llvm/test/Transforms/IndVarSimplify/shift-range-checks.ll
index aa28792c12b95..0282114d0762d 100644
--- a/llvm/test/Transforms/IndVarSimplify/shift-range-checks.ll
+++ b/llvm/test/Transforms/IndVarSimplify/shift-range-checks.ll
@@ -4,10 +4,10 @@
 declare i1 @cond()
 declare void @exit(i32 %code)
 
-define void @test_01(i32* %p, i32 %shift) {
+define void @test_01(ptr %p, i32 %shift) {
 ; CHECK-LABEL: @test_01(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0:![0-9]+]]
 ; CHECK-NEXT:    [[X_SHIFTED:%.*]] = lshr i32 [[X]], [[SHIFT:%.*]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
@@ -30,7 +30,7 @@ define void @test_01(i32* %p, i32 %shift) {
 ; CHECK-NEXT:    unreachable
 ;
 entry:
-  %x = load i32, i32* %p, !range !0
+  %x = load i32, ptr %p, !range !0
   %x.shifted = lshr i32 %x, %shift
   br label %loop
 
@@ -60,10 +60,10 @@ never_happens:
   unreachable
 }
 
-define void @test_02(i32* %p, i32 %shift) {
+define void @test_02(ptr %p, i32 %shift) {
 ; CHECK-LABEL: @test_02(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    [[X_SHIFTED:%.*]] = lshr i32 [[X]], [[SHIFT:%.*]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
@@ -86,7 +86,7 @@ define void @test_02(i32* %p, i32 %shift) {
 ; CHECK-NEXT:    unreachable
 ;
 entry:
-  %x = load i32, i32* %p, !range !0
+  %x = load i32, ptr %p, !range !0
   %x.shifted = lshr i32 %x, %shift
   br label %loop
 
@@ -116,10 +116,10 @@ never_happens:
   unreachable
 }
 
-define void @test_03(i32* %p, i32 %shift) {
+define void @test_03(ptr %p, i32 %shift) {
 ; CHECK-LABEL: @test_03(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    [[X_SHIFTED:%.*]] = lshr i32 [[X]], [[SHIFT:%.*]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
@@ -142,7 +142,7 @@ define void @test_03(i32* %p, i32 %shift) {
 ; CHECK-NEXT:    unreachable
 ;
 entry:
-  %x = load i32, i32* %p, !range !0
+  %x = load i32, ptr %p, !range !0
   %x.shifted = lshr i32 %x, %shift
   br label %loop
 
@@ -172,10 +172,10 @@ never_happens:
   unreachable
 }
 
-define void @test_04(i32* %p, i32 %shift) {
+define void @test_04(ptr %p, i32 %shift) {
 ; CHECK-LABEL: @test_04(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* [[P:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT:    [[X:%.*]] = load i32, ptr [[P:%.*]], align 4, !range [[RNG0]]
 ; CHECK-NEXT:    [[X_SHIFTED:%.*]] = lshr i32 [[X]], [[SHIFT:%.*]]
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
@@ -198,7 +198,7 @@ define void @test_04(i32* %p, i32 %shift) {
 ; CHECK-NEXT:    unreachable
 ;
 entry:
-  %x = load i32, i32* %p, !range !0
+  %x = load i32, ptr %p, !range !0
   %x.shifted = lshr i32 %x, %shift
   br label %loop
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/shrunk-constant.ll b/llvm/test/Transforms/IndVarSimplify/shrunk-constant.ll
index baa30134ff7ea..8ec8ec2c9e1f2 100644
--- a/llvm/test/Transforms/IndVarSimplify/shrunk-constant.ll
+++ b/llvm/test/Transforms/IndVarSimplify/shrunk-constant.ll
@@ -10,7 +10,7 @@ loop:
 	%i = phi i32 [ 0, %entry ], [ %t2, %loop ]
 	%t0 = add i32 %i, 9
 	%t1 = and i32 %t0, 9
-        store i32 %t1, i32* null
+        store i32 %t1, ptr null
 	%t2 = add i32 %i, 8
 	br label %loop
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/signed-trip-count.ll b/llvm/test/Transforms/IndVarSimplify/signed-trip-count.ll
index 391faaebf3875..0025c3537951d 100644
--- a/llvm/test/Transforms/IndVarSimplify/signed-trip-count.ll
+++ b/llvm/test/Transforms/IndVarSimplify/signed-trip-count.ll
@@ -4,7 +4,7 @@
 target datalayout = "e-p:32:32:32-n8:16:32:64"
 
 
-define void @foo(i64* nocapture %x, i32 %n) nounwind {
+define void @foo(ptr nocapture %x, i32 %n) nounwind {
 ; CHECK-LABEL: @foo(
 ; CHECK-NOT: sext
 ; CHECK: phi
@@ -19,8 +19,8 @@ bb.nph:		; preds = %entry
 bb:		; preds = %bb7, %bb.nph
 	%i.01 = phi i32 [ %tmp6, %bb7 ], [ 0, %bb.nph ]		; <i32> [#uses=3]
 	%tmp1 = sext i32 %i.01 to i64		; <i64> [#uses=1]
-	%tmp4 = getelementptr i64, i64* %x, i32 %i.01		; <i64*> [#uses=1]
-	store i64 %tmp1, i64* %tmp4, align 8
+	%tmp4 = getelementptr i64, ptr %x, i32 %i.01		; <ptr> [#uses=1]
+	store i64 %tmp1, ptr %tmp4, align 8
 	%tmp6 = add i32 %i.01, 1		; <i32> [#uses=2]
 	br label %bb7
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/simplify-pointer-arithmetic.ll b/llvm/test/Transforms/IndVarSimplify/simplify-pointer-arithmetic.ll
index e462cb329880f..7c3562943e16e 100644
--- a/llvm/test/Transforms/IndVarSimplify/simplify-pointer-arithmetic.ll
+++ b/llvm/test/Transforms/IndVarSimplify/simplify-pointer-arithmetic.ll
@@ -5,11 +5,11 @@
 
 ; %len is zero-extended before being used to compute %p.end, which guarantees
 ; the offset is positive. %i.ult.ext can be simplified.
-define i1 @can_simplify_ult_i32_ptr_len_zext(i32* %p.base, i32 %len) {
+define i1 @can_simplify_ult_i32_ptr_len_zext(ptr %p.base, i32 %len) {
 ; CHECK-LABEL: @can_simplify_ult_i32_ptr_len_zext(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[EXT:%.*]] = zext i32 [[LEN:%.*]] to i64
-; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, i32* [[P_BASE:%.*]], i64 [[EXT]]
+; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, ptr [[P_BASE:%.*]], i64 [[EXT]]
 ; CHECK-NEXT:    [[LEN_NONZERO:%.*]] = icmp ne i32 [[LEN]], 0
 ; CHECK-NEXT:    br i1 [[LEN_NONZERO]], label [[HEADER_PREHEADER:%.*]], label [[TRAP:%.*]]
 ; CHECK:       header.preheader:
@@ -19,22 +19,22 @@ define i1 @can_simplify_ult_i32_ptr_len_zext(i32* %p.base, i32 %len) {
 ; CHECK:       trap:
 ; CHECK-NEXT:    ret i1 false
 ; CHECK:       header:
-; CHECK-NEXT:    [[P:%.*]] = phi i32* [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
+; CHECK-NEXT:    [[P:%.*]] = phi ptr [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I:%.*]] = phi i64 [ [[I_INC:%.*]], [[LATCH]] ], [ 0, [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i64 [[I]], 1
 ; CHECK-NEXT:    [[I_ULT_EXT:%.*]] = icmp ult i64 [[I]], [[EXT]]
 ; CHECK-NEXT:    br i1 [[I_ULT_EXT]], label [[LATCH]], label [[TRAP_LOOPEXIT:%.*]]
 ; CHECK:       latch:
-; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, i32* [[P]], i64 1
-; CHECK-NEXT:    [[C:%.*]] = icmp ne i32* [[P_INC]], [[P_END]]
-; CHECK-NEXT:    store i32 0, i32* [[P]], align 4
+; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, ptr [[P]], i64 1
+; CHECK-NEXT:    [[C:%.*]] = icmp ne ptr [[P_INC]], [[P_END]]
+; CHECK-NEXT:    store i32 0, ptr [[P]], align 4
 ; CHECK-NEXT:    br i1 [[C]], label [[HEADER]], label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret i1 true
 ;
 entry:
   %ext = zext i32 %len to i64
-  %p.end = getelementptr inbounds i32, i32* %p.base, i64 %ext
+  %p.end = getelementptr inbounds i32, ptr %p.base, i64 %ext
   %len.nonzero = icmp ne i32 %len, 0
   br i1 %len.nonzero, label %header, label %trap
 
@@ -42,16 +42,16 @@ trap:
   ret i1 false
 
 header:
-  %p = phi i32* [ %p.base, %entry ], [ %p.inc, %latch ]
+  %p = phi ptr [ %p.base, %entry ], [ %p.inc, %latch ]
   %i = phi i64 [ 0, %entry ], [ %i.inc, %latch]
   %i.inc = add nsw nuw i64 %i, 1
   %i.ult.ext = icmp ult i64 %i, %ext
   br i1 %i.ult.ext, label %latch, label %trap
 
 latch:
-  %p.inc = getelementptr inbounds i32, i32* %p, i64 1
-  %c = icmp ne i32* %p.inc, %p.end
-  store i32 0, i32* %p
+  %p.inc = getelementptr inbounds i32, ptr %p, i64 1
+  %c = icmp ne ptr %p.inc, %p.end
+  store i32 0, ptr %p
   br i1 %c, label %header, label %exit
 
 exit:
@@ -59,10 +59,10 @@ exit:
 }
 
 ; %len may be (signed) negative, %i.ult.ext cannot be simplified.
-define i1 @cannot_simplify_ult_i32_ptr_len_ult(i32* %p.base, i64 %len) {
+define i1 @cannot_simplify_ult_i32_ptr_len_ult(ptr %p.base, i64 %len) {
 ; CHECK-LABEL: @cannot_simplify_ult_i32_ptr_len_ult(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, i32* [[P_BASE:%.*]], i64 [[LEN:%.*]]
+; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, ptr [[P_BASE:%.*]], i64 [[LEN:%.*]]
 ; CHECK-NEXT:    [[LEN_NONZERO:%.*]] = icmp ne i64 [[LEN]], 0
 ; CHECK-NEXT:    br i1 [[LEN_NONZERO]], label [[HEADER_PREHEADER:%.*]], label [[TRAP:%.*]]
 ; CHECK:       header.preheader:
@@ -72,21 +72,21 @@ define i1 @cannot_simplify_ult_i32_ptr_len_ult(i32* %p.base, i64 %len) {
 ; CHECK:       trap:
 ; CHECK-NEXT:    ret i1 false
 ; CHECK:       header:
-; CHECK-NEXT:    [[P:%.*]] = phi i32* [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
+; CHECK-NEXT:    [[P:%.*]] = phi ptr [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I:%.*]] = phi i64 [ [[I_INC:%.*]], [[LATCH]] ], [ 0, [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i64 [[I]], 1
 ; CHECK-NEXT:    [[I_ULT_EXT:%.*]] = icmp ult i64 [[I]], [[LEN]]
 ; CHECK-NEXT:    br i1 [[I_ULT_EXT]], label [[LATCH]], label [[TRAP_LOOPEXIT:%.*]]
 ; CHECK:       latch:
-; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, i32* [[P]], i64 1
-; CHECK-NEXT:    [[C:%.*]] = icmp ne i32* [[P_INC]], [[P_END]]
-; CHECK-NEXT:    store i32 0, i32* [[P]], align 4
+; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, ptr [[P]], i64 1
+; CHECK-NEXT:    [[C:%.*]] = icmp ne ptr [[P_INC]], [[P_END]]
+; CHECK-NEXT:    store i32 0, ptr [[P]], align 4
 ; CHECK-NEXT:    br i1 [[C]], label [[HEADER]], label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret i1 true
 ;
 entry:
-  %p.end = getelementptr inbounds i32, i32* %p.base, i64 %len
+  %p.end = getelementptr inbounds i32, ptr %p.base, i64 %len
   %len.nonzero = icmp ne i64 %len, 0
   br i1 %len.nonzero, label %header, label %trap
 
@@ -94,16 +94,16 @@ trap:
   ret i1 false
 
 header:
-  %p = phi i32* [ %p.base, %entry ], [ %p.inc, %latch ]
+  %p = phi ptr [ %p.base, %entry ], [ %p.inc, %latch ]
   %i = phi i64 [ 0, %entry ], [ %i.inc, %latch]
   %i.inc = add nsw nuw i64 %i, 1
   %i.ult.ext = icmp ult i64 %i, %len
   br i1 %i.ult.ext, label %latch, label %trap
 
 latch:
-  %p.inc = getelementptr inbounds i32, i32* %p, i64 1
-  %c = icmp ne i32* %p.inc, %p.end
-  store i32 0, i32* %p
+  %p.inc = getelementptr inbounds i32, ptr %p, i64 1
+  %c = icmp ne ptr %p.inc, %p.end
+  store i32 0, ptr %p
   br i1 %c, label %header, label %exit
 
 exit:
@@ -111,11 +111,11 @@ exit:
 }
 
 ; Similar to can_simplify_ult_i32_ptr_len_zext, but %i has 1 as start value. %i.ult.ext cannot be simplified.
-define i1 @cannot_simplify_ult_i32_ptr_len_zext(i32* %p.base, i32 %len) {
+define i1 @cannot_simplify_ult_i32_ptr_len_zext(ptr %p.base, i32 %len) {
 ; CHECK-LABEL: @cannot_simplify_ult_i32_ptr_len_zext(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[EXT:%.*]] = zext i32 [[LEN:%.*]] to i64
-; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, i32* [[P_BASE:%.*]], i64 [[EXT]]
+; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, ptr [[P_BASE:%.*]], i64 [[EXT]]
 ; CHECK-NEXT:    [[LEN_NONZERO:%.*]] = icmp ne i32 [[LEN]], 0
 ; CHECK-NEXT:    br i1 [[LEN_NONZERO]], label [[HEADER_PREHEADER:%.*]], label [[TRAP:%.*]]
 ; CHECK:       header.preheader:
@@ -125,22 +125,22 @@ define i1 @cannot_simplify_ult_i32_ptr_len_zext(i32* %p.base, i32 %len) {
 ; CHECK:       trap:
 ; CHECK-NEXT:    ret i1 false
 ; CHECK:       header:
-; CHECK-NEXT:    [[P:%.*]] = phi i32* [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
+; CHECK-NEXT:    [[P:%.*]] = phi ptr [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I:%.*]] = phi i64 [ [[I_INC:%.*]], [[LATCH]] ], [ 1, [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i64 [[I]], 1
 ; CHECK-NEXT:    [[I_ULT_EXT:%.*]] = icmp ult i64 [[I]], [[EXT]]
 ; CHECK-NEXT:    br i1 [[I_ULT_EXT]], label [[LATCH]], label [[TRAP_LOOPEXIT:%.*]]
 ; CHECK:       latch:
-; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, i32* [[P]], i64 1
-; CHECK-NEXT:    [[C:%.*]] = icmp ne i32* [[P_INC]], [[P_END]]
-; CHECK-NEXT:    store i32 0, i32* [[P]], align 4
+; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, ptr [[P]], i64 1
+; CHECK-NEXT:    [[C:%.*]] = icmp ne ptr [[P_INC]], [[P_END]]
+; CHECK-NEXT:    store i32 0, ptr [[P]], align 4
 ; CHECK-NEXT:    br i1 [[C]], label [[HEADER]], label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret i1 true
 ;
 entry:
   %ext = zext i32 %len to i64
-  %p.end = getelementptr inbounds i32, i32* %p.base, i64 %ext
+  %p.end = getelementptr inbounds i32, ptr %p.base, i64 %ext
   %len.nonzero = icmp ne i32 %len, 0
   br i1 %len.nonzero, label %header, label %trap
 
@@ -148,27 +148,27 @@ trap:
   ret i1 false
 
 header:
-  %p = phi i32* [ %p.base, %entry ], [ %p.inc, %latch ]
+  %p = phi ptr [ %p.base, %entry ], [ %p.inc, %latch ]
   %i = phi i64 [ 1, %entry ], [ %i.inc, %latch]
   %i.inc = add nsw nuw i64 %i, 1
   %i.ult.ext = icmp ult i64 %i, %ext
   br i1 %i.ult.ext, label %latch, label %trap
 
 latch:
-  %p.inc = getelementptr inbounds i32, i32* %p, i64 1
-  %c = icmp ne i32* %p.inc, %p.end
-  store i32 0, i32* %p
+  %p.inc = getelementptr inbounds i32, ptr %p, i64 1
+  %c = icmp ne ptr %p.inc, %p.end
+  store i32 0, ptr %p
   br i1 %c, label %header, label %exit
 
 exit:
   ret i1 true
 }
 
-define i1 @can_simplify_ule_i32_ptr_len_zext(i32* %p.base, i32 %len) {
+define i1 @can_simplify_ule_i32_ptr_len_zext(ptr %p.base, i32 %len) {
 ; CHECK-LABEL: @can_simplify_ule_i32_ptr_len_zext(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[EXT:%.*]] = zext i32 [[LEN:%.*]] to i64
-; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, i32* [[P_BASE:%.*]], i64 [[EXT]]
+; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, ptr [[P_BASE:%.*]], i64 [[EXT]]
 ; CHECK-NEXT:    [[LEN_NONZERO:%.*]] = icmp ne i32 [[LEN]], 0
 ; CHECK-NEXT:    br i1 [[LEN_NONZERO]], label [[HEADER_PREHEADER:%.*]], label [[TRAP:%.*]]
 ; CHECK:       header.preheader:
@@ -178,22 +178,22 @@ define i1 @can_simplify_ule_i32_ptr_len_zext(i32* %p.base, i32 %len) {
 ; CHECK:       trap:
 ; CHECK-NEXT:    ret i1 false
 ; CHECK:       header:
-; CHECK-NEXT:    [[P:%.*]] = phi i32* [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
+; CHECK-NEXT:    [[P:%.*]] = phi ptr [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I:%.*]] = phi i64 [ [[I_INC:%.*]], [[LATCH]] ], [ 1, [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i64 [[I]], 1
 ; CHECK-NEXT:    [[I_ULT_EXT:%.*]] = icmp ule i64 [[I]], [[EXT]]
 ; CHECK-NEXT:    br i1 [[I_ULT_EXT]], label [[LATCH]], label [[TRAP_LOOPEXIT:%.*]]
 ; CHECK:       latch:
-; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, i32* [[P]], i64 1
-; CHECK-NEXT:    [[C:%.*]] = icmp ne i32* [[P_INC]], [[P_END]]
-; CHECK-NEXT:    store i32 0, i32* [[P]], align 4
+; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, ptr [[P]], i64 1
+; CHECK-NEXT:    [[C:%.*]] = icmp ne ptr [[P_INC]], [[P_END]]
+; CHECK-NEXT:    store i32 0, ptr [[P]], align 4
 ; CHECK-NEXT:    br i1 [[C]], label [[HEADER]], label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret i1 true
 ;
 entry:
   %ext = zext i32 %len to i64
-  %p.end = getelementptr inbounds i32, i32* %p.base, i64 %ext
+  %p.end = getelementptr inbounds i32, ptr %p.base, i64 %ext
   %len.nonzero = icmp ne i32 %len, 0
   br i1 %len.nonzero, label %header, label %trap
 
@@ -201,16 +201,16 @@ trap:
   ret i1 false
 
 header:
-  %p = phi i32* [ %p.base, %entry ], [ %p.inc, %latch ]
+  %p = phi ptr [ %p.base, %entry ], [ %p.inc, %latch ]
   %i = phi i64 [ 1, %entry ], [ %i.inc, %latch]
   %i.inc = add nsw nuw i64 %i, 1
   %i.ult.ext = icmp ule i64 %i, %ext
   br i1 %i.ult.ext, label %latch, label %trap
 
 latch:
-  %p.inc = getelementptr inbounds i32, i32* %p, i64 1
-  %c = icmp ne i32* %p.inc, %p.end
-  store i32 0, i32* %p
+  %p.inc = getelementptr inbounds i32, ptr %p, i64 1
+  %c = icmp ne ptr %p.inc, %p.end
+  store i32 0, ptr %p
   br i1 %c, label %header, label %exit
 
 exit:
@@ -219,11 +219,11 @@ exit:
 
 ; %len is zero-extended before being used to compute %p.end, which guarantees
 ; the offset is positive. %i.uge.ext can be simplified.
-define i1 @can_simplify_uge_i32_ptr_len_zext(i32* %p.base, i32 %len) {
+define i1 @can_simplify_uge_i32_ptr_len_zext(ptr %p.base, i32 %len) {
 ; CHECK-LABEL: @can_simplify_uge_i32_ptr_len_zext(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[EXT:%.*]] = zext i32 [[LEN:%.*]] to i64
-; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, i32* [[P_BASE:%.*]], i64 [[EXT]]
+; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, ptr [[P_BASE:%.*]], i64 [[EXT]]
 ; CHECK-NEXT:    [[LEN_NONZERO:%.*]] = icmp ne i32 [[LEN]], 0
 ; CHECK-NEXT:    br i1 [[LEN_NONZERO]], label [[HEADER_PREHEADER:%.*]], label [[TRAP:%.*]]
 ; CHECK:       header.preheader:
@@ -233,22 +233,22 @@ define i1 @can_simplify_uge_i32_ptr_len_zext(i32* %p.base, i32 %len) {
 ; CHECK:       trap:
 ; CHECK-NEXT:    ret i1 false
 ; CHECK:       header:
-; CHECK-NEXT:    [[P:%.*]] = phi i32* [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
+; CHECK-NEXT:    [[P:%.*]] = phi ptr [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I:%.*]] = phi i64 [ [[I_INC:%.*]], [[LATCH]] ], [ 0, [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i64 [[I]], 1
 ; CHECK-NEXT:    [[I_UGE_EXT:%.*]] = icmp uge i64 [[I]], [[EXT]]
 ; CHECK-NEXT:    br i1 [[I_UGE_EXT]], label [[TRAP_LOOPEXIT:%.*]], label [[LATCH]]
 ; CHECK:       latch:
-; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, i32* [[P]], i64 1
-; CHECK-NEXT:    [[C:%.*]] = icmp ne i32* [[P_INC]], [[P_END]]
-; CHECK-NEXT:    store i32 0, i32* [[P]], align 4
+; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, ptr [[P]], i64 1
+; CHECK-NEXT:    [[C:%.*]] = icmp ne ptr [[P_INC]], [[P_END]]
+; CHECK-NEXT:    store i32 0, ptr [[P]], align 4
 ; CHECK-NEXT:    br i1 [[C]], label [[HEADER]], label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret i1 true
 ;
 entry:
   %ext = zext i32 %len to i64
-  %p.end = getelementptr inbounds i32, i32* %p.base, i64 %ext
+  %p.end = getelementptr inbounds i32, ptr %p.base, i64 %ext
   %len.nonzero = icmp ne i32 %len, 0
   br i1 %len.nonzero, label %header, label %trap
 
@@ -256,26 +256,26 @@ trap:
   ret i1 false
 
 header:
-  %p = phi i32* [ %p.base, %entry ], [ %p.inc, %latch ]
+  %p = phi ptr [ %p.base, %entry ], [ %p.inc, %latch ]
   %i = phi i64 [ 0, %entry ], [ %i.inc, %latch]
   %i.inc = add nsw nuw i64 %i, 1
   %i.uge.ext = icmp uge i64 %i, %ext
   br i1 %i.uge.ext, label %trap, label %latch
 
 latch:
-  %p.inc = getelementptr inbounds i32, i32* %p, i64 1
-  %c = icmp ne i32* %p.inc, %p.end
-  store i32 0, i32* %p
+  %p.inc = getelementptr inbounds i32, ptr %p, i64 1
+  %c = icmp ne ptr %p.inc, %p.end
+  store i32 0, ptr %p
   br i1 %c, label %header, label %exit
 
 exit:
   ret i1 true
 }
 
-define i1 @cannot_simplify_uge_i32_ptr_len(i32* %p.base, i64 %len) {
+define i1 @cannot_simplify_uge_i32_ptr_len(ptr %p.base, i64 %len) {
 ; CHECK-LABEL: @cannot_simplify_uge_i32_ptr_len(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, i32* [[P_BASE:%.*]], i64 [[LEN:%.*]]
+; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, ptr [[P_BASE:%.*]], i64 [[LEN:%.*]]
 ; CHECK-NEXT:    [[LEN_NONZERO:%.*]] = icmp ne i64 [[LEN]], 0
 ; CHECK-NEXT:    br i1 [[LEN_NONZERO]], label [[HEADER_PREHEADER:%.*]], label [[TRAP:%.*]]
 ; CHECK:       header.preheader:
@@ -285,21 +285,21 @@ define i1 @cannot_simplify_uge_i32_ptr_len(i32* %p.base, i64 %len) {
 ; CHECK:       trap:
 ; CHECK-NEXT:    ret i1 false
 ; CHECK:       header:
-; CHECK-NEXT:    [[P:%.*]] = phi i32* [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
+; CHECK-NEXT:    [[P:%.*]] = phi ptr [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I:%.*]] = phi i64 [ [[I_INC:%.*]], [[LATCH]] ], [ 0, [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i64 [[I]], 1
 ; CHECK-NEXT:    [[I_UGE_EXT:%.*]] = icmp uge i64 [[I]], [[LEN]]
 ; CHECK-NEXT:    br i1 [[I_UGE_EXT]], label [[TRAP_LOOPEXIT:%.*]], label [[LATCH]]
 ; CHECK:       latch:
-; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, i32* [[P]], i64 1
-; CHECK-NEXT:    [[C:%.*]] = icmp ne i32* [[P_INC]], [[P_END]]
-; CHECK-NEXT:    store i32 0, i32* [[P]], align 4
+; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, ptr [[P]], i64 1
+; CHECK-NEXT:    [[C:%.*]] = icmp ne ptr [[P_INC]], [[P_END]]
+; CHECK-NEXT:    store i32 0, ptr [[P]], align 4
 ; CHECK-NEXT:    br i1 [[C]], label [[HEADER]], label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret i1 true
 ;
 entry:
-  %p.end = getelementptr inbounds i32, i32* %p.base, i64 %len
+  %p.end = getelementptr inbounds i32, ptr %p.base, i64 %len
   %len.nonzero = icmp ne i64 %len, 0
   br i1 %len.nonzero, label %header, label %trap
 
@@ -307,27 +307,27 @@ trap:
   ret i1 false
 
 header:
-  %p = phi i32* [ %p.base, %entry ], [ %p.inc, %latch ]
+  %p = phi ptr [ %p.base, %entry ], [ %p.inc, %latch ]
   %i = phi i64 [ 0, %entry ], [ %i.inc, %latch]
   %i.inc = add nsw nuw i64 %i, 1
   %i.uge.ext = icmp uge i64 %i, %len
   br i1 %i.uge.ext, label %trap, label %latch
 
 latch:
-  %p.inc = getelementptr inbounds i32, i32* %p, i64 1
-  %c = icmp ne i32* %p.inc, %p.end
-  store i32 0, i32* %p
+  %p.inc = getelementptr inbounds i32, ptr %p, i64 1
+  %c = icmp ne ptr %p.inc, %p.end
+  store i32 0, ptr %p
   br i1 %c, label %header, label %exit
 
 exit:
   ret i1 true
 }
 
-define i1 @cannot_simplify_uge_i32_ptr_len_zext_step_2(i32* %p.base, i32 %len) {
+define i1 @cannot_simplify_uge_i32_ptr_len_zext_step_2(ptr %p.base, i32 %len) {
 ; CHECK-LABEL: @cannot_simplify_uge_i32_ptr_len_zext_step_2(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[EXT:%.*]] = zext i32 [[LEN:%.*]] to i64
-; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, i32* [[P_BASE:%.*]], i64 [[EXT]]
+; CHECK-NEXT:    [[P_END:%.*]] = getelementptr inbounds i32, ptr [[P_BASE:%.*]], i64 [[EXT]]
 ; CHECK-NEXT:    [[LEN_NONZERO:%.*]] = icmp ne i32 [[LEN]], 0
 ; CHECK-NEXT:    br i1 [[LEN_NONZERO]], label [[HEADER_PREHEADER:%.*]], label [[TRAP:%.*]]
 ; CHECK:       header.preheader:
@@ -337,22 +337,22 @@ define i1 @cannot_simplify_uge_i32_ptr_len_zext_step_2(i32* %p.base, i32 %len) {
 ; CHECK:       trap:
 ; CHECK-NEXT:    ret i1 false
 ; CHECK:       header:
-; CHECK-NEXT:    [[P:%.*]] = phi i32* [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
+; CHECK-NEXT:    [[P:%.*]] = phi ptr [ [[P_INC:%.*]], [[LATCH:%.*]] ], [ [[P_BASE]], [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I:%.*]] = phi i64 [ [[I_INC:%.*]], [[LATCH]] ], [ 0, [[HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[I_INC]] = add nuw nsw i64 [[I]], 2
 ; CHECK-NEXT:    [[I_UGE_EXT:%.*]] = icmp uge i64 [[I]], [[EXT]]
 ; CHECK-NEXT:    br i1 [[I_UGE_EXT]], label [[TRAP_LOOPEXIT:%.*]], label [[LATCH]]
 ; CHECK:       latch:
-; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, i32* [[P]], i64 1
-; CHECK-NEXT:    [[C:%.*]] = icmp ne i32* [[P_INC]], [[P_END]]
-; CHECK-NEXT:    store i32 0, i32* [[P]], align 4
+; CHECK-NEXT:    [[P_INC]] = getelementptr inbounds i32, ptr [[P]], i64 1
+; CHECK-NEXT:    [[C:%.*]] = icmp ne ptr [[P_INC]], [[P_END]]
+; CHECK-NEXT:    store i32 0, ptr [[P]], align 4
 ; CHECK-NEXT:    br i1 [[C]], label [[HEADER]], label [[EXIT:%.*]]
 ; CHECK:       exit:
 ; CHECK-NEXT:    ret i1 true
 ;
 entry:
   %ext = zext i32 %len to i64
-  %p.end = getelementptr inbounds i32, i32* %p.base, i64 %ext
+  %p.end = getelementptr inbounds i32, ptr %p.base, i64 %ext
   %len.nonzero = icmp ne i32 %len, 0
   br i1 %len.nonzero, label %header, label %trap
 
@@ -360,16 +360,16 @@ trap:
   ret i1 false
 
 header:
-  %p = phi i32* [ %p.base, %entry ], [ %p.inc, %latch ]
+  %p = phi ptr [ %p.base, %entry ], [ %p.inc, %latch ]
   %i = phi i64 [ 0, %entry ], [ %i.inc, %latch]
   %i.inc = add nsw nuw i64 %i, 2
   %i.uge.ext = icmp uge i64 %i, %ext
   br i1 %i.uge.ext, label %trap, label %latch
 
 latch:
-  %p.inc = getelementptr inbounds i32, i32* %p, i64 1
-  %c = icmp ne i32* %p.inc, %p.end
-  store i32 0, i32* %p
+  %p.inc = getelementptr inbounds i32, ptr %p, i64 1
+  %c = icmp ne ptr %p.inc, %p.end
+  store i32 0, ptr %p
   br i1 %c, label %header, label %exit
 
 exit:

diff  --git a/llvm/test/Transforms/IndVarSimplify/single-element-range.ll b/llvm/test/Transforms/IndVarSimplify/single-element-range.ll
index 05bab1b136cd3..ef889fdc51c1d 100644
--- a/llvm/test/Transforms/IndVarSimplify/single-element-range.ll
+++ b/llvm/test/Transforms/IndVarSimplify/single-element-range.ll
@@ -3,14 +3,14 @@
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64"
 target triple = "armv6-apple-darwin10"
 
-define void @sqlite3_free_table(i8** %azResult) nounwind {
+define void @sqlite3_free_table(ptr %azResult) nounwind {
 entry:
 	br i1 undef, label %return, label %bb
 
 bb:		; preds = %entry
-	%0 = load i8*, i8** undef, align 4		; <i8*> [#uses=2]
-	%1 = ptrtoint i8* %0 to i32		; <i32> [#uses=1]
-	%2 = icmp sgt i8* %0, inttoptr (i32 1 to i8*)		; <i1> [#uses=1]
+	%0 = load ptr, ptr undef, align 4		; <ptr> [#uses=2]
+	%1 = ptrtoint ptr %0 to i32		; <i32> [#uses=1]
+	%2 = icmp sgt ptr %0, inttoptr (i32 1 to ptr)		; <i1> [#uses=1]
 	br i1 %2, label %bb1, label %bb5
 
 bb1:		; preds = %bb1, %bb

diff  --git a/llvm/test/Transforms/IndVarSimplify/sink-alloca.ll b/llvm/test/Transforms/IndVarSimplify/sink-alloca.ll
index f0ef7a11e7cda..cbff9811d0eff 100644
--- a/llvm/test/Transforms/IndVarSimplify/sink-alloca.ll
+++ b/llvm/test/Transforms/IndVarSimplify/sink-alloca.ll
@@ -9,7 +9,7 @@ define i32 @main() nounwind {
 ; CHECK: entry:
 ; CHECK-NEXT: %result.i = alloca i32, align 4
 entry:
-  %result.i = alloca i32, align 4                 ; <i32*> [#uses=2]
+  %result.i = alloca i32, align 4                 ; <ptr> [#uses=2]
   br label %while.cond
 
 while.cond:                                       ; preds = %while.cond, %entry
@@ -18,8 +18,8 @@ while.cond:                                       ; preds = %while.cond, %entry
   br i1 %tobool, label %while.end, label %while.cond
 
 while.end:                                        ; preds = %while.cond
-  store volatile i32 0, i32* %result.i
-  %tmp.i = load volatile i32, i32* %result.i           ; <i32> [#uses=0]
+  store volatile i32 0, ptr %result.i
+  %tmp.i = load volatile i32, ptr %result.i           ; <i32> [#uses=0]
   ret i32 0
 }
 declare i32 @bar()
@@ -27,30 +27,30 @@ declare i32 @bar()
 ; <rdar://problem/10352360>
 ; Indvars shouldn't sink the first alloca between the stacksave and stackrestore
 ; intrinsics.
-declare i8* @a(...)
-declare i8* @llvm.stacksave() nounwind
-declare void @llvm.stackrestore(i8*) nounwind
+declare ptr @a(...)
+declare ptr @llvm.stacksave() nounwind
+declare void @llvm.stackrestore(ptr) nounwind
 define void @h(i64 %n) nounwind uwtable ssp {
 ; CHECK: entry:
-; CHECK-NEXT: %vla = alloca i8*
-; CHECK-NEXT: %savedstack = call i8* @llvm.stacksave()
+; CHECK-NEXT: %vla = alloca ptr
+; CHECK-NEXT: %savedstack = call ptr @llvm.stacksave()
 entry:
-  %vla = alloca i8*, i64 %n, align 16
-  %savedstack = call i8* @llvm.stacksave() nounwind
-  %vla.i = alloca i8*, i64 %n, align 16
+  %vla = alloca ptr, i64 %n, align 16
+  %savedstack = call ptr @llvm.stacksave() nounwind
+  %vla.i = alloca ptr, i64 %n, align 16
   br label %for.body.i
 
 for.body.i:
   %indvars.iv37.i = phi i64 [ %indvars.iv.next38.i, %for.body.i ], [ 0, %entry ]
-  %call.i = call i8* (...) @a() nounwind
-  %arrayidx.i = getelementptr inbounds i8*, i8** %vla.i, i64 %indvars.iv37.i
-  store i8* %call.i, i8** %arrayidx.i, align 8
+  %call.i = call ptr (...) @a() nounwind
+  %arrayidx.i = getelementptr inbounds ptr, ptr %vla.i, i64 %indvars.iv37.i
+  store ptr %call.i, ptr %arrayidx.i, align 8
   %indvars.iv.next38.i = add i64 %indvars.iv37.i, 1
   %exitcond5 = icmp eq i64 %indvars.iv.next38.i, %n
   br i1 %exitcond5, label %g.exit, label %for.body.i
 
 g.exit:
-  call void @llvm.stackrestore(i8* %savedstack) nounwind
-  %call1 = call i8* (...) @a(i8** %vla) nounwind
+  call void @llvm.stackrestore(ptr %savedstack) nounwind
+  %call1 = call ptr (...) @a(ptr %vla) nounwind
   ret void
 }

diff  --git a/llvm/test/Transforms/IndVarSimplify/strengthen-overflow.ll b/llvm/test/Transforms/IndVarSimplify/strengthen-overflow.ll
index 36d46d4efe6f2..c208e51f7f617 100644
--- a/llvm/test/Transforms/IndVarSimplify/strengthen-overflow.ll
+++ b/llvm/test/Transforms/IndVarSimplify/strengthen-overflow.ll
@@ -1,7 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt < %s -passes=indvars -S | FileCheck %s
 
-define i32 @test.signed.add.0(i32* %array, i32 %length, i32 %init) {
+define i32 @test.signed.add.0(ptr %array, i32 %length, i32 %init) {
 ; CHECK-LABEL: @test.signed.add.0(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[UPPER:%.*]] = icmp slt i32 [[INIT:%.*]], [[LENGTH:%.*]]
@@ -14,7 +14,7 @@ define i32 @test.signed.add.0(i32* %array, i32 %length, i32 %init) {
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[CIV_INC]], [[LENGTH]]
 ; CHECK-NEXT:    br i1 [[CMP]], label [[LATCH]], label [[BREAK:%.*]]
 ; CHECK:       latch:
-; CHECK-NEXT:    store i32 0, i32* [[ARRAY:%.*]], align 4
+; CHECK-NEXT:    store i32 0, ptr [[ARRAY:%.*]], align 4
 ; CHECK-NEXT:    br i1 true, label [[LOOP]], label [[BREAK]]
 ; CHECK:       break:
 ; CHECK-NEXT:    [[CIV_INC_LCSSA:%.*]] = phi i32 [ [[LENGTH]], [[LATCH]] ], [ [[LENGTH]], [[LOOP]] ]
@@ -33,7 +33,7 @@ define i32 @test.signed.add.0(i32* %array, i32 %length, i32 %init) {
   br i1 %cmp, label %latch, label %break
 
   latch:
-  store i32 0, i32* %array
+  store i32 0, ptr %array
   %check = icmp slt i32 %civ.inc, %length
   br i1 %check, label %loop, label %break
 
@@ -44,7 +44,7 @@ define i32 @test.signed.add.0(i32* %array, i32 %length, i32 %init) {
   ret i32 42
 }
 
-define i32 @test.signed.add.1(i32* %array, i32 %length, i32 %init) {
+define i32 @test.signed.add.1(ptr %array, i32 %length, i32 %init) {
 ; CHECK-LABEL: @test.signed.add.1(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[UPPER:%.*]] = icmp sle i32 [[INIT:%.*]], [[LENGTH:%.*]]
@@ -59,7 +59,7 @@ define i32 @test.signed.add.1(i32* %array, i32 %length, i32 %init) {
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[CIV_INC]], [[LENGTH]]
 ; CHECK-NEXT:    br i1 [[CMP]], label [[LATCH]], label [[BREAK:%.*]]
 ; CHECK:       latch:
-; CHECK-NEXT:    store i32 0, i32* [[ARRAY:%.*]], align 4
+; CHECK-NEXT:    store i32 0, ptr [[ARRAY:%.*]], align 4
 ; CHECK-NEXT:    br i1 true, label [[LOOP]], label [[BREAK]]
 ; CHECK:       break:
 ; CHECK-NEXT:    [[CIV_INC_LCSSA:%.*]] = phi i32 [ [[SMAX]], [[LATCH]] ], [ [[SMAX]], [[LOOP]] ]
@@ -78,7 +78,7 @@ define i32 @test.signed.add.1(i32* %array, i32 %length, i32 %init) {
   br i1 %cmp, label %latch, label %break
 
   latch:
-  store i32 0, i32* %array
+  store i32 0, ptr %array
   %check = icmp slt i32 %civ.inc, %length
   br i1 %check, label %loop, label %break
 
@@ -89,7 +89,7 @@ define i32 @test.signed.add.1(i32* %array, i32 %length, i32 %init) {
   ret i32 42
 }
 
-define i32 @test.unsigned.add.0(i32* %array, i32 %length, i32 %init) {
+define i32 @test.unsigned.add.0(ptr %array, i32 %length, i32 %init) {
 ; CHECK-LABEL: @test.unsigned.add.0(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[UPPER:%.*]] = icmp ult i32 [[INIT:%.*]], [[LENGTH:%.*]]
@@ -102,7 +102,7 @@ define i32 @test.unsigned.add.0(i32* %array, i32 %length, i32 %init) {
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[CIV_INC]], [[LENGTH]]
 ; CHECK-NEXT:    br i1 [[CMP]], label [[LATCH]], label [[BREAK:%.*]]
 ; CHECK:       latch:
-; CHECK-NEXT:    store i32 0, i32* [[ARRAY:%.*]], align 4
+; CHECK-NEXT:    store i32 0, ptr [[ARRAY:%.*]], align 4
 ; CHECK-NEXT:    [[CHECK:%.*]] = icmp ult i32 [[CIV_INC]], [[LENGTH]]
 ; CHECK-NEXT:    br i1 [[CHECK]], label [[LOOP]], label [[BREAK]]
 ; CHECK:       break:
@@ -122,7 +122,7 @@ define i32 @test.unsigned.add.0(i32* %array, i32 %length, i32 %init) {
   br i1 %cmp, label %latch, label %break
 
   latch:
-  store i32 0, i32* %array
+  store i32 0, ptr %array
   %check = icmp ult i32 %civ.inc, %length
   br i1 %check, label %loop, label %break
 
@@ -133,7 +133,7 @@ define i32 @test.unsigned.add.0(i32* %array, i32 %length, i32 %init) {
   ret i32 42
 }
 
-define i32 @test.unsigned.add.1(i32* %array, i32 %length, i32 %init) {
+define i32 @test.unsigned.add.1(ptr %array, i32 %length, i32 %init) {
 ; CHECK-LABEL: @test.unsigned.add.1(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[UPPER:%.*]] = icmp ule i32 [[INIT:%.*]], [[LENGTH:%.*]]
@@ -146,7 +146,7 @@ define i32 @test.unsigned.add.1(i32* %array, i32 %length, i32 %init) {
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[CIV_INC]], [[LENGTH]]
 ; CHECK-NEXT:    br i1 [[CMP]], label [[LATCH]], label [[BREAK:%.*]]
 ; CHECK:       latch:
-; CHECK-NEXT:    store i32 0, i32* [[ARRAY:%.*]], align 4
+; CHECK-NEXT:    store i32 0, ptr [[ARRAY:%.*]], align 4
 ; CHECK-NEXT:    [[CHECK:%.*]] = icmp ult i32 [[CIV_INC]], [[LENGTH]]
 ; CHECK-NEXT:    br i1 [[CHECK]], label [[LOOP]], label [[BREAK]]
 ; CHECK:       break:
@@ -166,7 +166,7 @@ define i32 @test.unsigned.add.1(i32* %array, i32 %length, i32 %init) {
   br i1 %cmp, label %latch, label %break
 
   latch:
-  store i32 0, i32* %array
+  store i32 0, ptr %array
   %check = icmp ult i32 %civ.inc, %length
   br i1 %check, label %loop, label %break
 

diff  --git a/llvm/test/Transforms/IndVarSimplify/udiv-invariant-but-traps.ll b/llvm/test/Transforms/IndVarSimplify/udiv-invariant-but-traps.ll
index fbb8b09d5cafc..cbe36ff4b443b 100644
--- a/llvm/test/Transforms/IndVarSimplify/udiv-invariant-but-traps.ll
+++ b/llvm/test/Transforms/IndVarSimplify/udiv-invariant-but-traps.ll
@@ -20,7 +20,7 @@ bb11:
   br i1 %y, label %bb1, label %bb13
 
 bb13:
-  store i32 %div, i32* @b, align 4
+  store i32 %div, ptr @b, align 4
   br label %bb14
 
 bb14:

diff  --git a/llvm/test/Transforms/IndVarSimplify/udiv.ll b/llvm/test/Transforms/IndVarSimplify/udiv.ll
index f40a28b62d01b..4dae1ea071728 100644
--- a/llvm/test/Transforms/IndVarSimplify/udiv.ll
+++ b/llvm/test/Transforms/IndVarSimplify/udiv.ll
@@ -2,8 +2,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-n8:16:32:64"
 
- at main.flags = internal global [8193 x i8] zeroinitializer, align 1 ; <[8193 x i8]*> [#uses=5]
- at .str = private constant [11 x i8] c"Count: %d\0A\00" ; <[11 x i8]*> [#uses=1]
+ at main.flags = internal global [8193 x i8] zeroinitializer, align 1 ; <ptr> [#uses=5]
+ at .str = private constant [11 x i8] c"Count: %d\0A\00" ; <ptr> [#uses=1]
 
 ; Indvars shouldn't emit a udiv here, because there's no udiv in the
 ; original code. This comes from SingleSource/Benchmarks/Shootout/sieve.c.
@@ -11,15 +11,15 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 ; CHECK-LABEL: @main(
 ; CHECK-NOT: div
 
-define i32 @main(i32 %argc, i8** nocapture %argv) nounwind {
+define i32 @main(i32 %argc, ptr nocapture %argv) nounwind {
 entry:
   %cmp = icmp eq i32 %argc, 2                     ; <i1> [#uses=1]
   br i1 %cmp, label %cond.true, label %while.cond.preheader
 
 cond.true:                                        ; preds = %entry
-  %arrayidx = getelementptr inbounds i8*, i8** %argv, i64 1 ; <i8**> [#uses=1]
-  %tmp2 = load i8*, i8** %arrayidx                     ; <i8*> [#uses=1]
-  %call = tail call i32 @atoi(i8* %tmp2) nounwind readonly ; <i32> [#uses=1]
+  %arrayidx = getelementptr inbounds ptr, ptr %argv, i64 1 ; <ptr> [#uses=1]
+  %tmp2 = load ptr, ptr %arrayidx                     ; <ptr> [#uses=1]
+  %call = tail call i32 @atoi(ptr %tmp2) nounwind readonly ; <i32> [#uses=1]
   br label %while.cond.preheader
 
 while.cond.preheader:                             ; preds = %entry, %cond.true
@@ -59,8 +59,8 @@ bb.nph:                                           ; preds = %for.cond.preheader
 
 for.body:                                         ; preds = %bb.nph, %for.cond
   %i.02 = phi i64 [ 2, %bb.nph ], [ %inc, %for.cond ] ; <i64> [#uses=2]
-  %arrayidx10 = getelementptr inbounds [8193 x i8], [8193 x i8]* @main.flags, i64 0, i64 %i.02 ; <i8*> [#uses=1]
-  store i8 1, i8* %arrayidx10
+  %arrayidx10 = getelementptr inbounds [8193 x i8], ptr @main.flags, i64 0, i64 %i.02 ; <ptr> [#uses=1]
+  store i8 1, ptr %arrayidx10
   %inc = add nsw i64 %i.02, 1                     ; <i64> [#uses=2]
   br label %for.cond
 
@@ -81,8 +81,8 @@ bb.nph16:                                         ; preds = %for.cond12.loopexit
 for.body15:                                       ; preds = %bb.nph16, %for.cond12
   %count.212 = phi i32 [ 0, %bb.nph16 ], [ %count.1, %for.cond12 ] ; <i32> [#uses=2]
   %i.17 = phi i64 [ 2, %bb.nph16 ], [ %inc37, %for.cond12 ] ; <i64> [#uses=4]
-  %arrayidx17 = getelementptr inbounds [8193 x i8], [8193 x i8]* @main.flags, i64 0, i64 %i.17 ; <i8*> [#uses=1]
-  %tmp18 = load i8, i8* %arrayidx17                   ; <i8> [#uses=1]
+  %arrayidx17 = getelementptr inbounds [8193 x i8], ptr @main.flags, i64 0, i64 %i.17 ; <ptr> [#uses=1]
+  %tmp18 = load i8, ptr %arrayidx17                   ; <i8> [#uses=1]
   %tobool19 = icmp eq i8 %tmp18, 0                ; <i1> [#uses=1]
   br i1 %tobool19, label %for.inc35, label %if.then
 
@@ -103,8 +103,8 @@ bb.nph5:                                          ; preds = %if.then
 
 for.body25:                                       ; preds = %bb.nph5, %for.cond22
   %k.04 = phi i64 [ %add, %bb.nph5 ], [ %add31, %for.cond22 ] ; <i64> [#uses=2]
-  %arrayidx27 = getelementptr inbounds [8193 x i8], [8193 x i8]* @main.flags, i64 0, i64 %k.04 ; <i8*> [#uses=1]
-  store i8 0, i8* %arrayidx27
+  %arrayidx27 = getelementptr inbounds [8193 x i8], ptr @main.flags, i64 0, i64 %k.04 ; <ptr> [#uses=1]
+  store i8 0, ptr %arrayidx27
   %add31 = add nsw i64 %k.04, %i.17               ; <i64> [#uses=2]
   br label %for.cond22
 
@@ -119,13 +119,13 @@ for.inc35:                                        ; preds = %for.body15, %for.en
 
 while.end:                                        ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader
   %count.0.lcssa = phi i32 [ %count.2.lcssa.lcssa, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ] ; <i32> [#uses=1]
-  %call40 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %count.0.lcssa) nounwind ; <i32> [#uses=0]
+  %call40 = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %count.0.lcssa) nounwind ; <i32> [#uses=0]
   ret i32 0
 }
 
-declare i32 @atoi(i8* nocapture) nounwind readonly
+declare i32 @atoi(ptr nocapture) nounwind readonly
 
-declare i32 @printf(i8* nocapture, ...) nounwind
+declare i32 @printf(ptr nocapture, ...) nounwind
 
 ; IndVars doesn't emit a udiv in for.body.preheader since SCEVExpander::expand will
 ; find out there's already a udiv in the original code.
@@ -134,7 +134,7 @@ declare i32 @printf(i8* nocapture, ...) nounwind
 ; CHECK: for.body.preheader:
 ; CHECK-NOT: udiv
 
-define void @foo(double* %p, i64 %n) nounwind {
+define void @foo(ptr %p, i64 %n) nounwind {
 entry:
   %div0 = udiv i64 %n, 7                          ; <i64> [#uses=1]
   %div1 = add i64 %div0, 1
@@ -146,8 +146,8 @@ for.body.preheader:                               ; preds = %entry
 
 for.body:                                         ; preds = %for.body.preheader, %for.body
   %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ] ; <i64> [#uses=2]
-  %arrayidx = getelementptr inbounds double, double* %p, i64 %i.03 ; <double*> [#uses=1]
-  store double 0.000000e+00, double* %arrayidx
+  %arrayidx = getelementptr inbounds double, ptr %p, i64 %i.03 ; <ptr> [#uses=1]
+  store double 0.000000e+00, ptr %arrayidx
   %inc = add i64 %i.03, 1                         ; <i64> [#uses=2]
   %divx = udiv i64 %n, 7                           ; <i64> [#uses=1]
   %div = add i64 %divx, 1

diff  --git a/llvm/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll b/llvm/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll
index 04fb347012905..6cebd0d0055e5 100644
--- a/llvm/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll
+++ b/llvm/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll
@@ -5,7 +5,7 @@
 target datalayout = "n8:16:32:64"
 
 
-define void @test1(float* nocapture %autoc, float* nocapture %data, float %d, i32 %data_len, i32 %sample) nounwind {
+define void @test1(ptr nocapture %autoc, ptr nocapture %data, float %d, i32 %data_len, i32 %sample) nounwind {
 ; CHECK-LABEL: @test1(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[SUB:%.*]] = sub i32 [[DATA_LEN:%.*]], [[SAMPLE:%.*]]
@@ -19,13 +19,13 @@ define void @test1(float* nocapture %autoc, float* nocapture %data, float %d, i3
 ; CHECK-NEXT:    [[TMP0:%.*]] = trunc i64 [[INDVARS_IV]] to i32
 ; CHECK-NEXT:    [[ADD:%.*]] = add i32 [[TMP0]], [[SAMPLE]]
 ; CHECK-NEXT:    [[IDXPROM:%.*]] = zext i32 [[ADD]] to i64
-; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds float, float* [[DATA:%.*]], i64 [[IDXPROM]]
-; CHECK-NEXT:    [[TMP1:%.*]] = load float, float* [[ARRAYIDX]], align 4
+; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds float, ptr [[DATA:%.*]], i64 [[IDXPROM]]
+; CHECK-NEXT:    [[TMP1:%.*]] = load float, ptr [[ARRAYIDX]], align 4
 ; CHECK-NEXT:    [[MUL:%.*]] = fmul float [[TMP1]], [[D:%.*]]
-; CHECK-NEXT:    [[ARRAYIDX2:%.*]] = getelementptr inbounds float, float* [[AUTOC:%.*]], i64 [[INDVARS_IV]]
-; CHECK-NEXT:    [[TMP2:%.*]] = load float, float* [[ARRAYIDX2]], align 4
+; CHECK-NEXT:    [[ARRAYIDX2:%.*]] = getelementptr inbounds float, ptr [[AUTOC:%.*]], i64 [[INDVARS_IV]]
+; CHECK-NEXT:    [[TMP2:%.*]] = load float, ptr [[ARRAYIDX2]], align 4
 ; CHECK-NEXT:    [[ADD3:%.*]] = fadd float [[TMP2]], [[MUL]]
-; CHECK-NEXT:    store float [[ADD3]], float* [[ARRAYIDX2]], align 4
+; CHECK-NEXT:    store float [[ADD3]], ptr [[ARRAYIDX2]], align 4
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
 ; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
 ; CHECK-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END_LOOPEXIT:%.*]]
@@ -44,13 +44,13 @@ for.body:                                         ; preds = %entry, %for.body
   %0 = trunc i64 %indvars.iv to i32
   %add = add i32 %0, %sample
   %idxprom = zext i32 %add to i64
-  %arrayidx = getelementptr inbounds float, float* %data, i64 %idxprom
-  %1 = load float, float* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds float, ptr %data, i64 %idxprom
+  %1 = load float, ptr %arrayidx, align 4
   %mul = fmul float %1, %d
-  %arrayidx2 = getelementptr inbounds float, float* %autoc, i64 %indvars.iv
-  %2 = load float, float* %arrayidx2, align 4
+  %arrayidx2 = getelementptr inbounds float, ptr %autoc, i64 %indvars.iv
+  %2 = load float, ptr %arrayidx2, align 4
   %add3 = fadd float %2, %mul
-  store float %add3, float* %arrayidx2, align 4
+  store float %add3, ptr %arrayidx2, align 4
   %indvars.iv.next = add i64 %indvars.iv, 1
   %3 = trunc i64 %indvars.iv.next to i32
   %cmp = icmp ult i32 %3, %sub

diff  --git a/llvm/test/Transforms/IndVarSimplify/use-range-metadata.ll b/llvm/test/Transforms/IndVarSimplify/use-range-metadata.ll
index 596b61c9552e4..954073431968a 100644
--- a/llvm/test/Transforms/IndVarSimplify/use-range-metadata.ll
+++ b/llvm/test/Transforms/IndVarSimplify/use-range-metadata.ll
@@ -4,9 +4,9 @@
 
 declare void @abort()
 
-define i1 @iterate(i32* nocapture readonly %buffer) {
+define i1 @iterate(ptr nocapture readonly %buffer) {
 entry:
-  %length = load i32, i32* %buffer, !range !0
+  %length = load i32, ptr %buffer, !range !0
   br label %loop.preheader
 
 loop.preheader:

diff  --git a/llvm/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll b/llvm/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll
index 6b1fc306fda1e..6b14a5a9d80c8 100644
--- a/llvm/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll
+++ b/llvm/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll
@@ -4,19 +4,19 @@
 ; stride iv's, it will make %iv. and %m.0.0 isomorphic to each other without
 ; cycles, allowing the tmp.21 subtraction to be eliminated.
 
-define void @vnum_test8(i32* %data) {
+define void @vnum_test8(ptr %data) {
 entry:
-        %tmp.1 = getelementptr i32, i32* %data, i32 3                ; <i32*> [#uses=1]
-        %tmp.2 = load i32, i32* %tmp.1               ; <i32> [#uses=2]
-        %tmp.4 = getelementptr i32, i32* %data, i32 4                ; <i32*> [#uses=1]
-        %tmp.5 = load i32, i32* %tmp.4               ; <i32> [#uses=2]
-        %tmp.8 = getelementptr i32, i32* %data, i32 2                ; <i32*> [#uses=1]
-        %tmp.9 = load i32, i32* %tmp.8               ; <i32> [#uses=3]
+        %tmp.1 = getelementptr i32, ptr %data, i32 3                ; <ptr> [#uses=1]
+        %tmp.2 = load i32, ptr %tmp.1               ; <i32> [#uses=2]
+        %tmp.4 = getelementptr i32, ptr %data, i32 4                ; <ptr> [#uses=1]
+        %tmp.5 = load i32, ptr %tmp.4               ; <i32> [#uses=2]
+        %tmp.8 = getelementptr i32, ptr %data, i32 2                ; <ptr> [#uses=1]
+        %tmp.9 = load i32, ptr %tmp.8               ; <i32> [#uses=3]
         %tmp.125 = icmp sgt i32 %tmp.2, 0               ; <i1> [#uses=1]
         br i1 %tmp.125, label %no_exit.preheader, label %return
 
 no_exit.preheader:              ; preds = %entry
-        %tmp.16 = getelementptr i32, i32* %data, i32 %tmp.9          ; <i32*> [#uses=1]
+        %tmp.16 = getelementptr i32, ptr %data, i32 %tmp.9          ; <ptr> [#uses=1]
         br label %no_exit
 
 ; CHECK: store i32 0
@@ -24,9 +24,9 @@ no_exit:                ; preds = %no_exit, %no_exit.preheader
         %iv.ui = phi i32 [ 0, %no_exit.preheader ], [ %iv..inc.ui, %no_exit ]           ; <i32> [#uses=1]
         %iv. = phi i32 [ %tmp.5, %no_exit.preheader ], [ %iv..inc, %no_exit ]           ; <i32> [#uses=2]
         %m.0.0 = phi i32 [ %tmp.5, %no_exit.preheader ], [ %tmp.24, %no_exit ]          ; <i32> [#uses=2]
-        store i32 2, i32* %tmp.16
+        store i32 2, ptr %tmp.16
         %tmp.21 = sub i32 %m.0.0, %iv.          ; <i32> [#uses=1]
-        store i32 %tmp.21, i32* %data
+        store i32 %tmp.21, ptr %data
         %tmp.24 = add i32 %m.0.0, %tmp.9                ; <i32> [#uses=1]
         %iv..inc = add i32 %tmp.9, %iv.         ; <i32> [#uses=1]
         %iv..inc.ui = add i32 %iv.ui, 1         ; <i32> [#uses=2]

diff  --git a/llvm/test/Transforms/IndVarSimplify/zext-nuw.ll b/llvm/test/Transforms/IndVarSimplify/zext-nuw.ll
index a0b7a7fa57723..01eaa46d981e4 100644
--- a/llvm/test/Transforms/IndVarSimplify/zext-nuw.ll
+++ b/llvm/test/Transforms/IndVarSimplify/zext-nuw.ll
@@ -3,17 +3,16 @@
 
 %struct.A = type { i8 }
 
- at c = global %struct.A* null
+ at c = global ptr null
 @d = global i32 4
 
 define void @_Z3fn1v() {
 ; CHECK-LABEL: @_Z3fn1v(
-; CHECK-NEXT:    [[X2:%.*]] = load i32, i32* @d, align 4
+; CHECK-NEXT:    [[X2:%.*]] = load i32, ptr @d, align 4
 ; CHECK-NEXT:    [[X3:%.*]] = icmp slt i32 [[X2]], 1
 ; CHECK-NEXT:    [[X4:%.*]] = select i1 [[X3]], i32 1, i32 [[X2]]
-; CHECK-NEXT:    [[X5:%.*]] = load %struct.A*, %struct.A** @c, align 8
-; CHECK-NEXT:    [[J_SROA_0_0__SROA_IDX:%.*]] = getelementptr [[STRUCT_A:%.*]], %struct.A* [[X5]], i64 0, i32 0
-; CHECK-NEXT:    [[J_SROA_0_0_COPYLOAD:%.*]] = load i8, i8* [[J_SROA_0_0__SROA_IDX]], align 1
+; CHECK-NEXT:    [[X5:%.*]] = load ptr, ptr @c, align 8
+; CHECK-NEXT:    [[J_SROA_0_0_COPYLOAD:%.*]] = load i8, ptr [[X5]], align 1
 ; CHECK-NEXT:    br label [[DOTPREHEADER4_LR_PH:%.*]]
 ; CHECK:       .preheader4.lr.ph:
 ; CHECK-NEXT:    [[TMP1:%.*]] = add nsw i32 [[X4]], -1
@@ -23,7 +22,7 @@ define void @_Z3fn1v() {
 ; CHECK-NEXT:    [[TMP5:%.*]] = mul i64 [[TMP3]], [[TMP4]]
 ; CHECK-NEXT:    br label [[DOTPREHEADER4:%.*]]
 ; CHECK:       .preheader4:
-; CHECK-NEXT:    [[K_09:%.*]] = phi i8* [ undef, [[DOTPREHEADER4_LR_PH]] ], [ [[X25:%.*]], [[X22:%.*]] ]
+; CHECK-NEXT:    [[K_09:%.*]] = phi ptr [ undef, [[DOTPREHEADER4_LR_PH]] ], [ [[X25:%.*]], [[X22:%.*]] ]
 ; CHECK-NEXT:    [[X8:%.*]] = icmp ult i32 0, 4
 ; CHECK-NEXT:    br i1 [[X8]], label [[DOTPREHEADER_LR_PH:%.*]], label [[X22]]
 ; CHECK:       .preheader.lr.ph:
@@ -33,26 +32,25 @@ define void @_Z3fn1v() {
 ; CHECK:       x17:
 ; CHECK-NEXT:    br i1 false, label [[DOTPREHEADER]], label [[DOT_CRIT_EDGE_8:%.*]]
 ; CHECK:       ._crit_edge.8:
-; CHECK-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, i8* [[K_09]], i64 [[TMP5]]
+; CHECK-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, ptr [[K_09]], i64 [[TMP5]]
 ; CHECK-NEXT:    br label [[X22]]
 ; CHECK:       x22:
-; CHECK-NEXT:    [[K_1_LCSSA:%.*]] = phi i8* [ [[SCEVGEP]], [[DOT_CRIT_EDGE_8]] ], [ [[K_09]], [[DOTPREHEADER4]] ]
-; CHECK-NEXT:    [[X25]] = getelementptr i8, i8* [[K_1_LCSSA]]
+; CHECK-NEXT:    [[K_1_LCSSA:%.*]] = phi ptr [ [[SCEVGEP]], [[DOT_CRIT_EDGE_8]] ], [ [[K_09]], [[DOTPREHEADER4]] ]
+; CHECK-NEXT:    [[X25]] = getelementptr i8, ptr [[K_1_LCSSA]]
 ; CHECK-NEXT:    br label [[DOTPREHEADER4]]
 ;
-  %x2 = load i32, i32* @d
+  %x2 = load i32, ptr @d
   %x3 = icmp slt i32 %x2, 1
   %x4 = select i1 %x3, i32 1, i32 %x2
-  %x5 = load %struct.A*, %struct.A** @c
-  %j.sroa.0.0..sroa_idx = getelementptr %struct.A, %struct.A* %x5, i64 0, i32 0
-  %j.sroa.0.0.copyload = load i8, i8* %j.sroa.0.0..sroa_idx
+  %x5 = load ptr, ptr @c
+  %j.sroa.0.0.copyload = load i8, ptr %x5
   br label %.preheader4.lr.ph
 
 .preheader4.lr.ph:                                ; preds = %0
   br label %.preheader4
 
 .preheader4:                                      ; preds = %x22, %.preheader4.lr.ph
-  %k.09 = phi i8* [ undef, %.preheader4.lr.ph ], [ %x25, %x22 ]
+  %k.09 = phi ptr [ undef, %.preheader4.lr.ph ], [ %x25, %x22 ]
   %x8 = icmp ult i32 0, 4
   br i1 %x8, label %.preheader.lr.ph, label %x22
 
@@ -60,23 +58,23 @@ define void @_Z3fn1v() {
   br label %.preheader
 
 .preheader:                                       ; preds = %x17, %.preheader.lr.ph
-  %k.17 = phi i8* [ %k.09, %.preheader.lr.ph ], [ %x19, %x17 ]
+  %k.17 = phi ptr [ %k.09, %.preheader.lr.ph ], [ %x19, %x17 ]
   %v.06 = phi i32 [ 0, %.preheader.lr.ph ], [ %x20, %x17 ]
   br label %x17
 
 x17:                                              ; preds = %.preheader
   %x18 = sext i8 %j.sroa.0.0.copyload to i64
-  %x19 = getelementptr i8, i8* %k.17, i64 %x18
+  %x19 = getelementptr i8, ptr %k.17, i64 %x18
   %x20 = add i32 %v.06, 1
   %x21 = icmp ult i32 %x20, %x4
   br i1 %x21, label %.preheader, label %._crit_edge.8
 
 ._crit_edge.8:                                    ; preds = %x17
-  %split = phi i8* [ %x19, %x17 ]
+  %split = phi ptr [ %x19, %x17 ]
   br label %x22
 
 x22:                                              ; preds = %._crit_edge.8, %.preheader4
-  %k.1.lcssa = phi i8* [ %split, %._crit_edge.8 ], [ %k.09, %.preheader4 ]
-  %x25 = getelementptr i8, i8* %k.1.lcssa
+  %k.1.lcssa = phi ptr [ %split, %._crit_edge.8 ], [ %k.09, %.preheader4 ]
+  %x25 = getelementptr i8, ptr %k.1.lcssa
   br label %.preheader4
 }


        


More information about the llvm-commits mailing list