[LoopRotate] Convert tests to opaque pointers (NFC)
authorNikita Popov <npopov@redhat.com>
Mon, 2 Jan 2023 15:53:31 +0000 (16:53 +0100)
committerNikita Popov <npopov@redhat.com>
Mon, 2 Jan 2023 16:00:26 +0000 (17:00 +0100)
27 files changed:
llvm/test/Transforms/LoopRotate/2009-01-25-SingleEntryPhi.ll
llvm/test/Transforms/LoopRotate/PhiRename-1.ll
llvm/test/Transforms/LoopRotate/PhiSelfReference-1.ll
llvm/test/Transforms/LoopRotate/RISCV/invalid-cost.ll
llvm/test/Transforms/LoopRotate/alloca.ll
llvm/test/Transforms/LoopRotate/basic.ll
llvm/test/Transforms/LoopRotate/call-prepare-for-lto.ll
llvm/test/Transforms/LoopRotate/callbr.ll
llvm/test/Transforms/LoopRotate/catchret.ll
llvm/test/Transforms/LoopRotate/crash.ll
llvm/test/Transforms/LoopRotate/dbg-value-duplicates.ll
llvm/test/Transforms/LoopRotate/dbgvalue.ll
llvm/test/Transforms/LoopRotate/freeze-crash.ll
llvm/test/Transforms/LoopRotate/indirectbr.ll
llvm/test/Transforms/LoopRotate/loopexitinglatch.ll
llvm/test/Transforms/LoopRotate/multiple-deopt-exits.ll
llvm/test/Transforms/LoopRotate/multiple-exits.ll
llvm/test/Transforms/LoopRotate/noalias.ll
llvm/test/Transforms/LoopRotate/nosimplifylatch.ll
llvm/test/Transforms/LoopRotate/oz-disable.ll
llvm/test/Transforms/LoopRotate/phi-duplicate.ll
llvm/test/Transforms/LoopRotate/pr22337.ll
llvm/test/Transforms/LoopRotate/pr2639.ll
llvm/test/Transforms/LoopRotate/pr51981-scev-problem.ll
llvm/test/Transforms/LoopRotate/preserve-mssa.ll
llvm/test/Transforms/LoopRotate/preserve-scev.ll
llvm/test/Transforms/LoopRotate/simplifylatch.ll

index 4fe3503..f1d7568 100644 (file)
@@ -2,10 +2,10 @@
 ; PR3408
 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"
-       %struct.Cls = type { i32, i8, [2 x %struct.Cls*], [2 x %struct.Lit*] }
+       %struct.Cls = type { i32, i8, [2 x ptr], [2 x ptr] }
        %struct.Lit = type { i8 }
 
-define void @picosat_main_bb13.i.i71.outer_bb132.i.i.i.outer(%struct.Cls**, %struct.Cls**, i32 %collect.i.i.i.1.lcssa, i32 %lcollect.i.i.i.2.lcssa, %struct.Cls*** %rhead.tmp.0236.out, i32* %collect.i.i.i.2.out, i32* %lcollect.i.i.i.3.ph.ph.ph.out) nounwind {
+define void @picosat_main_bb13.i.i71.outer_bb132.i.i.i.outer(ptr, ptr, i32 %collect.i.i.i.1.lcssa, i32 %lcollect.i.i.i.2.lcssa, ptr %rhead.tmp.0236.out, ptr %collect.i.i.i.2.out, ptr %lcollect.i.i.i.3.ph.ph.ph.out) nounwind {
 newFuncRoot:
        br label %codeRepl
 
@@ -13,7 +13,7 @@ bb133.i.i.i.exitStub:         ; preds = %codeRepl
        ret void
 
 bb130.i.i.i:           ; preds = %codeRepl
-       %rhead.tmp.0236.lcssa82 = phi %struct.Cls** [ null, %codeRepl ]         ; <%struct.Cls**> [#uses=0]
+       %rhead.tmp.0236.lcssa82 = phi ptr [ null, %codeRepl ]           ; <ptr> [#uses=0]
        br label %codeRepl
 
 codeRepl:              ; preds = %bb130.i.i.i, %newFuncRoot
index 1fd9aad..042aa42 100644 (file)
@@ -3,93 +3,92 @@
 
 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"
 
-       %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
-       %struct.Index_Map = type { i32, %struct.item_set** }
-       %struct.Item = type { [4 x i16], %struct.rule* }
+       %struct.FILE = type { ptr, i32, i32, i16, i16, %struct.__sbuf, i32, ptr, ptr, ptr, ptr, ptr, %struct.__sbuf, ptr, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
+       %struct.Index_Map = type { i32, ptr }
+       %struct.Item = type { [4 x i16], ptr }
        %struct.__sFILEX = type opaque
-       %struct.__sbuf = type { i8*, i32 }
-       %struct.dimension = type { i16*, %struct.Index_Map, %struct.mapping*, i32, %struct.plankMap* }
-       %struct.item_set = type { i32, i32, %struct.operator*, [2 x %struct.item_set*], %struct.item_set*, i16*, %struct.Item*, %struct.Item* }
-       %struct.list = type { i8*, %struct.list* }
-       %struct.mapping = type { %struct.list**, i32, i32, i32, %struct.item_set** }
-       %struct.nonterminal = type { i8*, i32, i32, i32, %struct.plankMap*, %struct.rule* }
-       %struct.operator = type { i8*, i8, i32, i32, i32, i32, %struct.table* }
-       %struct.pattern = type { %struct.nonterminal*, %struct.operator*, [2 x %struct.nonterminal*] }
-       %struct.plank = type { i8*, %struct.list*, i32 }
-       %struct.plankMap = type { %struct.list*, i32, %struct.stateMap* }
-       %struct.rule = type { [4 x i16], i32, i32, i32, %struct.nonterminal*, %struct.pattern*, i8 }
-       %struct.stateMap = type { i8*, %struct.plank*, i32, i16* }
-       %struct.table = type { %struct.operator*, %struct.list*, i16*, [2 x %struct.dimension*], %struct.item_set** }
-@outfile = external global %struct.FILE*               ; <%struct.FILE**> [#uses=1]
-@str1 = external constant [11 x i8]            ; <[11 x i8]*> [#uses=1]
-@operators = weak global %struct.list* null            ; <%struct.list**> [#uses=1]
+       %struct.__sbuf = type { ptr, i32 }
+       %struct.dimension = type { ptr, %struct.Index_Map, ptr, i32, ptr }
+       %struct.item_set = type { i32, i32, ptr, [2 x ptr], ptr, ptr, ptr, ptr }
+       %struct.list = type { ptr, ptr }
+       %struct.mapping = type { ptr, i32, i32, i32, ptr }
+       %struct.nonterminal = type { ptr, i32, i32, i32, ptr, ptr }
+       %struct.operator = type { ptr, i8, i32, i32, i32, i32, ptr }
+       %struct.pattern = type { ptr, ptr, [2 x ptr] }
+       %struct.plank = type { ptr, ptr, i32 }
+       %struct.plankMap = type { ptr, i32, ptr }
+       %struct.rule = type { [4 x i16], i32, i32, i32, ptr, ptr, i8 }
+       %struct.stateMap = type { ptr, ptr, i32, ptr }
+       %struct.table = type { ptr, ptr, ptr, [2 x ptr], ptr }
+@outfile = external global ptr         ; <ptr> [#uses=1]
+@str1 = external constant [11 x i8]            ; <ptr> [#uses=1]
+@operators = weak global ptr null              ; <ptr> [#uses=1]
 
 
 
 define i32 @opsOfArity(i32 %arity) {
 entry:
-       %arity_addr = alloca i32                ; <i32*> [#uses=2]
-       %retval = alloca i32, align 4           ; <i32*> [#uses=2]
-       %tmp = alloca i32, align 4              ; <i32*> [#uses=2]
-       %c = alloca i32, align 4                ; <i32*> [#uses=4]
-       %l = alloca %struct.list*, align 4              ; <%struct.list**> [#uses=5]
-       %op = alloca %struct.operator*, align 4         ; <%struct.operator**> [#uses=3]
-       store i32 %arity, i32* %arity_addr
-       store i32 0, i32* %c
-       %tmp1 = load %struct.list*, %struct.list** @operators           ; <%struct.list*> [#uses=1]
-       store %struct.list* %tmp1, %struct.list** %l
+       %arity_addr = alloca i32                ; <ptr> [#uses=2]
+       %retval = alloca i32, align 4           ; <ptr> [#uses=2]
+       %tmp = alloca i32, align 4              ; <ptr> [#uses=2]
+       %c = alloca i32, align 4                ; <ptr> [#uses=4]
+       %l = alloca ptr, align 4                ; <ptr> [#uses=5]
+       %op = alloca ptr, align 4               ; <ptr> [#uses=3]
+       store i32 %arity, ptr %arity_addr
+       store i32 0, ptr %c
+       %tmp1 = load ptr, ptr @operators                ; <ptr> [#uses=1]
+       store ptr %tmp1, ptr %l
        br label %bb21
 
 bb:            ; preds = %bb21
-       %tmp3 = getelementptr %struct.list, %struct.list* %tmp22, i32 0, i32 0          ; <i8**> [#uses=1]
-       %tmp4 = load i8*, i8** %tmp3            ; <i8*> [#uses=1]
-       %tmp45 = bitcast i8* %tmp4 to %struct.operator*         ; <%struct.operator*> [#uses=1]
-       store %struct.operator* %tmp45, %struct.operator** %op
-       %tmp6 = load %struct.operator*, %struct.operator** %op          ; <%struct.operator*> [#uses=1]
-       %tmp7 = getelementptr %struct.operator, %struct.operator* %tmp6, i32 0, i32 5           ; <i32*> [#uses=1]
-       %tmp8 = load i32, i32* %tmp7            ; <i32> [#uses=1]
-       %tmp9 = load i32, i32* %arity_addr              ; <i32> [#uses=1]
+       %tmp3 = getelementptr %struct.list, ptr %tmp22, i32 0, i32 0            ; <ptr> [#uses=1]
+       %tmp4 = load ptr, ptr %tmp3             ; <ptr> [#uses=1]
+       store ptr %tmp4, ptr %op
+       %tmp6 = load ptr, ptr %op               ; <ptr> [#uses=1]
+       %tmp7 = getelementptr %struct.operator, ptr %tmp6, i32 0, i32 5         ; <ptr> [#uses=1]
+       %tmp8 = load i32, ptr %tmp7             ; <i32> [#uses=1]
+       %tmp9 = load i32, ptr %arity_addr               ; <i32> [#uses=1]
        icmp eq i32 %tmp8, %tmp9                ; <i1>:0 [#uses=1]
        zext i1 %0 to i8                ; <i8>:1 [#uses=1]
        icmp ne i8 %1, 0                ; <i1>:2 [#uses=1]
        br i1 %2, label %cond_true, label %cond_next
 
 cond_true:             ; preds = %bb
-       %tmp10 = load %struct.operator*, %struct.operator** %op         ; <%struct.operator*> [#uses=1]
-       %tmp11 = getelementptr %struct.operator, %struct.operator* %tmp10, i32 0, i32 2         ; <i32*> [#uses=1]
-       %tmp12 = load i32, i32* %tmp11          ; <i32> [#uses=1]
-       %tmp13 = load %struct.FILE*, %struct.FILE** @outfile            ; <%struct.FILE*> [#uses=1]
-       %tmp14 = getelementptr [11 x i8], [11 x i8]* @str1, i32 0, i32 0                ; <i8*> [#uses=1]
-       %tmp15 = call i32 (%struct.FILE*, i8*, ...) @fprintf( %struct.FILE* %tmp13, i8* %tmp14, i32 %tmp12 )            ; <i32> [#uses=0]
-       %tmp16 = load i32, i32* %c              ; <i32> [#uses=1]
+       %tmp10 = load ptr, ptr %op              ; <ptr> [#uses=1]
+       %tmp11 = getelementptr %struct.operator, ptr %tmp10, i32 0, i32 2               ; <ptr> [#uses=1]
+       %tmp12 = load i32, ptr %tmp11           ; <i32> [#uses=1]
+       %tmp13 = load ptr, ptr @outfile         ; <ptr> [#uses=1]
+       %tmp14 = getelementptr [11 x i8], ptr @str1, i32 0, i32 0               ; <ptr> [#uses=1]
+       %tmp15 = call i32 (ptr, ptr, ...) @fprintf( ptr %tmp13, ptr %tmp14, i32 %tmp12 )                ; <i32> [#uses=0]
+       %tmp16 = load i32, ptr %c               ; <i32> [#uses=1]
        %tmp17 = add i32 %tmp16, 1              ; <i32> [#uses=1]
-       store i32 %tmp17, i32* %c
+       store i32 %tmp17, ptr %c
        br label %cond_next
 
 cond_next:             ; preds = %cond_true, %bb
-       %tmp19 = getelementptr %struct.list, %struct.list* %tmp22, i32 0, i32 1         ; <%struct.list**> [#uses=1]
-       %tmp20 = load %struct.list*, %struct.list** %tmp19              ; <%struct.list*> [#uses=1]
-       store %struct.list* %tmp20, %struct.list** %l
+       %tmp19 = getelementptr %struct.list, ptr %tmp22, i32 0, i32 1           ; <ptr> [#uses=1]
+       %tmp20 = load ptr, ptr %tmp19           ; <ptr> [#uses=1]
+       store ptr %tmp20, ptr %l
        br label %bb21
 
 bb21:          ; preds = %cond_next, %entry
-        %l.in = phi %struct.list** [ @operators, %entry ], [ %tmp19, %cond_next ]
-       %tmp22 = load %struct.list*, %struct.list** %l.in               ; <%struct.list*> [#uses=1]
-       icmp ne %struct.list* %tmp22, null              ; <i1>:3 [#uses=1]
+        %l.in = phi ptr [ @operators, %entry ], [ %tmp19, %cond_next ]
+       %tmp22 = load ptr, ptr %l.in            ; <ptr> [#uses=1]
+       icmp ne ptr %tmp22, null                ; <i1>:3 [#uses=1]
        zext i1 %3 to i8                ; <i8>:4 [#uses=1]
        icmp ne i8 %4, 0                ; <i1>:5 [#uses=1]
        br i1 %5, label %bb, label %bb23
 
 bb23:          ; preds = %bb21
-       %tmp24 = load i32, i32* %c              ; <i32> [#uses=1]
-       store i32 %tmp24, i32* %tmp
-       %tmp25 = load i32, i32* %tmp            ; <i32> [#uses=1]
-       store i32 %tmp25, i32* %retval
+       %tmp24 = load i32, ptr %c               ; <i32> [#uses=1]
+       store i32 %tmp24, ptr %tmp
+       %tmp25 = load i32, ptr %tmp             ; <i32> [#uses=1]
+       store i32 %tmp25, ptr %retval
        br label %return
 
 return:                ; preds = %bb23
-       %retval26 = load i32, i32* %retval              ; <i32> [#uses=1]
+       %retval26 = load i32, ptr %retval               ; <i32> [#uses=1]
        ret i32 %retval26
 }
 
-declare i32 @fprintf(%struct.FILE*, i8*, ...)
+declare i32 @fprintf(ptr, ptr, ...)
index 91ff991..254e03d 100644 (file)
@@ -27,8 +27,8 @@ bb243:                ; preds = %bb307
        br label %bb307
 
 bb307:         ; preds = %bb243, %bb52
-       %sx_addr.2.pn = phi float* [ %sx_addr.5, %bb243 ], [ null, %bb52 ]              ; <float*> [#uses=1]
-       %sx_addr.5 = getelementptr float, float* %sx_addr.2.pn, i32 %incx               ; <float*> [#uses=1]
+       %sx_addr.2.pn = phi ptr [ %sx_addr.5, %bb243 ], [ null, %bb52 ]         ; <ptr> [#uses=1]
+       %sx_addr.5 = getelementptr float, ptr %sx_addr.2.pn, i32 %incx          ; <ptr> [#uses=1]
        br i1 false, label %bb243, label %bb310
 
 bb310:         ; preds = %bb307
index f10370d..5f04bb1 100644 (file)
@@ -41,15 +41,15 @@ for.end:                                          ; preds = %for.cond
 
 ; Despite having an invalid cost, we can rotate this because we don't
 ; need to duplicate any instructions or execute them more frequently.
-define void @invalid_no_dup(<vscale x 1 x i8>* %p) nounwind ssp {
+define void @invalid_no_dup(ptr %p) nounwind ssp {
 ; CHECK-LABEL: @invalid_no_dup(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[I_01:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ]
-; CHECK-NEXT:    [[A:%.*]] = load <vscale x 1 x i8>, <vscale x 1 x i8>* [[P:%.*]], align 1
+; CHECK-NEXT:    [[A:%.*]] = load <vscale x 1 x i8>, ptr [[P:%.*]], align 1
 ; CHECK-NEXT:    [[B:%.*]] = add <vscale x 1 x i8> [[A]], [[A]]
-; CHECK-NEXT:    store <vscale x 1 x i8> [[B]], <vscale x 1 x i8>* [[P]], align 1
+; CHECK-NEXT:    store <vscale x 1 x i8> [[B]], ptr [[P]], align 1
 ; CHECK-NEXT:    [[INC]] = add nsw i32 [[I_01]], 1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[INC]], 100
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]
@@ -66,9 +66,9 @@ for.cond:                                         ; preds = %for.body, %entry
 
 
 for.body:                                         ; preds = %for.cond
-  %a = load <vscale x 1 x i8>, <vscale x 1 x i8>* %p
+  %a = load <vscale x 1 x i8>, ptr %p
   %b = add <vscale x 1 x i8> %a, %a
-  store <vscale x 1 x i8> %b, <vscale x 1 x i8>* %p
+  store <vscale x 1 x i8> %b, ptr %p
   %inc = add nsw i32 %i.0, 1
   br label %for.cond
 
@@ -79,15 +79,15 @@ for.end:                                          ; preds = %for.cond
 ; This demonstrates a case where a) loop rotate needs a cost estimate to
 ; know if rotation is profitable, and b) there is no cost estimate available
 ; due to invalid costs in the loop.  We can't rotate this loop.
-define void @invalid_dup_required(<vscale x 1 x i8>* %p) nounwind ssp {
+define void @invalid_dup_required(ptr %p) nounwind ssp {
 ; CHECK-LABEL: @invalid_dup_required(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[FOR_COND:%.*]]
 ; CHECK:       for.cond:
 ; CHECK-NEXT:    [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ]
-; CHECK-NEXT:    [[A:%.*]] = load <vscale x 1 x i8>, <vscale x 1 x i8>* [[P:%.*]], align 1
+; CHECK-NEXT:    [[A:%.*]] = load <vscale x 1 x i8>, ptr [[P:%.*]], align 1
 ; CHECK-NEXT:    [[B:%.*]] = add <vscale x 1 x i8> [[A]], [[A]]
-; CHECK-NEXT:    store <vscale x 1 x i8> [[B]], <vscale x 1 x i8>* [[P]], align 1
+; CHECK-NEXT:    store <vscale x 1 x i8> [[B]], ptr [[P]], align 1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[I_0]], 100
 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]
 ; CHECK:       for.body:
@@ -102,9 +102,9 @@ entry:
 
 for.cond:                                         ; preds = %for.body, %entry
   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
-  %a = load <vscale x 1 x i8>, <vscale x 1 x i8>* %p
+  %a = load <vscale x 1 x i8>, ptr %p
   %b = add <vscale x 1 x i8> %a, %a
-  store <vscale x 1 x i8> %b, <vscale x 1 x i8>* %p
+  store <vscale x 1 x i8> %b, ptr %p
   %cmp = icmp slt i32 %i.0, 100
   br i1 %cmp, label %for.body, label %for.end
 
index 273ba73..2ef24de 100644 (file)
@@ -5,16 +5,16 @@
 ; We expect a different value for %ptr each iteration (according to the
 ; definition of alloca). I.e. each @use must be paired with an alloca.
 
-; CHECK: call void @use(i8* %
+; CHECK: call void @use(ptr %
 ; CHECK: %ptr = alloca i8
 
 @e = global i16 10
 
-declare void @use(i8*)
+declare void @use(ptr)
 
 define void @test() {
 entry:
-  %end = load i16, i16* @e
+  %end = load i16, ptr @e
   br label %loop
 
 loop:
@@ -25,7 +25,7 @@ loop:
 
 loop.fin:
   %n = add i16 %n.phi, 1
-  call void @use(i8* %ptr)
+  call void @use(ptr %ptr)
   br label %loop
 
 exit:
index cae3c7d..aa9f510 100644 (file)
@@ -16,7 +16,6 @@ entry:
 for.cond:                                         ; preds = %for.body, %entry
   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
   %cmp = icmp slt i32 %i.0, 100
-  %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0
   br i1 %cmp, label %for.body, label %for.end
 
 ; CHECK: for.body:
@@ -24,17 +23,17 @@ for.cond:                                         ; preds = %for.body, %entry
 ; CHECK-NEXT: store i32 0
 
 for.body:                                         ; preds = %for.cond
-  store i32 0, i32* %arrayidx, align 16
+  store i32 0, ptr %array, align 16
   %inc = add nsw i32 %i.0, 1
   br label %for.cond
 
 for.end:                                          ; preds = %for.cond
-  %arrayidx.lcssa = phi i32* [ %arrayidx, %for.cond ]
-  call void @g(i32* %arrayidx.lcssa) nounwind
+  %arrayidx.lcssa = phi ptr [ %array, %for.cond ]
+  call void @g(ptr %arrayidx.lcssa) nounwind
   ret void
 }
 
-declare void @g(i32*)
+declare void @g(ptr)
 
 ; CHECK-LABEL: @test2(
 define void @test2() nounwind ssp {
index c62ed0b..e4be918 100644 (file)
@@ -9,7 +9,6 @@ define void @test_prepare_for_lto() {
 ; FULL-LABEL: @test_prepare_for_lto(
 ; FULL-NEXT:  entry:
 ; FULL-NEXT:    %array = alloca [20 x i32], align 16
-; FULL-NEXT:    %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0
 ; FULL-NEXT:    call void @may_be_inlined()
 ; FULL-NEXT:    br label %for.body
 ;
@@ -25,12 +24,11 @@ entry:
 for.cond:                                         ; preds = %for.body, %entry
   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
   %cmp = icmp slt i32 %i.0, 100
-  %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0
   call void @may_be_inlined()
   br i1 %cmp, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond
-  store i32 0, i32* %arrayidx, align 16
+  store i32 0, ptr %array, align 16
   %inc = add nsw i32 %i.0, 1
   br label %for.cond
 
@@ -49,14 +47,12 @@ define void @test_prepare_for_lto_intrinsic() !dbg !7 {
 ; FULL-NEXT:  entry:
 ; FULL-NEXT:    %array = alloca [20 x i32], align 16
 ; FULL-NEXT:    call void @llvm.dbg.value(metadata i32 0, metadata !12, metadata !DIExpression()), !dbg !13
-; FULL-NEXT:    %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0
 ; FULL-NEXT:    br label %for.body
 ;
 ; PREPARE-LABEL: @test_prepare_for_lto_intrinsic(
 ; PREPARE-NEXT:  entry:
 ; PREPARE-NEXT:    %array = alloca [20 x i32], align 16
 ; PREPARE-NEXT:    call void @llvm.dbg.value(metadata i32 0, metadata !12, metadata !DIExpression()), !dbg !13
-; PREPARE-NEXT:    %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0
 ; PREPARE-NEXT:    br label %for.body
 ;
 entry:
@@ -67,11 +63,10 @@ for.cond:                                         ; preds = %for.body, %entry
   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
   call void @llvm.dbg.value(metadata i32 %i.0, metadata !12, metadata !DIExpression()), !dbg !13
   %cmp = icmp slt i32 %i.0, 100
-  %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0
   br i1 %cmp, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond
-  store i32 0, i32* %arrayidx, align 16
+  store i32 0, ptr %array, align 16
   %inc = add nsw i32 %i.0, 1
   br label %for.cond
 
index bdc415d..abe3479 100644 (file)
@@ -11,8 +11,8 @@ define i32 @o() #0 {
 ; CHECK-LABEL: @o(
 ; CHECK-NEXT:  bb:
 ; CHECK-NEXT:    [[I:%.*]] = alloca [1 x i32], align 4
-; CHECK-NEXT:    [[I1:%.*]] = load i8*, i8** bitcast (i64* @d to i8**), align 8
-; CHECK-NEXT:    [[I33:%.*]] = load i32, i32* @f, align 4
+; CHECK-NEXT:    [[I1:%.*]] = load ptr, ptr @d, align 8
+; CHECK-NEXT:    [[I33:%.*]] = load i32, ptr @f, align 4
 ; CHECK-NEXT:    [[I44:%.*]] = icmp eq i32 [[I33]], 0
 ; CHECK-NEXT:    br i1 [[I44]], label [[BB15:%.*]], label [[BB5_LR_PH:%.*]]
 ; CHECK:       bb5.lr.ph:
@@ -21,13 +21,12 @@ define i32 @o() #0 {
 ; CHECK-NEXT:    [[I35:%.*]] = phi i32 [ [[I33]], [[BB5_LR_PH]] ], [ [[I3:%.*]], [[M_EXIT:%.*]] ]
 ; CHECK-NEXT:    [[I6:%.*]] = icmp ult i32 [[I35]], 4
 ; CHECK-NEXT:    [[I7:%.*]] = zext i1 [[I6]] to i32
-; CHECK-NEXT:    store i32 [[I7]], i32* @g, align 4
-; CHECK-NEXT:    [[I8:%.*]] = bitcast [1 x i32]* [[I]] to i8*
-; CHECK-NEXT:    [[I9:%.*]] = call i32 @n(i8* nonnull [[I8]], i8* [[I1]])
+; CHECK-NEXT:    store i32 [[I7]], ptr @g, align 4
+; CHECK-NEXT:    [[I9:%.*]] = call i32 @n(ptr nonnull [[I]], ptr [[I1]])
 ; CHECK-NEXT:    [[I10:%.*]] = icmp eq i32 [[I9]], 0
 ; CHECK-NEXT:    br i1 [[I10]], label [[THREAD_PRE_SPLIT:%.*]], label [[BB5_BB15_CRIT_EDGE:%.*]]
 ; CHECK:       thread-pre-split:
-; CHECK-NEXT:    [[DOTPR:%.*]] = load i32, i32* @i, align 4
+; CHECK-NEXT:    [[DOTPR:%.*]] = load i32, ptr @i, align 4
 ; CHECK-NEXT:    [[I12:%.*]] = icmp eq i32 [[DOTPR]], 0
 ; CHECK-NEXT:    br i1 [[I12]], label [[M_EXIT]], label [[BB13_LR_PH:%.*]]
 ; CHECK:       bb13.lr.ph:
@@ -47,8 +46,8 @@ define i32 @o() #0 {
 ; CHECK-NEXT:    br label [[M_EXIT]]
 ; CHECK:       m.exit:
 ; CHECK-NEXT:    [[DOT1_LCSSA:%.*]] = phi i32 [ [[SPLIT]], [[BB13_M_EXIT_CRIT_EDGE:%.*]] ], [ [[SPLIT2]], [[BB11_M_EXIT_CRIT_EDGE]] ], [ undef, [[THREAD_PRE_SPLIT]] ]
-; CHECK-NEXT:    store i32 [[DOT1_LCSSA]], i32* @h, align 4
-; CHECK-NEXT:    [[I3]] = load i32, i32* @f, align 4
+; CHECK-NEXT:    store i32 [[DOT1_LCSSA]], ptr @h, align 4
+; CHECK-NEXT:    [[I3]] = load i32, ptr @f, align 4
 ; CHECK-NEXT:    [[I4:%.*]] = icmp eq i32 [[I3]], 0
 ; CHECK-NEXT:    br i1 [[I4]], label [[BB2_BB15_CRIT_EDGE:%.*]], label [[BB5]]
 ; CHECK:       bb5.bb15_crit_edge:
@@ -60,25 +59,24 @@ define i32 @o() #0 {
 ;
 bb:
   %i = alloca [1 x i32], align 4
-  %i1 = load i8*, i8** bitcast (i64* @d to i8**), align 8
+  %i1 = load ptr, ptr @d, align 8
   br label %bb2
 
 bb2:                                              ; preds = %m.exit, %bb
-  %i3 = load i32, i32* @f, align 4
+  %i3 = load i32, ptr @f, align 4
   %i4 = icmp eq i32 %i3, 0
   br i1 %i4, label %bb15, label %bb5
 
 bb5:                                              ; preds = %bb2
   %i6 = icmp ult i32 %i3, 4
   %i7 = zext i1 %i6 to i32
-  store i32 %i7, i32* @g, align 4
-  %i8 = bitcast [1 x i32]* %i to i8*
-  %i9 = call i32 @n(i8* nonnull %i8, i8* %i1)
+  store i32 %i7, ptr @g, align 4
+  %i9 = call i32 @n(ptr nonnull %i, ptr %i1)
   %i10 = icmp eq i32 %i9, 0
   br i1 %i10, label %thread-pre-split, label %bb15
 
 thread-pre-split:                                 ; preds = %bb5
-  %.pr = load i32, i32* @i, align 4
+  %.pr = load i32, ptr @i, align 4
   br label %bb11
 
 bb11:                                             ; preds = %j.exit.i, %thread-pre-split
@@ -96,14 +94,14 @@ j.exit.i:                                         ; preds = %bb13
 
 m.exit:                                           ; preds = %bb13, %bb11
   %.1.lcssa = phi i32 [ %.1, %bb13 ], [ %.1, %bb11 ]
-  store i32 %.1.lcssa, i32* @h, align 4
+  store i32 %.1.lcssa, ptr @h, align 4
   br label %bb2
 
 bb15:                                             ; preds = %bb5, %bb2
   ret i32 undef
 }
 
-declare i32 @n(i8*, i8*)  #0
+declare i32 @n(ptr, ptr)  #0
 
 attributes #0 = { "use-soft-float"="false" }
 attributes #1 = { nounwind }
index f4eb1b5..9dc1770 100644 (file)
@@ -4,7 +4,7 @@ target triple = "x86_64-pc-windows-msvc"
 
 declare void @always_throws()
 
-define i32 @test() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+define i32 @test() personality ptr @__CxxFrameHandler3 {
 entry:
   invoke void @always_throws()
           to label %continue unwind label %catch.dispatch
@@ -16,7 +16,7 @@ catch.dispatch:
   %t0 = catchswitch within none [label %catch] unwind to caller
 
 catch:
-  %t1 = catchpad within %t0 [i8* null, i32 64, i8* null]
+  %t1 = catchpad within %t0 [ptr null, i32 64, ptr null]
   catchret from %t1 to label %for.cond
 
 for.cond:
index 0ff0540..8ca5f6c 100644 (file)
@@ -42,7 +42,7 @@ bb127:          ; preds = %bb139
 bb139:          ; preds = %bb127, %entry
         br i1 false, label %bb127, label %bb142
 bb142:          ; preds = %bb139
-        %r91.0.lcssa = phi %struct.relation* [ null, %bb139 ]           ; <%struct.relation*> [#uses=0]
+        %r91.0.lcssa = phi ptr [ null, %bb139 ]           ; <ptr> [#uses=0]
         ret void
 }
 
@@ -97,19 +97,19 @@ bb835:              ; preds = %bb830
 }
 
        %struct.NSArray = type { %struct.NSObject }
-       %struct.NSObject = type { %struct.objc_class* }
+       %struct.NSObject = type { ptr }
        %struct.NSRange = type { i64, i64 }
-       %struct._message_ref_t = type { %struct.NSObject* (%struct.NSObject*, %struct._message_ref_t*, ...)*, %struct.objc_selector* }
+       %struct._message_ref_t = type { ptr, ptr }
        %struct.objc_class = type opaque
        %struct.objc_selector = type opaque
-@"\01L_OBJC_MESSAGE_REF_26" = external global %struct._message_ref_t           ; <%struct._message_ref_t*> [#uses=1]
+@"\01L_OBJC_MESSAGE_REF_26" = external global %struct._message_ref_t           ; <ptr> [#uses=1]
 
-define %struct.NSArray* @test5(%struct.NSArray* %self, %struct._message_ref_t* %_cmd) {
+define ptr @test5(ptr %self, ptr %_cmd) {
 entry:
        br label %bb116
 
 bb116:         ; preds = %bb131, %entry
-       %tmp123 = call %struct.NSRange null( %struct.NSObject* null, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_26", %struct.NSArray* null )               ; <%struct.NSRange> [#uses=1]
+       %tmp123 = call %struct.NSRange null( ptr null, ptr @"\01L_OBJC_MESSAGE_REF_26", ptr null )              ; <%struct.NSRange> [#uses=1]
        br i1 false, label %bb141, label %bb131
 
 bb131:         ; preds = %bb116
@@ -117,15 +117,15 @@ bb131:            ; preds = %bb116
        br label %bb116
 
 bb141:         ; preds = %bb116
-       ret %struct.NSArray* null
+       ret ptr null
 }
 
-define void @test6(i8* %msg) {
+define void @test6(ptr %msg) {
 entry:
        br label %bb15
 bb6:           ; preds = %bb15
        %gep.upgrd.1 = zext i32 %offset.1 to i64                ; <i64> [#uses=1]
-       %tmp11 = getelementptr i8, i8* %msg, i64 %gep.upgrd.1           ; <i8*> [#uses=0]
+       %tmp11 = getelementptr i8, ptr %msg, i64 %gep.upgrd.1           ; <ptr> [#uses=0]
        br label %bb15
 bb15:          ; preds = %bb6, %entry
        %offset.1 = add i32 0, 1                ; <i32> [#uses=2]
@@ -140,9 +140,9 @@ bb17:               ; preds = %bb15
 
 
 ; PR9523 - Non-canonical loop.
-define void @test7(i8* %P) nounwind {
+define void @test7(ptr %P) nounwind {
 entry:
-  indirectbr i8* %P, [label %"3", label %"5"]
+  indirectbr ptr %P, [label %"3", label %"5"]
 
 "3":                                              ; preds = %"4", %entry
   br i1 undef, label %"5", label %"4"
@@ -155,7 +155,7 @@ entry:
 }
 
 ; PR21968
-define void @test8(i1 %C, i8* %P) #0 {
+define void @test8(i1 %C, ptr %P) #0 {
 entry:
   br label %for.cond
 
@@ -163,7 +163,7 @@ for.cond:                                         ; preds = %for.inc, %entry
   br i1 %C, label %l_bad, label %for.body
 
 for.body:                                         ; preds = %for.cond
-  indirectbr i8* %P, [label %for.inc, label %l_bad]
+  indirectbr ptr %P, [label %for.inc, label %l_bad]
 
 for.inc:                                          ; preds = %for.body
   br label %for.cond
index 456f6be..59a8328 100644 (file)
@@ -4,9 +4,9 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.13.0"
 
 ; Function Attrs: nounwind ssp uwtable
-define void @f(float* %input, i64 %n, i64 %s) local_unnamed_addr #0 !dbg !8 {
+define void @f(ptr %input, i64 %n, i64 %s) local_unnamed_addr #0 !dbg !8 {
 entry:
-  call void @llvm.dbg.value(metadata float* %input, metadata !15, metadata !DIExpression()), !dbg !20
+  call void @llvm.dbg.value(metadata ptr %input, metadata !15, metadata !DIExpression()), !dbg !20
   call void @llvm.dbg.value(metadata i64 %n, metadata !16, metadata !DIExpression()), !dbg !21
   call void @llvm.dbg.value(metadata i64 %s, metadata !17, metadata !DIExpression()), !dbg !22
   call void @llvm.dbg.value(metadata i64 0, metadata !18, metadata !DIExpression()), !dbg !23
@@ -25,8 +25,8 @@ for.cond.cleanup:                                 ; preds = %for.cond
   ret void, !dbg !28
 
 for.body:                                         ; preds = %for.cond
-  %arrayidx = getelementptr inbounds float, float* %input, i64 %i.0, !dbg !29
-  %0 = load float, float* %arrayidx, align 4, !dbg !29, !tbaa !30
+  %arrayidx = getelementptr inbounds float, ptr %input, i64 %i.0, !dbg !29
+  %0 = load float, ptr %arrayidx, align 4, !dbg !29, !tbaa !30
   call void @bar(float %0), !dbg !34
   %add = add nsw i64 %i.0, %s, !dbg !35
   call void @llvm.dbg.value(metadata i64 %add, metadata !18, metadata !DIExpression()), !dbg !23
index a062eb1..9616889 100644 (file)
@@ -77,9 +77,9 @@ return:                                           ; preds = %if.end
 }
 
 @channelColumns = external global i64
-@horzPlane = external global i8*, align 8
+@horzPlane = external global ptr, align 8
 
-define void @FindFreeHorzSeg(i64 %startCol, i64 %row, i64* %rowStart) {
+define void @FindFreeHorzSeg(i64 %startCol, i64 %row, ptr %rowStart) {
 ; Ensure that the loop increment basic block is rotated into the tail of the
 ; body, even though it contains a debug intrinsic call.
 ; CHECK-LABEL: define void @FindFreeHorzSeg(
@@ -100,12 +100,12 @@ for.cond:
   br i1 %cmp, label %for.end, label %for.body
 
 for.body:
-  %0 = load i64, i64* @channelColumns, align 8
+  %0 = load i64, ptr @channelColumns, align 8
   %mul = mul i64 %0, %row
   %add = add i64 %mul, %i.0
-  %1 = load i8*, i8** @horzPlane, align 8
-  %arrayidx = getelementptr inbounds i8, i8* %1, i64 %add
-  %2 = load i8, i8* %arrayidx, align 1
+  %1 = load ptr, ptr @horzPlane, align 8
+  %arrayidx = getelementptr inbounds i8, ptr %1, i64 %add
+  %2 = load i8, ptr %arrayidx, align 1
   %tobool = icmp eq i8 %2, 0
   br i1 %tobool, label %for.inc, label %for.end
 
@@ -116,7 +116,7 @@ for.inc:
 
 for.end:
   %add1 = add i64 %i.0, 1
-  store i64 %add1, i64* %rowStart, align 8
+  store i64 %add1, ptr %rowStart, align 8
   ret void
 }
 
index ae631f6..a4a52b9 100644 (file)
@@ -1,9 +1,9 @@
 ; RUN: opt -passes=loop-rotate -disable-output %s
 
 ; Make sure we don't crash on this test.
-define void @foo(i32* %arg) {
+define void @foo(ptr %arg) {
 bb:
-  %tmp = load i32, i32* %arg, align 4
+  %tmp = load i32, ptr %arg, align 4
   br label %bb1
 
 bb1:                                              ; preds = %bb7, %bb
@@ -17,7 +17,7 @@ bb6:                                              ; preds = %bb1
   ret void
 
 bb7:                                              ; preds = %bb1
-  %tmp8 = getelementptr inbounds i8, i8* undef, i64 8
+  %tmp8 = getelementptr inbounds i8, ptr undef, i64 8
   br label %bb1
 }
 
index 37050a9..baa91a6 100644 (file)
@@ -12,7 +12,7 @@ while.body:                                       ; preds = %while.cond
   br label %indirectgoto
 
 run_opcode:                                       ; preds = %indirectgoto
-  %tmp276 = load i8, i8* undef                        ; <i8> [#uses=1]
+  %tmp276 = load i8, ptr undef                        ; <i8> [#uses=1]
   br label %indirectgoto
 
 if.else295:                                       ; preds = %divide_late
@@ -39,11 +39,11 @@ sw.default42406:                                  ; preds = %sw.bb30351
 
 indirectgoto:                                     ; preds = %run_opcode, %while.body
   %opcode.0 = phi i8 [ undef, %while.body ], [ %tmp276, %run_opcode ] ; <i8> [#uses=2]
-  indirectbr i8* undef, [label %run_opcode, label %if.else295, label %end_opcode]
+  indirectbr ptr undef, [label %run_opcode, label %if.else295, label %end_opcode]
 }
 
 ; CHECK-LABEL: @foo
-define void @foo(i1 %a, i1 %b, i8* %c) {
+define void @foo(i1 %a, i1 %b, ptr %c) {
 ; CHECK: entry
 ; CHECK-NEXT: br i1 %a, label %return, label %preheader
 entry:
@@ -60,9 +60,9 @@ header:
   br i1 %b, label %return, label %body
 
 ; CHECK: body:
-; CHECK-NEXT:  indirectbr i8* %c, [label %return, label %latch]
+; CHECK-NEXT:  indirectbr ptr %c, [label %return, label %latch]
 body:
-  indirectbr i8* %c, [label %return, label %latch]
+  indirectbr ptr %c, [label %return, label %latch]
 
 ; CHECK: latch:
 ; CHECK-NEXT:  br label %header
index 2ff5628..dbc51fb 100644 (file)
 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
 target triple = "thumbv8m.base-arm-none-eabi"
 
-%struct.List = type { %struct.List*, i32 }
+%struct.List = type { ptr, i32 }
 
-define void @list_add(%struct.List** nocapture %list, %struct.List* %data) {
+define void @list_add(ptr nocapture %list, ptr %data) {
 ; CHECK-LABEL: @list_add(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = load %struct.List*, %struct.List** [[LIST:%.*]], align 4
-; CHECK-NEXT:    [[VAL2:%.*]] = getelementptr inbounds [[STRUCT_LIST:%.*]], %struct.List* [[TMP0]], i32 0, i32 1
-; CHECK-NEXT:    [[TMP1:%.*]] = load i32, i32* [[VAL2]], align 4
-; CHECK-NEXT:    [[VAL1:%.*]] = getelementptr inbounds [[STRUCT_LIST]], %struct.List* [[DATA:%.*]], i32 0, i32 1
-; CHECK-NEXT:    [[TMP2:%.*]] = load i32, i32* [[VAL1]], align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[LIST:%.*]], align 4
+; CHECK-NEXT:    [[VAL2:%.*]] = getelementptr inbounds [[STRUCT_LIST:%.*]], ptr [[TMP0]], i32 0, i32 1
+; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[VAL2]], align 4
+; CHECK-NEXT:    [[VAL1:%.*]] = getelementptr inbounds [[STRUCT_LIST]], ptr [[DATA:%.*]], i32 0, i32 1
+; CHECK-NEXT:    [[TMP2:%.*]] = load i32, ptr [[VAL1]], align 4
 ; CHECK-NEXT:    [[CMP3:%.*]] = icmp slt i32 [[TMP1]], [[TMP2]]
 ; CHECK-NEXT:    br i1 [[CMP3]], label [[IF_THEN_LR_PH:%.*]], label [[IF_ELSE6:%.*]]
 ; CHECK:       if.then.lr.ph:
 ; CHECK-NEXT:    br label [[IF_THEN:%.*]]
 ; CHECK:       for.cond:
-; CHECK-NEXT:    [[CURR_0:%.*]] = phi %struct.List* [ [[TMP5:%.*]], [[IF_THEN]] ]
-; CHECK-NEXT:    [[PREV_0:%.*]] = phi %struct.List* [ [[CURR_04:%.*]], [[IF_THEN]] ]
-; CHECK-NEXT:    [[VAL:%.*]] = getelementptr inbounds [[STRUCT_LIST]], %struct.List* [[CURR_0]], i32 0, i32 1
-; CHECK-NEXT:    [[TMP3:%.*]] = load i32, i32* [[VAL]], align 4
-; CHECK-NEXT:    [[TMP4:%.*]] = load i32, i32* [[VAL1]], align 4
+; CHECK-NEXT:    [[CURR_0:%.*]] = phi ptr [ [[TMP5:%.*]], [[IF_THEN]] ]
+; CHECK-NEXT:    [[PREV_0:%.*]] = phi ptr [ [[CURR_04:%.*]], [[IF_THEN]] ]
+; CHECK-NEXT:    [[VAL:%.*]] = getelementptr inbounds [[STRUCT_LIST]], ptr [[CURR_0]], i32 0, i32 1
+; CHECK-NEXT:    [[TMP3:%.*]] = load i32, ptr [[VAL]], align 4
+; CHECK-NEXT:    [[TMP4:%.*]] = load i32, ptr [[VAL1]], align 4
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[TMP3]], [[TMP4]]
 ; CHECK-NEXT:    br i1 [[CMP]], label [[IF_THEN]], label [[FOR_COND_IF_ELSE6_CRIT_EDGE:%.*]]
 ; CHECK:       if.then:
-; CHECK-NEXT:    [[CURR_04]] = phi %struct.List* [ [[TMP0]], [[IF_THEN_LR_PH]] ], [ [[CURR_0]], [[FOR_COND:%.*]] ]
-; CHECK-NEXT:    [[NEXT:%.*]] = getelementptr inbounds [[STRUCT_LIST]], %struct.List* [[CURR_04]], i32 0, i32 0
-; CHECK-NEXT:    [[TMP5]] = load %struct.List*, %struct.List** [[NEXT]], align 4
-; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq %struct.List* [[TMP5]], null
+; CHECK-NEXT:    [[CURR_04]] = phi ptr [ [[TMP0]], [[IF_THEN_LR_PH]] ], [ [[CURR_0]], [[FOR_COND:%.*]] ]
+; CHECK-NEXT:    [[TMP5]] = load ptr, ptr [[CURR_04]], align 4
+; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq ptr [[TMP5]], null
 ; CHECK-NEXT:    br i1 [[TOBOOL]], label [[IF_ELSE:%.*]], label [[FOR_COND]]
 ; CHECK:       if.else:
-; CHECK-NEXT:    [[NEXT_LCSSA:%.*]] = phi %struct.List** [ [[NEXT]], [[IF_THEN]] ]
-; CHECK-NEXT:    store %struct.List* [[DATA]], %struct.List** [[NEXT_LCSSA]], align 4
-; CHECK-NEXT:    [[NEXT5:%.*]] = getelementptr inbounds [[STRUCT_LIST]], %struct.List* [[DATA]], i32 0, i32 0
-; CHECK-NEXT:    store %struct.List* null, %struct.List** [[NEXT5]], align 4
+; CHECK-NEXT:    [[NEXT_LCSSA:%.*]] = phi ptr [ [[CURR_04]], [[IF_THEN]] ]
+; CHECK-NEXT:    store ptr [[DATA]], ptr [[NEXT_LCSSA]], align 4
+; CHECK-NEXT:    store ptr null, ptr [[DATA]], align 4
 ; CHECK-NEXT:    br label [[FOR_END:%.*]]
 ; CHECK:       for.cond.if.else6_crit_edge:
-; CHECK-NEXT:    [[SPLIT:%.*]] = phi %struct.List* [ [[PREV_0]], [[FOR_COND]] ]
+; CHECK-NEXT:    [[SPLIT:%.*]] = phi ptr [ [[PREV_0]], [[FOR_COND]] ]
 ; CHECK-NEXT:    br label [[IF_ELSE6]]
 ; CHECK:       if.else6:
-; CHECK-NEXT:    [[PREV_0_LCSSA:%.*]] = phi %struct.List* [ [[SPLIT]], [[FOR_COND_IF_ELSE6_CRIT_EDGE]] ], [ null, [[ENTRY:%.*]] ]
-; CHECK-NEXT:    [[TOBOOL7:%.*]] = icmp eq %struct.List* [[PREV_0_LCSSA]], null
+; CHECK-NEXT:    [[PREV_0_LCSSA:%.*]] = phi ptr [ [[SPLIT]], [[FOR_COND_IF_ELSE6_CRIT_EDGE]] ], [ null, [[ENTRY:%.*]] ]
+; CHECK-NEXT:    [[TOBOOL7:%.*]] = icmp eq ptr [[PREV_0_LCSSA]], null
 ; CHECK-NEXT:    br i1 [[TOBOOL7]], label [[IF_ELSE12:%.*]], label [[IF_THEN8:%.*]]
 ; CHECK:       if.then8:
-; CHECK-NEXT:    [[NEXT9:%.*]] = getelementptr inbounds [[STRUCT_LIST]], %struct.List* [[PREV_0_LCSSA]], i32 0, i32 0
-; CHECK-NEXT:    [[TMP6:%.*]] = bitcast %struct.List* [[PREV_0_LCSSA]] to i32*
-; CHECK-NEXT:    [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4
-; CHECK-NEXT:    [[TMP8:%.*]] = bitcast %struct.List* [[DATA]] to i32*
-; CHECK-NEXT:    store i32 [[TMP7]], i32* [[TMP8]], align 4
-; CHECK-NEXT:    store %struct.List* [[DATA]], %struct.List** [[NEXT9]], align 4
+; CHECK-NEXT:    [[TMP7:%.*]] = load i32, ptr [[PREV_0_LCSSA]], align 4
+; CHECK-NEXT:    store i32 [[TMP7]], ptr [[DATA]], align 4
+; CHECK-NEXT:    store ptr [[DATA]], ptr [[PREV_0_LCSSA]], align 4
 ; CHECK-NEXT:    br label [[FOR_END]]
 ; CHECK:       if.else12:
-; CHECK-NEXT:    [[TMP9:%.*]] = bitcast %struct.List** [[LIST]] to i32*
-; CHECK-NEXT:    [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4
-; CHECK-NEXT:    [[TMP11:%.*]] = bitcast %struct.List* [[DATA]] to i32*
-; CHECK-NEXT:    store i32 [[TMP10]], i32* [[TMP11]], align 4
-; CHECK-NEXT:    store %struct.List* [[DATA]], %struct.List** [[LIST]], align 4
+; CHECK-NEXT:    [[TMP10:%.*]] = load i32, ptr [[LIST]], align 4
+; CHECK-NEXT:    store i32 [[TMP10]], ptr [[DATA]], align 4
+; CHECK-NEXT:    store ptr [[DATA]], ptr [[LIST]], align 4
 ; CHECK-NEXT:    br label [[FOR_END]]
 ; CHECK:       for.end:
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %0 = load %struct.List*, %struct.List** %list, align 4
+  %0 = load ptr, ptr %list, align 4
   br label %for.cond
 
 for.cond:                                         ; preds = %if.then, %entry
-  %curr.0 = phi %struct.List* [ %0, %entry ], [ %3, %if.then ]
-  %prev.0 = phi %struct.List* [ null, %entry ], [ %curr.0, %if.then ]
-  %val = getelementptr inbounds %struct.List, %struct.List* %curr.0, i32 0, i32 1
-  %1 = load i32, i32* %val, align 4
-  %val1 = getelementptr inbounds %struct.List, %struct.List* %data, i32 0, i32 1
-  %2 = load i32, i32* %val1, align 4
+  %curr.0 = phi ptr [ %0, %entry ], [ %3, %if.then ]
+  %prev.0 = phi ptr [ null, %entry ], [ %curr.0, %if.then ]
+  %val = getelementptr inbounds %struct.List, ptr %curr.0, i32 0, i32 1
+  %1 = load i32, ptr %val, align 4
+  %val1 = getelementptr inbounds %struct.List, ptr %data, i32 0, i32 1
+  %2 = load i32, ptr %val1, align 4
   %cmp = icmp slt i32 %1, %2
   br i1 %cmp, label %if.then, label %if.else6
 
 if.then:                                          ; preds = %for.cond
-  %next = getelementptr inbounds %struct.List, %struct.List* %curr.0, i32 0, i32 0
-  %3 = load %struct.List*, %struct.List** %next, align 4
-  %tobool = icmp eq %struct.List* %3, null
+  %3 = load ptr, ptr %curr.0, align 4
+  %tobool = icmp eq ptr %3, null
   br i1 %tobool, label %if.else, label %for.cond
 
 if.else:                                          ; preds = %if.then
-  %next.lcssa = phi %struct.List** [ %next, %if.then ]
-  store %struct.List* %data, %struct.List** %next.lcssa, align 4
-  %next5 = getelementptr inbounds %struct.List, %struct.List* %data, i32 0, i32 0
-  store %struct.List* null, %struct.List** %next5, align 4
+  %next.lcssa = phi ptr [ %curr.0, %if.then ]
+  store ptr %data, ptr %next.lcssa, align 4
+  store ptr null, ptr %data, align 4
   br label %for.end
 
 if.else6:                                         ; preds = %for.cond
-  %prev.0.lcssa = phi %struct.List* [ %prev.0, %for.cond ]
-  %tobool7 = icmp eq %struct.List* %prev.0.lcssa, null
+  %prev.0.lcssa = phi ptr [ %prev.0, %for.cond ]
+  %tobool7 = icmp eq ptr %prev.0.lcssa, null
   br i1 %tobool7, label %if.else12, label %if.then8
 
 if.then8:                                         ; preds = %if.else6
-  %next9 = getelementptr inbounds %struct.List, %struct.List* %prev.0.lcssa, i32 0, i32 0
-  %4 = bitcast %struct.List* %prev.0.lcssa to i32*
-  %5 = load i32, i32* %4, align 4
-  %6 = bitcast %struct.List* %data to i32*
-  store i32 %5, i32* %6, align 4
-  store %struct.List* %data, %struct.List** %next9, align 4
+  %4 = load i32, ptr %prev.0.lcssa, align 4
+  store i32 %4, ptr %data, align 4
+  store ptr %data, ptr %prev.0.lcssa, align 4
   br label %for.end
 
 if.else12:                                        ; preds = %if.else6
-  %7 = bitcast %struct.List** %list to i32*
-  %8 = load i32, i32* %7, align 4
-  %9 = bitcast %struct.List* %data to i32*
-  store i32 %8, i32* %9, align 4
-  store %struct.List* %data, %struct.List** %list, align 4
+  %5 = load i32, ptr %list, align 4
+  store i32 %5, ptr %data, align 4
+  store ptr %data, ptr %list, align 4
   br label %for.end
 
 for.end:                                          ; preds = %if.else12, %if.then8, %if.else
   ret void
 }
 
-define i32 @test2(i32* %l) {
+define i32 @test2(ptr %l) {
 ; CHECK-LABEL: @test2(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[L:%.*]], align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr [[L:%.*]], align 4
 ; CHECK-NEXT:    [[TOBOOL2:%.*]] = icmp eq i32 [[TMP0]], 0
 ; CHECK-NEXT:    br i1 [[TOBOOL2]], label [[CLEANUP:%.*]], label [[DO_COND_LR_PH:%.*]]
 ; CHECK:       do.cond.lr.ph:
 ; CHECK-NEXT:    br label [[DO_COND:%.*]]
 ; CHECK:       do.body:
 ; CHECK-NEXT:    [[A_0:%.*]] = phi i32 [ [[REM:%.*]], [[DO_COND]] ]
-; CHECK-NEXT:    [[TMP1:%.*]] = load i32, i32* [[L]], align 4
+; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[L]], align 4
 ; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[TMP1]], 0
 ; CHECK-NEXT:    br i1 [[TOBOOL]], label [[DO_BODY_CLEANUP_CRIT_EDGE:%.*]], label [[DO_COND]]
 ; CHECK:       do.body.cleanup_crit_edge:
@@ -134,13 +120,13 @@ define i32 @test2(i32* %l) {
 ; CHECK-NEXT:    br label [[CLEANUP]]
 ; CHECK:       cleanup:
 ; CHECK-NEXT:    [[A_0_LCSSA:%.*]] = phi i32 [ [[SPLIT]], [[DO_BODY_CLEANUP_CRIT_EDGE]] ], [ 100, [[ENTRY:%.*]] ]
-; CHECK-NEXT:    store i32 10, i32* [[L]], align 4
+; CHECK-NEXT:    store i32 10, ptr [[L]], align 4
 ; CHECK-NEXT:    br label [[CLEANUP2:%.*]]
 ; CHECK:       do.cond:
 ; CHECK-NEXT:    [[TMP2:%.*]] = phi i32 [ [[TMP0]], [[DO_COND_LR_PH]] ], [ [[TMP1]], [[DO_BODY]] ]
 ; CHECK-NEXT:    [[MUL:%.*]] = mul nsw i32 [[TMP2]], 13
 ; CHECK-NEXT:    [[REM]] = srem i32 [[MUL]], 27
-; CHECK-NEXT:    [[TMP3:%.*]] = load i32, i32* [[L]], align 4
+; CHECK-NEXT:    [[TMP3:%.*]] = load i32, ptr [[L]], align 4
 ; CHECK-NEXT:    [[TOBOOL1:%.*]] = icmp eq i32 [[TMP3]], 0
 ; CHECK-NEXT:    br i1 [[TOBOOL1]], label [[CLEANUP2_LOOPEXIT:%.*]], label [[DO_BODY]]
 ; CHECK:       cleanup2.loopexit:
@@ -154,19 +140,19 @@ entry:
 
 do.body:                                          ; preds = %do.cond, %entry
   %a.0 = phi i32 [ 100, %entry ], [ %rem, %do.cond ]
-  %0 = load i32, i32* %l, align 4
+  %0 = load i32, ptr %l, align 4
   %tobool = icmp eq i32 %0, 0
   br i1 %tobool, label %cleanup, label %do.cond
 
 cleanup:                                          ; preds = %do.body
   %a.0.lcssa = phi i32 [ %a.0, %do.body ]
-  store i32 10, i32* %l, align 4
+  store i32 10, ptr %l, align 4
   br label %cleanup2
 
 do.cond:                                          ; preds = %do.body
   %mul = mul nsw i32 %0, 13
   %rem = srem i32 %mul, 27
-  %1 = load i32, i32* %l, align 4
+  %1 = load i32, ptr %l, align 4
   %tobool1 = icmp eq i32 %1, 0
   br i1 %tobool1, label %cleanup2.loopexit, label %do.body
 
@@ -178,23 +164,23 @@ cleanup2:                                         ; preds = %cleanup2.loopexit,
   ret i32 %retval.2
 }
 
-define i32 @no_rotate(i32* %l) {
+define i32 @no_rotate(ptr %l) {
 ; CHECK-LABEL: @no_rotate(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[DO_BODY:%.*]]
 ; CHECK:       do.body:
 ; CHECK-NEXT:    [[A_0:%.*]] = phi i32 [ 100, [[ENTRY:%.*]] ], [ [[REM:%.*]], [[DO_COND:%.*]] ]
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[L:%.*]], align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr [[L:%.*]], align 4
 ; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0
 ; CHECK-NEXT:    br i1 [[TOBOOL]], label [[CLEANUP:%.*]], label [[DO_COND]]
 ; CHECK:       cleanup:
 ; CHECK-NEXT:    [[A_0_LCSSA:%.*]] = phi i32 [ [[A_0]], [[DO_BODY]] ]
-; CHECK-NEXT:    store i32 10, i32* [[L]], align 4
+; CHECK-NEXT:    store i32 10, ptr [[L]], align 4
 ; CHECK-NEXT:    br label [[CLEANUP2:%.*]]
 ; CHECK:       do.cond:
 ; CHECK-NEXT:    [[MUL:%.*]] = mul nsw i32 [[A_0]], 13
 ; CHECK-NEXT:    [[REM]] = srem i32 [[MUL]], 27
-; CHECK-NEXT:    [[TMP1:%.*]] = load i32, i32* [[L]], align 4
+; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[L]], align 4
 ; CHECK-NEXT:    [[TOBOOL1:%.*]] = icmp eq i32 [[TMP1]], 0
 ; CHECK-NEXT:    br i1 [[TOBOOL1]], label [[CLEANUP2_LOOPEXIT:%.*]], label [[DO_BODY]]
 ; CHECK:       cleanup2.loopexit:
@@ -208,19 +194,19 @@ entry:
 
 do.body:                                          ; preds = %do.cond, %entry
   %a.0 = phi i32 [ 100, %entry ], [ %rem, %do.cond ]
-  %0 = load i32, i32* %l, align 4
+  %0 = load i32, ptr %l, align 4
   %tobool = icmp eq i32 %0, 0
   br i1 %tobool, label %cleanup, label %do.cond
 
 cleanup:                                          ; preds = %do.body
   %a.0.lcssa = phi i32 [ %a.0, %do.body ]
-  store i32 10, i32* %l, align 4
+  store i32 10, ptr %l, align 4
   br label %cleanup2
 
 do.cond:                                          ; preds = %do.body
   %mul = mul nsw i32 %a.0, 13
   %rem = srem i32 %mul, 27
-  %1 = load i32, i32* %l, align 4
+  %1 = load i32, ptr %l, align 4
   %tobool1 = icmp eq i32 %1, 0
   br i1 %tobool1, label %cleanup2.loopexit, label %do.body
 
index e6b12d6..72bc543 100644 (file)
@@ -7,13 +7,13 @@
 
 declare i32 @llvm.experimental.deoptimize.i32(...)
 
-define i32 @test_cond_with_one_deopt_exit(i32 * nonnull %a, i64 %x) {
+define i32 @test_cond_with_one_deopt_exit(ptr nonnull %a, i64 %x) {
 ; Rotation done twice.
 ; Latch should be at the 2nd condition (for.cond2), exiting to %return.
 ;
 ; CHECK-LABEL: @test_cond_with_one_deopt_exit(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[VAL_A_IDX3:%.*]] = load i32, i32* %a, align 4
+; CHECK-NEXT:    [[VAL_A_IDX3:%.*]] = load i32, ptr %a, align 4
 ; CHECK-NEXT:    [[ZERO_CHECK4:%.*]] = icmp eq i32 [[VAL_A_IDX3]], 0
 ; CHECK-NEXT:    br i1 [[ZERO_CHECK4]], label %deopt.exit, label %for.cond2.lr.ph
 ; CHECK:       for.cond2.lr.ph:
@@ -27,7 +27,7 @@ define i32 @test_cond_with_one_deopt_exit(i32 * nonnull %a, i64 %x) {
 ; CHECK:       for.body:
 ; CHECK:         br label %for.tail
 ; CHECK:       for.tail:
-; CHECK:         [[VAL_A_IDX:%.*]] = load i32, i32*
+; CHECK:         [[VAL_A_IDX:%.*]] = load i32, ptr
 ; CHECK-NEXT:    [[ZERO_CHECK:%.*]] = icmp eq i32 [[VAL_A_IDX]], 0
 ; CHECK-NEXT:    br i1 [[ZERO_CHECK]], label %for.cond1.deopt.exit_crit_edge, label %for.cond2
 ; CHECK:       for.cond2.return_crit_edge:
@@ -49,8 +49,8 @@ entry:
 for.cond1:
   %idx = phi i64 [ 0, %entry ], [ %idx.next, %for.tail ]
   %sum = phi i32 [ 0, %entry ], [ %sum.next, %for.tail ]
-  %a.idx = getelementptr inbounds i32, i32 *%a, i64 %idx
-  %val.a.idx = load i32, i32* %a.idx, align 4
+  %a.idx = getelementptr inbounds i32, ptr %a, i64 %idx
+  %val.a.idx = load i32, ptr %a.idx, align 4
   %zero.check = icmp eq i32 %val.a.idx, 0
   br i1 %zero.check, label %deopt.exit, label %for.cond2
 
@@ -74,17 +74,17 @@ deopt.exit:
   ret i32 %deopt.val
 }
 
-define i32 @test_cond_with_two_deopt_exits(i32 ** nonnull %a, i64 %x) {
+define i32 @test_cond_with_two_deopt_exits(ptr nonnull %a, i64 %x) {
 ; Rotation done three times.
 ; Latch should be at the 3rd condition (for.cond3), exiting to %return.
 ;
 ; CHECK-LABEL: @test_cond_with_two_deopt_exits(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[A_IDX_DEREF4:%.*]] = load i32*, i32** %a
-; CHECK-NEXT:    [[NULL_CHECK5:%.*]] = icmp eq i32* [[A_IDX_DEREF4]], null
+; CHECK-NEXT:    [[A_IDX_DEREF4:%.*]] = load ptr, ptr %a
+; CHECK-NEXT:    [[NULL_CHECK5:%.*]] = icmp eq ptr [[A_IDX_DEREF4]], null
 ; CHECK-NEXT:    br i1 [[NULL_CHECK5]], label %deopt.exit1, label %for.cond2.lr.ph
 ; CHECK:       for.cond2.lr.ph:
-; CHECK-NEXT:    [[VAL_A_IDX9:%.*]] = load i32, i32* [[A_IDX_DEREF4]], align 4
+; CHECK-NEXT:    [[VAL_A_IDX9:%.*]] = load i32, ptr [[A_IDX_DEREF4]], align 4
 ; CHECK-NEXT:    [[ZERO_CHECK10:%.*]] = icmp eq i32 [[VAL_A_IDX9]], 0
 ; CHECK-NEXT:    br i1 [[ZERO_CHECK10]], label %deopt.exit2, label %for.cond3.lr.ph
 ; CHECK:       for.cond3.lr.ph:
@@ -93,7 +93,7 @@ define i32 @test_cond_with_two_deopt_exits(i32 ** nonnull %a, i64 %x) {
 ; CHECK:       for.body.lr.ph:
 ; CHECK-NEXT:    br label %for.body
 ; CHECK:       for.cond2:
-; CHECK:         [[VAL_A_IDX:%.*]] = load i32, i32*
+; CHECK:         [[VAL_A_IDX:%.*]] = load i32, ptr
 ; CHECK-NEXT:    [[ZERO_CHECK:%.*]] = icmp eq i32 [[VAL_A_IDX]], 0
 ; CHECK-NEXT:    br i1 [[ZERO_CHECK]], label %for.cond2.deopt.exit2_crit_edge, label %for.cond3
 ; CHECK:       for.cond3:
@@ -103,7 +103,7 @@ define i32 @test_cond_with_two_deopt_exits(i32 ** nonnull %a, i64 %x) {
 ; CHECK:         br label %for.tail
 ; CHECK:       for.tail:
 ; CHECK:         [[IDX_NEXT:%.*]] = add nuw nsw i64 {{%.*}}, 1
-; CHECK:         [[NULL_CHECK:%.*]] = icmp eq i32* {{%.*}}, null
+; CHECK:         [[NULL_CHECK:%.*]] = icmp eq ptr {{%.*}}, null
 ; CHECK-NEXT:    br i1 [[NULL_CHECK]], label %for.cond1.deopt.exit1_crit_edge, label %for.cond2
 ; CHECK:       for.cond3.return_crit_edge:
 ; CHECK-NEXT:    [[SPLIT18:%.*]] = phi i32
@@ -130,13 +130,13 @@ entry:
 for.cond1:
   %idx = phi i64 [ 0, %entry ], [ %idx.next, %for.tail ]
   %sum = phi i32 [ 0, %entry ], [ %sum.next, %for.tail ]
-  %a.idx = getelementptr inbounds i32*, i32 **%a, i64 %idx
-  %a.idx.deref = load i32*, i32** %a.idx
-  %null.check = icmp eq i32* %a.idx.deref, null
+  %a.idx = getelementptr inbounds ptr, ptr %a, i64 %idx
+  %a.idx.deref = load ptr, ptr %a.idx
+  %null.check = icmp eq ptr %a.idx.deref, null
   br i1 %null.check, label %deopt.exit1, label %for.cond2
 
 for.cond2:
-  %val.a.idx = load i32, i32* %a.idx.deref, align 4
+  %val.a.idx = load i32, ptr %a.idx.deref, align 4
   %zero.check = icmp eq i32 %val.a.idx, 0
   br i1 %zero.check, label %deopt.exit2, label %for.cond3
 
index a874d12..5832c76 100644 (file)
@@ -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-f3
 target triple = "x86_64-apple-macosx10.8.0"
 
 ; PR7447
-define i32 @test1([100 x i32]* nocapture %a) nounwind readonly {
+define i32 @test1(ptr nocapture %a) nounwind readonly {
 entry:
   br label %for.cond
 
@@ -21,8 +21,8 @@ for.cond1:                                        ; preds = %for.cond, %land.rhs
 
 land.rhs:                                         ; preds = %for.cond1
   %conv = zext i32 %i.1 to i64
-  %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* %a, i64 0, i64 %conv
-  %0 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %conv
+  %0 = load i32, ptr %arrayidx, align 4
   %add = add i32 %0, %sum.1
   %cmp4 = icmp ugt i32 %add, 1000
   %inc = add i32 %i.1, 1
@@ -84,10 +84,10 @@ declare i32 @foo(i32)
 
 declare i32 @bar(i32)
 
-@_ZTIi = external constant i8*
+@_ZTIi = external constant ptr
 
 ; Verify dominators.
-define void @test3(i32 %x) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @test3(i32 %x) personality ptr @__gxx_personality_v0 {
 entry:
   %cmp2 = icmp eq i32 0, %x
   br i1 %cmp2, label %try.cont.loopexit, label %for.body.lr.ph
@@ -106,16 +106,16 @@ for.inc:                                          ; preds = %for.body
   br i1 %cmp, label %for.cond.try.cont.loopexit_crit_edge, label %for.body
 
 lpad:                                             ; preds = %for.body
-  %0 = landingpad { i8*, i32 }
-          catch i8* bitcast (i8** @_ZTIi to i8*)
-  %1 = extractvalue { i8*, i32 } %0, 0
-  %2 = extractvalue { i8*, i32 } %0, 1
-  %3 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) nounwind
+  %0 = landingpad { ptr, i32 }
+          catch ptr @_ZTIi
+  %1 = extractvalue { ptr, i32 } %0, 0
+  %2 = extractvalue { ptr, i32 } %0, 1
+  %3 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIi) nounwind
   %matches = icmp eq i32 %2, %3
   br i1 %matches, label %catch, label %eh.resume
 
 catch:                                            ; preds = %lpad
-  %4 = tail call i8* @__cxa_begin_catch(i8* %1) nounwind
+  %4 = tail call ptr @__cxa_begin_catch(ptr %1) nounwind
   br i1 true, label %invoke.cont2.loopexit, label %for.body.i.lr.ph
 
 for.body.i.lr.ph:                                 ; preds = %catch
@@ -132,15 +132,15 @@ for.inc.i:                                        ; preds = %for.body.i
   br i1 %cmp.i, label %for.cond.i.invoke.cont2.loopexit_crit_edge, label %for.body.i
 
 lpad.i:                                           ; preds = %for.body.i
-  %5 = landingpad { i8*, i32 }
-          catch i8* bitcast (i8** @_ZTIi to i8*)
-  %6 = extractvalue { i8*, i32 } %5, 0
-  %7 = extractvalue { i8*, i32 } %5, 1
+  %5 = landingpad { ptr, i32 }
+          catch ptr @_ZTIi
+  %6 = extractvalue { ptr, i32 } %5, 0
+  %7 = extractvalue { ptr, i32 } %5, 1
   %matches.i = icmp eq i32 %7, %3
   br i1 %matches.i, label %catch.i, label %lpad1.body
 
 catch.i:                                          ; preds = %lpad.i
-  %8 = tail call i8* @__cxa_begin_catch(i8* %6) nounwind
+  %8 = tail call ptr @__cxa_begin_catch(ptr %6) nounwind
   invoke void @test3(i32 0)
           to label %invoke.cont2.i unwind label %lpad1.i
 
@@ -149,10 +149,10 @@ invoke.cont2.i:                                   ; preds = %catch.i
   br label %invoke.cont2
 
 lpad1.i:                                          ; preds = %catch.i
-  %9 = landingpad { i8*, i32 }
+  %9 = landingpad { ptr, i32 }
           cleanup
-  %10 = extractvalue { i8*, i32 } %9, 0
-  %11 = extractvalue { i8*, i32 } %9, 1
+  %10 = extractvalue { ptr, i32 } %9, 0
+  %11 = extractvalue { ptr, i32 } %9, 1
   tail call void @__cxa_end_catch() nounwind
   br label %lpad1.body
 
@@ -176,26 +176,26 @@ try.cont:                                         ; preds = %try.cont.loopexit,
   ret void
 
 lpad1.body:                                       ; preds = %lpad1.i, %lpad.i
-  %exn.slot.0.i = phi i8* [ %10, %lpad1.i ], [ %6, %lpad.i ]
+  %exn.slot.0.i = phi ptr [ %10, %lpad1.i ], [ %6, %lpad.i ]
   %ehselector.slot.0.i = phi i32 [ %11, %lpad1.i ], [ %7, %lpad.i ]
   tail call void @__cxa_end_catch() nounwind
   br label %eh.resume
 
 eh.resume:                                        ; preds = %lpad1.body, %lpad
-  %exn.slot.0 = phi i8* [ %exn.slot.0.i, %lpad1.body ], [ %1, %lpad ]
+  %exn.slot.0 = phi ptr [ %exn.slot.0.i, %lpad1.body ], [ %1, %lpad ]
   %ehselector.slot.0 = phi i32 [ %ehselector.slot.0.i, %lpad1.body ], [ %2, %lpad ]
-  %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn.slot.0, 0
-  %lpad.val5 = insertvalue { i8*, i32 } %lpad.val, i32 %ehselector.slot.0, 1
-  resume { i8*, i32 } %lpad.val5
+  %lpad.val = insertvalue { ptr, i32 } undef, ptr %exn.slot.0, 0
+  %lpad.val5 = insertvalue { ptr, i32 } %lpad.val, i32 %ehselector.slot.0, 1
+  resume { ptr, i32 } %lpad.val5
 }
 
 declare void @_Z3fooi(i32)
 
 declare i32 @__gxx_personality_v0(...)
 
-declare i32 @llvm.eh.typeid.for(i8*) nounwind readnone
+declare i32 @llvm.eh.typeid.for(ptr) nounwind readnone
 
-declare i8* @__cxa_begin_catch(i8*)
+declare ptr @__cxa_begin_catch(ptr)
 
 declare void @__cxa_end_catch()
 
index e85df4d..da72a5f 100644 (file)
@@ -5,18 +5,18 @@
 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-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-declare void @g(i32*)
+declare void @g(ptr)
 
-define void @test_02(i32* nocapture %_pA) nounwind ssp {
+define void @test_02(ptr nocapture %_pA) nounwind ssp {
 ; CHECK-LABEL: @test_02(
 ; CHECK: entry:
 ; CHECK:   tail call void @llvm.experimental.noalias.scope.decl(metadata !2)
-; CHECK:   store i32 42, i32* %_pA, align 16, !alias.scope !2
+; CHECK:   store i32 42, ptr %_pA, align 16, !alias.scope !2
 ; CHECK: for.body:
 ; CHECK:   tail call void @llvm.experimental.noalias.scope.decl(metadata !5)
-; CHECK:   store i32 0, i32* %arrayidx, align 16, !noalias !5
+; CHECK:   store i32 0, ptr %array, align 16, !noalias !5
 ; CHECK:   tail call void @llvm.experimental.noalias.scope.decl(metadata !7)
-; CHECK:   store i32 42, i32* %_pA, align 16, !alias.scope !7
+; CHECK:   store i32 42, ptr %_pA, align 16, !alias.scope !7
 ; CHECK: for.end:
 
 entry:
@@ -26,29 +26,28 @@ entry:
 for.cond:                                         ; preds = %for.body, %entry
   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
   tail call void @llvm.experimental.noalias.scope.decl(metadata !2)
-  store i32 42, i32* %_pA, align 16, !alias.scope !2
+  store i32 42, ptr %_pA, align 16, !alias.scope !2
   %cmp = icmp slt i32 %i.0, 100
-  %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0
   br i1 %cmp, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond
-  store i32 0, i32* %arrayidx, align 16, !noalias !2
+  store i32 0, ptr %array, align 16, !noalias !2
   %inc = add nsw i32 %i.0, 1
   br label %for.cond
 
 for.end:                                          ; preds = %for.cond
-  %arrayidx.lcssa = phi i32* [ %arrayidx, %for.cond ]
-  call void @g(i32* %arrayidx.lcssa) nounwind
+  %arrayidx.lcssa = phi ptr [ %array, %for.cond ]
+  call void @g(ptr %arrayidx.lcssa) nounwind
   ret void
 }
 
-define void @test_03(i32* nocapture %_pA) nounwind ssp {
+define void @test_03(ptr nocapture %_pA) nounwind ssp {
 ; CHECK-LABEL: @test_03(
 ; CHECK: entry:
 ; CHECK: for.body:
 ; CHECK:   tail call void @llvm.experimental.noalias.scope.decl(metadata !5)
-; CHECK:   store i32 42, i32* %_pA, align 16, !alias.scope !5
-; CHECK:   store i32 0, i32* %arrayidx, align 16, !noalias !5
+; CHECK:   store i32 42, ptr %_pA, align 16, !alias.scope !5
+; CHECK:   store i32 0, ptr %array, align 16, !noalias !5
 ; CHECK: for.end:
 
 entry:
@@ -58,33 +57,32 @@ entry:
 for.cond:                                         ; preds = %for.body, %entry
   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
   %cmp = icmp slt i32 %i.0, 100
-  %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0
   br i1 %cmp, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond
   tail call void @llvm.experimental.noalias.scope.decl(metadata !2)
-  store i32 42, i32* %_pA, align 16, !alias.scope !2
-  store i32 0, i32* %arrayidx, align 16, !noalias !2
+  store i32 42, ptr %_pA, align 16, !alias.scope !2
+  store i32 0, ptr %array, align 16, !noalias !2
   %inc = add nsw i32 %i.0, 1
   br label %for.cond
 
 for.end:                                          ; preds = %for.cond
-  %arrayidx.lcssa = phi i32* [ %arrayidx, %for.cond ]
-  call void @g(i32* %arrayidx.lcssa) nounwind
+  %arrayidx.lcssa = phi ptr [ %array, %for.cond ]
+  call void @g(ptr %arrayidx.lcssa) nounwind
   ret void
 }
 
-define void @test_04(i32* nocapture %_pA) nounwind ssp {
+define void @test_04(ptr nocapture %_pA) nounwind ssp {
 ; CHECK-LABEL: @test_04(
 ; CHECK: entry:
 ; CHECK:   tail call void @llvm.experimental.noalias.scope.decl(metadata !9)
-; CHECK:   store i32 42, i32* %_pA, align 16, !alias.scope !9
+; CHECK:   store i32 42, ptr %_pA, align 16, !alias.scope !9
 ; CHECK: for.body:
 ; CHECK:   tail call void @llvm.experimental.noalias.scope.decl(metadata !5)
-; CHECK:   store i32 0, i32* %arrayidx, align 16, !noalias !5
-; CHECK:   store i32 43, i32* %_pA, align 16, !alias.scope !5
+; CHECK:   store i32 0, ptr %array, align 16, !noalias !5
+; CHECK:   store i32 43, ptr %_pA, align 16, !alias.scope !5
 ; CHECK:   tail call void @llvm.experimental.noalias.scope.decl(metadata !11)
-; CHECK:   store i32 42, i32* %_pA, align 16, !alias.scope !11
+; CHECK:   store i32 42, ptr %_pA, align 16, !alias.scope !11
 ; CHECK: for.end:
 entry:
   %array = alloca [20 x i32], align 16
@@ -93,36 +91,35 @@ entry:
 for.cond:                                         ; preds = %for.body, %entry
   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
   tail call void @llvm.experimental.noalias.scope.decl(metadata !2)
-  store i32 42, i32* %_pA, align 16, !alias.scope !2
+  store i32 42, ptr %_pA, align 16, !alias.scope !2
   %cmp = icmp slt i32 %i.0, 100
-  %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0
   br i1 %cmp, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond
-  store i32 0, i32* %arrayidx, align 16, !noalias !2
-  store i32 43, i32* %_pA, align 16, !alias.scope !2
+  store i32 0, ptr %array, align 16, !noalias !2
+  store i32 43, ptr %_pA, align 16, !alias.scope !2
   %inc = add nsw i32 %i.0, 1
   br label %for.cond
 
 for.end:                                          ; preds = %for.cond
-  %arrayidx.lcssa = phi i32* [ %arrayidx, %for.cond ]
-  call void @g(i32* %arrayidx.lcssa) nounwind
+  %arrayidx.lcssa = phi ptr [ %array, %for.cond ]
+  call void @g(ptr %arrayidx.lcssa) nounwind
   ret void
 }
 
-define void @test_05(i32* nocapture %_pA) nounwind ssp {
+define void @test_05(ptr nocapture %_pA) nounwind ssp {
 ; CHECK-LABEL: @test_05(
 ; CHECK: entry:
 ; CHECK:   tail call void @llvm.experimental.noalias.scope.decl(metadata !13)
-; CHECK:   store i32 42, i32* %_pA, align 16, !alias.scope !13
+; CHECK:   store i32 42, ptr %_pA, align 16, !alias.scope !13
 ; CHECK: for.body:
 ; CHECK:   tail call void @llvm.experimental.noalias.scope.decl(metadata !5)
-; CHECK:   store i32 0, i32* %arrayidx, align 16, !noalias !5
-; CHECK:   store i32 43, i32* %_pA, align 16, !alias.scope !5
+; CHECK:   store i32 0, ptr %array, align 16, !noalias !5
+; CHECK:   store i32 43, ptr %_pA, align 16, !alias.scope !5
 ; CHECK:   tail call void @llvm.experimental.noalias.scope.decl(metadata !15)
-; CHECK:   store i32 42, i32* %_pA, align 16, !alias.scope !15
+; CHECK:   store i32 42, ptr %_pA, align 16, !alias.scope !15
 ; CHECK: for.end:
-; CHECK:   store i32 44, i32* %_pA, align 16, !alias.scope !5
+; CHECK:   store i32 44, ptr %_pA, align 16, !alias.scope !5
 
 entry:
   %array = alloca [20 x i32], align 16
@@ -131,21 +128,20 @@ entry:
 for.cond:                                         ; preds = %for.body, %entry
   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
   tail call void @llvm.experimental.noalias.scope.decl(metadata !2)
-  store i32 42, i32* %_pA, align 16, !alias.scope !2
+  store i32 42, ptr %_pA, align 16, !alias.scope !2
   %cmp = icmp slt i32 %i.0, 100
-  %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0
   br i1 %cmp, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond
-  store i32 0, i32* %arrayidx, align 16, !noalias !2
-  store i32 43, i32* %_pA, align 16, !alias.scope !2
+  store i32 0, ptr %array, align 16, !noalias !2
+  store i32 43, ptr %_pA, align 16, !alias.scope !2
   %inc = add nsw i32 %i.0, 1
   br label %for.cond
 
 for.end:                                          ; preds = %for.cond
-  %arrayidx.lcssa = phi i32* [ %arrayidx, %for.cond ]
-  store i32 44, i32* %_pA, align 16, !alias.scope !2
-  call void @g(i32* %arrayidx.lcssa) nounwind
+  %arrayidx.lcssa = phi ptr [ %array, %for.cond ]
+  store i32 44, ptr %_pA, align 16, !alias.scope !2
+  call void @g(ptr %arrayidx.lcssa) nounwind
   ret void
 }
 
index d4d2112..61b5178 100644 (file)
@@ -6,29 +6,29 @@ target triple = "arm64-apple-ios8.0.0"
 ;CHECK-NEXT: %incdec.ptr.i = getelementptr
 
 ; Function Attrs: alwaysinline inlinehint nounwind readonly ssp
-define linkonce_odr hidden i64 @_ZNSt3__14findINS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(i64 %__first.coerce, i64 %__last.coerce, i32* nocapture readonly dereferenceable(4) %__value_) {
+define linkonce_odr hidden i64 @_ZNSt3__14findINS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(i64 %__first.coerce, i64 %__last.coerce, ptr nocapture readonly dereferenceable(4) %__value_) {
 entry:
-  %coerce.val.ip = inttoptr i64 %__first.coerce to i32*
-  %coerce.val.ip2 = inttoptr i64 %__last.coerce to i32*
+  %coerce.val.ip = inttoptr i64 %__first.coerce to ptr
+  %coerce.val.ip2 = inttoptr i64 %__last.coerce to ptr
   br label %for.cond
 
 for.cond:                                         ; preds = %for.inc, %entry
-  %coerce.val.ip9 = phi i32* [ %incdec.ptr.i, %for.inc ], [ %coerce.val.ip, %entry ]
-  %lnot.i = icmp eq i32* %coerce.val.ip9, %coerce.val.ip2
+  %coerce.val.ip9 = phi ptr [ %incdec.ptr.i, %for.inc ], [ %coerce.val.ip, %entry ]
+  %lnot.i = icmp eq ptr %coerce.val.ip9, %coerce.val.ip2
   br i1 %lnot.i, label %for.end, label %for.body
 
 for.body:                                         ; preds = %for.cond
-  %0 = load i32, i32* %coerce.val.ip9, align 4
-  %1 = load i32, i32* %__value_, align 4
+  %0 = load i32, ptr %coerce.val.ip9, align 4
+  %1 = load i32, ptr %__value_, align 4
   %cmp = icmp eq i32 %0, %1
   br i1 %cmp, label %for.end, label %for.inc
 
 for.inc:                                          ; preds = %for.body
-  %incdec.ptr.i = getelementptr inbounds i32, i32* %coerce.val.ip9, i64 1
+  %incdec.ptr.i = getelementptr inbounds i32, ptr %coerce.val.ip9, i64 1
   br label %for.cond
 
 for.end:                                          ; preds = %for.cond, %for.body
-  %coerce.val.ip9.lcssa = phi i32* [ %coerce.val.ip9, %for.cond ], [ %coerce.val.ip9, %for.body ]
-  %coerce.val.pi = ptrtoint i32* %coerce.val.ip9.lcssa to i64
+  %coerce.val.ip9.lcssa = phi ptr [ %coerce.val.ip9, %for.cond ], [ %coerce.val.ip9, %for.body ]
+  %coerce.val.pi = ptrtoint ptr %coerce.val.ip9.lcssa to i64
   ret i64 %coerce.val.pi
 }
index 5ac7864..6a7847a 100644 (file)
@@ -14,7 +14,7 @@ declare void @use(i32)
 
 define void @test() {
 entry:
-  %end = load i32, i32* @e
+  %end = load i32, ptr @e
   br label %loop
 
 loop:
index b7ef7b4..f3a36df 100644 (file)
@@ -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
 target triple = "x86_64-apple-darwin10.0"
 
 ; PR5837
-define void @test(i32 %N, double* %G) nounwind ssp {
+define void @test(i32 %N, ptr %G) nounwind ssp {
 entry:
   br label %for.cond
 
@@ -13,14 +13,14 @@ for.cond:                                         ; preds = %for.body, %entry
   br i1 %cmp, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond
-  %arrayidx = getelementptr inbounds double, double* %G, i64 %j.0 ; <double*> [#uses=1]
-  %tmp3 = load double, double* %arrayidx                  ; <double> [#uses=1]
+  %arrayidx = getelementptr inbounds double, ptr %G, i64 %j.0 ; <ptr> [#uses=1]
+  %tmp3 = load double, ptr %arrayidx                  ; <double> [#uses=1]
   %sub = sub i64 %j.0, 1                          ; <i64> [#uses=1]
-  %arrayidx6 = getelementptr inbounds double, double* %G, i64 %sub ; <double*> [#uses=1]
-  %tmp7 = load double, double* %arrayidx6                 ; <double> [#uses=1]
+  %arrayidx6 = getelementptr inbounds double, ptr %G, i64 %sub ; <ptr> [#uses=1]
+  %tmp7 = load double, ptr %arrayidx6                 ; <double> [#uses=1]
   %add = fadd double %tmp3, %tmp7                 ; <double> [#uses=1]
-  %arrayidx10 = getelementptr inbounds double, double* %G, i64 %j.0 ; <double*> [#uses=1]
-  store double %add, double* %arrayidx10
+  %arrayidx10 = getelementptr inbounds double, ptr %G, i64 %j.0 ; <ptr> [#uses=1]
+  store double %add, ptr %arrayidx10
   %inc = add nsw i64 %j.0, 1                      ; <i64> [#uses=1]
   br label %for.cond
 
index 13b782e..95468e0 100644 (file)
@@ -1,11 +1,11 @@
 ; RUN: opt < %s -passes=loop-rotate -verify-memoryssa -S | FileCheck %s
 
 @a = external global i8, align 4
-@tmp = global i8* @a
+@tmp = global ptr @a
 
 define void @f() {
 ; CHECK-LABEL: define void @f(
-; CHECK: getelementptr i8, i8* @a, i32 1
+; CHECK: getelementptr i8, ptr @a, i32 1
 entry:
   br label %for.preheader
 
@@ -16,7 +16,7 @@ for.body:
   br i1 undef, label %if.end, label %if.then8
 
 if.end:
-  %arrayidx = getelementptr i8, i8* @a, i32 1
+  %arrayidx = getelementptr i8, ptr @a, i32 1
   br label %for.preheader
 
 if.then8:
index f33174c..edb7f52 100644 (file)
@@ -24,7 +24,7 @@ bb5:          ; preds = %bb4, %bb3
        br i1 %exitcond, label %bb7, label %bb4
 
 bb7:           ; preds = %bb5
-       store %struct.HexxagonMove* null, %struct.HexxagonMove** null, align 4
+       store ptr null, ptr null, align 4
        br label %bb8
 
 bb8:           ; preds = %bb7, %bb1
index 2df3023..dd5031c 100644 (file)
@@ -17,7 +17,7 @@
 ; %div2102 to i16).
 ;
 ; CHECK-SCEV: Classifying expressions for: @test_function
-; CHECK-SCEV:   %wide = load i32, i32* @offset, align 1
+; CHECK-SCEV:   %wide = load i32, ptr @offset, align 1
 ; CHECK-SCEV:   -->  %wide U: full-set S: full-set          Exits: <<Unknown>>              LoopDispositions: { %loop.outer.header: Variant, %loop.inner: Invariant }
 ; CHECK-SCEV:   %narrow = trunc i32 %wide to i16
 ; CHECK-SCEV:   -->  (trunc i32 %wide to i16) U: full-set S: full-set               Exits: <<Unknown>>              LoopDispositions: { %loop.outer.header: Variant, %loop.inner: Invariant }
@@ -25,7 +25,7 @@
 ; CHECK-SCEV:   -->  {(trunc i32 %wide to i16),+,1}<%loop.inner> U: full-set S: full-set           Exits: (-1 + (700 umax (1 + (trunc i32 %wide to i16))))               LoopDispositions: { %loop.inner: Computable, %loop.outer.header: Variant }
 ;
 ; CHECK-SCEV: Classifying expressions for: @test_function
-; CHECK-SCEV:   %wide1 = load i32, i32* @offset, align 1
+; CHECK-SCEV:   %wide1 = load i32, ptr @offset, align 1
 ; CHECK-SCEV:   -->  %wide1 U: full-set S: full-set
 ; CHECK-SCEV:   %wide2 = phi i32 [ %wide1, %loop.inner.ph.lr.ph ], [ %wide, %loop.outer.latch ]
 ; CHECK-SCEV:   -->  %wide2 U: full-set S: full-set         Exits: <<Unknown>>              LoopDispositions: { %loop.inner.ph: Variant, %loop.inner: Invariant }
@@ -43,7 +43,7 @@ entry:
   br label %loop.outer.header
 
 loop.outer.header:                                ; preds = %loop.outer.latch, %entry
-  %wide = load i32, i32* @offset, align 1
+  %wide = load i32, ptr @offset, align 1
   br i1 %cond, label %exit, label %loop.inner.ph
 
 loop.inner.ph:                                    ; preds = %loop.outer.header
@@ -53,8 +53,8 @@ loop.inner.ph:                                    ; preds = %loop.outer.header
 loop.inner:                                       ; preds = %loop.inner, %loop.inner.ph
   %iv = phi i16 [ %narrow, %loop.inner.ph ], [ %iv.plus, %loop.inner ]
   %iv.promoted = zext i16 %iv to i32
-  %gep = getelementptr inbounds [11263 x i32], [11263 x i32]* @array, i32 0, i32 %iv.promoted
-  store i32 7, i32* %gep, align 1
+  %gep = getelementptr inbounds [11263 x i32], ptr @array, i32 0, i32 %iv.promoted
+  store i32 7, ptr %gep, align 1
   %iv.plus = add i16 %iv, 1
   %cmp = icmp ult i16 %iv.plus, 700
   br i1 %cmp, label %loop.inner, label %loop.outer.latch
index f0915ed..f8d0ed8 100644 (file)
@@ -24,26 +24,26 @@ cleanup:                                          ; preds = %if.end, %if.end, %i
 }
 
 ; CHECK-LABEL: @read_line(
-define internal fastcc i32 @read_line(i8* nocapture %f) unnamed_addr {
+define internal fastcc i32 @read_line(ptr nocapture %f) unnamed_addr {
 entry:
   br label %for.cond
 
 for.cond:                                         ; preds = %if.end, %entry
-  %call = call i8* @prepbuffer(i8* nonnull undef)
-  %call1 = call i8* @fgets(i8* %call, i32 8192, i8* %f)
+  %call = call ptr @prepbuffer(ptr nonnull undef)
+  %call1 = call ptr @fgets(ptr %call, i32 8192, ptr %f)
   br i1 undef, label %if.then, label %if.end
 
 if.then:                                          ; preds = %for.cond
   ret i32 undef
 
 if.end:                                           ; preds = %for.cond
-  %call4 = call i64 @strlen(i8* %call)
+  %call4 = call i64 @strlen(ptr %call)
   br label %for.cond
 }
 
-declare dso_local i8* @prepbuffer(i8*) local_unnamed_addr
-declare dso_local i8* @fgets(i8*, i32, i8* nocapture) local_unnamed_addr
-declare dso_local i64 @strlen(i8* nocapture) local_unnamed_addr
+declare dso_local ptr @prepbuffer(ptr) local_unnamed_addr
+declare dso_local ptr @fgets(ptr, i32, ptr nocapture) local_unnamed_addr
+declare dso_local i64 @strlen(ptr nocapture) local_unnamed_addr
 
 
 ; CHECK-LABEL: @loop3
@@ -55,7 +55,7 @@ for.cond:                                         ; preds = %for.body, %entry
   br i1 undef, label %for.body, label %for.end81
 
 for.body:                                         ; preds = %for.cond
-  %.idx122.val = load i32, i32* undef, align 8
+  %.idx122.val = load i32, ptr undef, align 8
   call fastcc void @cont()
   br label %for.cond
 
@@ -96,12 +96,12 @@ do.cond:                          ; preds = %for.body
 
 for.body:                               ; preds = %if.end, %entry
   %indvar = phi i64 [ %indvar.next, %if.end ], [ 0, %entry ]
-  %array = getelementptr inbounds [3 x i32], [3 x i32]* @glob_array, i64 0, i64 %indvar
-  %0 = load i32, i32* %array, align 4
+  %array = getelementptr inbounds [3 x i32], ptr @glob_array, i64 0, i64 %indvar
+  %0 = load i32, ptr %array, align 4
   br i1 undef, label %do.cond, label %if.end
 
 if.end:                                 ; preds = %for.body
-  store i32 undef, i32* undef, align 4
+  store i32 undef, ptr undef, align 4
   %indvar.next = add nuw nsw i64 %indvar, 1
   br label %for.body
 }
index 83ac9da..2164f46 100644 (file)
@@ -1,47 +1,47 @@
 ; RUN: opt < %s -passes=loop-rotate,loop-reduce -verify-memoryssa -verify-dom-info -verify-loop-info -disable-output
 
-define fastcc void @foo(i32* %A, i64 %i) nounwind {
+define fastcc void @foo(ptr %A, i64 %i) nounwind {
 BB:
   br label %BB1
 
 BB1:                                              ; preds = %BB19, %BB
-  %tttmp1 = getelementptr i32, i32* %A, i64 %i
-  %tttmp2 = load i32, i32* %tttmp1
+  %tttmp1 = getelementptr i32, ptr %A, i64 %i
+  %tttmp2 = load i32, ptr %tttmp1
   %tttmp3 = add i32 %tttmp2, 1
-  store i32 %tttmp3, i32* %tttmp1
+  store i32 %tttmp3, ptr %tttmp1
   br label %BB4
 
 BB2:                                              ; preds = %BB4
   %tmp = bitcast i32 undef to i32                 ; <i32> [#uses=1]
-  %tttmp7 = getelementptr i32, i32* %A, i64 %i
-  %tttmp8 = load i32, i32* %tttmp7
+  %tttmp7 = getelementptr i32, ptr %A, i64 %i
+  %tttmp8 = load i32, ptr %tttmp7
   %tttmp9 = add i32 %tttmp8, 3
-  store i32 %tttmp9, i32* %tttmp7
+  store i32 %tttmp9, ptr %tttmp7
   br label %BB4
 
 BB4:                                              ; preds = %BB2, %BB1
   %tmp5 = phi i32 [ undef, %BB1 ], [ %tmp, %BB2 ] ; <i32> [#uses=1]
-  %tttmp4 = getelementptr i32, i32* %A, i64 %i
-  %tttmp5 = load i32, i32* %tttmp4
+  %tttmp4 = getelementptr i32, ptr %A, i64 %i
+  %tttmp5 = load i32, ptr %tttmp4
   %tttmp6 = add i32 %tttmp5, 3
-  store i32 %tttmp6, i32* %tttmp4
+  store i32 %tttmp6, ptr %tttmp4
   br i1 false, label %BB8, label %BB2
 
 BB8:                                              ; preds = %BB6
   %tmp7 = bitcast i32 %tmp5 to i32                ; <i32> [#uses=2]
-  %tttmp10 = getelementptr i32, i32* %A, i64 %i
-  %tttmp11 = load i32, i32* %tttmp10
+  %tttmp10 = getelementptr i32, ptr %A, i64 %i
+  %tttmp11 = load i32, ptr %tttmp10
   %tttmp12 = add i32 %tttmp11, 3
-  store i32 %tttmp12, i32* %tttmp10
+  store i32 %tttmp12, ptr %tttmp10
   br i1 false, label %BB9, label %BB13
 
 BB9:                                              ; preds = %BB12, %BB8
   %tmp10 = phi i32 [ %tmp11, %BB12 ], [ %tmp7, %BB8 ] ; <i32> [#uses=2]
   %tmp11 = add i32 %tmp10, 1                      ; <i32> [#uses=1]
-  %tttmp13 = getelementptr i32, i32* %A, i64 %i
-  %tttmp14 = load i32, i32* %tttmp13
+  %tttmp13 = getelementptr i32, ptr %A, i64 %i
+  %tttmp14 = load i32, ptr %tttmp13
   %tttmp15 = add i32 %tttmp14, 3
-  store i32 %tttmp15, i32* %tttmp13
+  store i32 %tttmp15, ptr %tttmp13
   br label %BB12
 
 BB12:                                             ; preds = %BB9
@@ -49,28 +49,28 @@ BB12:                                             ; preds = %BB9
 
 BB13:                                             ; preds = %BB15, %BB8
   %tmp14 = phi i32 [ %tmp16, %BB15 ], [ %tmp7, %BB8 ] ; <i32> [#uses=1]
-  %tttmp16 = getelementptr i32, i32* %A, i64 %i
-  %tttmp17 = load i32, i32* %tttmp16
+  %tttmp16 = getelementptr i32, ptr %A, i64 %i
+  %tttmp17 = load i32, ptr %tttmp16
   %tttmp18 = add i32 %tttmp17, 3
-  store i32 %tttmp18, i32* %tttmp16
+  store i32 %tttmp18, ptr %tttmp16
   br label %BB15
 
 BB15:                                             ; preds = %BB13
   %tmp16 = add i32 %tmp14, -1                     ; <i32> [#uses=1]
-  %tttmp19 = getelementptr i32, i32* %A, i64 %i
-  %tttmp20 = load i32, i32* %tttmp19
+  %tttmp19 = getelementptr i32, ptr %A, i64 %i
+  %tttmp20 = load i32, ptr %tttmp19
   %tttmp21 = add i32 %tttmp20, 3
-  store i32 %tttmp21, i32* %tttmp19
+  store i32 %tttmp21, ptr %tttmp19
   br i1 false, label %BB13, label %BB18
 
 BB17:                                             ; preds = %BB12
   br label %BB19
 
 BB18:                                             ; preds = %BB15
-  %tttmp22 = getelementptr i32, i32* %A, i64 %i
-  %tttmp23 = load i32, i32* %tttmp22
+  %tttmp22 = getelementptr i32, ptr %A, i64 %i
+  %tttmp23 = load i32, ptr %tttmp22
   %tttmp24 = add i32 %tttmp23, 3
-  store i32 %tttmp24, i32* %tttmp22
+  store i32 %tttmp24, ptr %tttmp22
   br label %BB19
 
 BB19:                                             ; preds = %BB18, %BB17
index dc149bd..4219ab7 100644 (file)
@@ -1,7 +1,7 @@
 ; RUN: opt -S < %s -passes='loop-mssa(loop-rotate,licm)'  -verify-dom-info -verify-loop-info | FileCheck %s
 ; PR2624 unroll multiple exits
 
-@mode_table = global [4 x i32] zeroinitializer         ; <[4 x i32]*> [#uses=1]
+@mode_table = global [4 x i32] zeroinitializer         ; <ptr> [#uses=1]
 
 ; CHECK-LABEL: @f(
 ; CHECK-NOT: bb:
@@ -13,8 +13,8 @@ entry:
 bb:            ; preds = %bb4, %entry
        %mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb4 ]          ; <i8> [#uses=4]
        zext i8 %mode.0 to i32          ; <i32>:1 [#uses=1]
-       getelementptr [4 x i32], [4 x i32]* @mode_table, i32 0, i32 %1          ; <i32*>:2 [#uses=1]
-       load i32, i32* %2, align 4              ; <i32>:3 [#uses=1]
+       getelementptr [4 x i32], ptr @mode_table, i32 0, i32 %1         ; <ptr>:2 [#uses=1]
+       load i32, ptr %2, align 4               ; <i32>:3 [#uses=1]
        icmp eq i32 %3, %0              ; <i1>:4 [#uses=1]
        br i1 %4, label %bb1, label %bb2
 
@@ -39,12 +39,11 @@ declare i32 @fegetround()
 declare void @raise_exception() noreturn
 
 ;CHECK: for.body.lr.ph:
-;CHECK-NEXT:  %arrayidx1 = getelementptr inbounds i8, i8* %CurPtr, i64 0
-;CHECK-NEXT:  %0 = load i8, i8* %arrayidx1, align 1
+;CHECK-NEXT:  %0 = load i8, ptr %CurPtr, align 1
 ;CHECK-NEXT:  %conv2 = sext i8 %0 to i32
 ;CHECK-NEXT:  br label %for.body
 
-define i32 @foo(i8* %CurPtr, i32 %a) #0 {
+define i32 @foo(ptr %CurPtr, i32 %a) #0 {
 entry:
   br label %for.cond
 
@@ -55,11 +54,10 @@ for.cond:                                     ; preds = %for.inc, %entry
 
 for.body:                                        ; preds = %for.cond
   %idxprom = zext i32 %i.0 to i64
-  %arrayidx = getelementptr inbounds i8, i8* %CurPtr, i64 %idxprom
-  %0 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds i8, ptr %CurPtr, i64 %idxprom
+  %0 = load i8, ptr %arrayidx, align 1
   %conv = sext i8 %0 to i32
-  %arrayidx1 = getelementptr inbounds i8, i8* %CurPtr, i64 0
-  %1 = load i8, i8* %arrayidx1, align 1
+  %1 = load i8, ptr %CurPtr, align 1
   %conv2 = sext i8 %1 to i32
   %cmp3 = icmp ne i32 %conv, %conv2
   br i1 %cmp3, label %return, label %for.inc