[llvm] 05ff760 - [BasicAA] Convert some tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 9 06:49:54 PST 2022
Author: Nikita Popov
Date: 2022-12-09T15:49:46+01:00
New Revision: 05ff7606c9d47135ecf5b69e25b1327634f6fa27
URL: https://github.com/llvm/llvm-project/commit/05ff7606c9d47135ecf5b69e25b1327634f6fa27
DIFF: https://github.com/llvm/llvm-project/commit/05ff7606c9d47135ecf5b69e25b1327634f6fa27.diff
LOG: [BasicAA] Convert some tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
llvm/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll
llvm/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll
llvm/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll
llvm/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll
llvm/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
llvm/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll
llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
llvm/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll
llvm/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll
llvm/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll
llvm/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll
llvm/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll
llvm/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll
llvm/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll
llvm/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll
llvm/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll
llvm/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll
llvm/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll
llvm/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll
llvm/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
llvm/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll
llvm/test/Analysis/BasicAA/aligned-overread.ll
llvm/test/Analysis/BasicAA/bug.23540.ll
llvm/test/Analysis/BasicAA/bug.23626.ll
llvm/test/Analysis/BasicAA/byval.ll
llvm/test/Analysis/BasicAA/cas.ll
llvm/test/Analysis/BasicAA/constant-over-index.ll
llvm/test/Analysis/BasicAA/dereferenceable.ll
llvm/test/Analysis/BasicAA/empty.ll
llvm/test/Analysis/BasicAA/fallback-mayalias.ll
llvm/test/Analysis/BasicAA/full-store-partial-alias.ll
llvm/test/Analysis/BasicAA/gep-and-alias-64.ll
llvm/test/Analysis/BasicAA/gep-and-alias.ll
llvm/test/Analysis/BasicAA/gep-decomposition-limit.ll
llvm/test/Analysis/BasicAA/global-size.ll
llvm/test/Analysis/BasicAA/invalidation.ll
llvm/test/Analysis/BasicAA/no-escape-call.ll
llvm/test/Analysis/BasicAA/noalias-inttoptr.ll
llvm/test/Analysis/BasicAA/noalias-param.ll
llvm/test/Analysis/BasicAA/noalias-wraparound-bug.ll
llvm/test/Analysis/BasicAA/phi-and-select.ll
llvm/test/Analysis/BasicAA/phi-loop.ll
llvm/test/Analysis/BasicAA/phi-values-usage.ll
llvm/test/Analysis/BasicAA/pr18573.ll
llvm/test/Analysis/BasicAA/ptrmask.ll
llvm/test/Analysis/BasicAA/tailcall-modref.ll
llvm/test/Analysis/BasicAA/underlying-value.ll
llvm/test/Analysis/BasicAA/unreachable-block.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll b/llvm/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
index fd107ccdbc985..c8991f5bc7958 100644
--- a/llvm/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
+++ b/llvm/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
@@ -1,7 +1,7 @@
; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -disable-output 2>/dev/null
; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
-define void @test({[2 x i32],[2 x i32]}* %A, i64 %X, i64 %Y) {
- %P1 = getelementptr {[2 x i32],[2 x i32]}, {[2 x i32],[2 x i32]}* %A, i64 0, i32 0, i64 %X
- %P2 = getelementptr {[2 x i32],[2 x i32]}, {[2 x i32],[2 x i32]}* %A, i64 0, i32 1, i64 %Y
+define void @test(ptr %A, i64 %X, i64 %Y) {
+ %P1 = getelementptr {[2 x i32],[2 x i32]}, ptr %A, i64 0, i32 0, i64 %X
+ %P2 = getelementptr {[2 x i32],[2 x i32]}, ptr %A, i64 0, i32 1, i64 %Y
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll b/llvm/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll
index 50c3738f98cc3..02ace2df2ce5d 100644
--- a/llvm/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll
+++ b/llvm/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll
@@ -2,13 +2,13 @@
; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
-define i32 @test(i32 *%Ptr, i64 %V) {
+define i32 @test(ptr %Ptr, i64 %V) {
; CHECK: sub i32 %X, %Y
- %P2 = getelementptr i32, i32* %Ptr, i64 1
- %P1 = getelementptr i32, i32* %Ptr, i64 %V
- %X = load i32, i32* %P1
- store i32 5, i32* %P2
- %Y = load i32, i32* %P1
+ %P2 = getelementptr i32, ptr %Ptr, i64 1
+ %P1 = getelementptr i32, ptr %Ptr, i64 %V
+ %X = load i32, ptr %P1
+ store i32 5, ptr %P2
+ %Y = load i32, ptr %P1
%Z = sub i32 %X, %Y
ret i32 %Z
}
diff --git a/llvm/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll b/llvm/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll
index 86f134425850e..429f8c3abac64 100644
--- a/llvm/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll
+++ b/llvm/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll
@@ -1,7 +1,6 @@
; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -disable-output 2>/dev/null
; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
-define void @test([17 x i16]* %mask_bits) {
- %P1 = getelementptr [17 x i16], [17 x i16]* %mask_bits, i64 0, i64 0
- %P2 = getelementptr [17 x i16], [17 x i16]* %mask_bits, i64 252645134, i64 0
+define void @test(ptr %mask_bits) {
+ %P2 = getelementptr [17 x i16], ptr %mask_bits, i64 252645134, i64 0
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll b/llvm/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll
index d4586c9805f3a..d4d030875de72 100644
--- a/llvm/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll
+++ b/llvm/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll
@@ -1,19 +1,19 @@
; RUN: opt < %s -aa-pipeline=basic-aa -passes=licm -disable-output
- %struct..apr_array_header_t = type { i32*, i32, i32, i32, i8* }
+ %struct..apr_array_header_t = type { ptr, i32, i32, i32, ptr }
%struct..apr_table_t = type { %struct..apr_array_header_t, i32, [32 x i32], [32 x i32] }
-define void @table_reindex(%struct..apr_table_t* %t.1) { ; No predecessors!
+define void @table_reindex(ptr %t.1) { ; No predecessors!
br label %loopentry
loopentry: ; preds = %0, %no_exit
- %tmp.101 = getelementptr %struct..apr_table_t, %struct..apr_table_t* %t.1, i64 0, i32 0, i32 2
- %tmp.11 = load i32, i32* %tmp.101 ; <i32> [#uses=0]
+ %tmp.101 = getelementptr %struct..apr_table_t, ptr %t.1, i64 0, i32 0, i32 2
+ %tmp.11 = load i32, ptr %tmp.101 ; <i32> [#uses=0]
br i1 false, label %no_exit, label %UnifiedExitNode
no_exit: ; preds = %loopentry
%tmp.25 = sext i32 0 to i64 ; <i64> [#uses=1]
- %tmp.261 = getelementptr %struct..apr_table_t, %struct..apr_table_t* %t.1, i64 0, i32 3, i64 %tmp.25 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp.261
+ %tmp.261 = getelementptr %struct..apr_table_t, ptr %t.1, i64 0, i32 3, i64 %tmp.25 ; <ptr> [#uses=1]
+ store i32 0, ptr %tmp.261
br label %loopentry
UnifiedExitNode: ; preds = %loopentry
diff --git a/llvm/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll b/llvm/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll
index 4d2e1397e882b..a5d4b49349883 100644
--- a/llvm/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll
+++ b/llvm/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll
@@ -1,11 +1,11 @@
; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -disable-output 2>/dev/null
-define i32 @MTConcat([3 x i32]* %a.1) {
- %tmp.961 = getelementptr [3 x i32], [3 x i32]* %a.1, i64 0, i64 4
- %tmp.97 = load i32, i32* %tmp.961
- %tmp.119 = getelementptr [3 x i32], [3 x i32]* %a.1, i64 1, i64 0
- %tmp.120 = load i32, i32* %tmp.119
- %tmp.1541 = getelementptr [3 x i32], [3 x i32]* %a.1, i64 0, i64 4
- %tmp.155 = load i32, i32* %tmp.1541
+define i32 @MTConcat(ptr %a.1) {
+ %tmp.961 = getelementptr [3 x i32], ptr %a.1, i64 0, i64 4
+ %tmp.97 = load i32, ptr %tmp.961
+ %tmp.119 = getelementptr [3 x i32], ptr %a.1, i64 1, i64 0
+ %tmp.120 = load i32, ptr %tmp.119
+ %tmp.1541 = getelementptr [3 x i32], ptr %a.1, i64 0, i64 4
+ %tmp.155 = load i32, ptr %tmp.1541
ret i32 0
}
diff --git a/llvm/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll b/llvm/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
index d7a2561cb505a..d28eb75491612 100644
--- a/llvm/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
+++ b/llvm/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
@@ -4,7 +4,7 @@
%struct..RefRect = type { %struct..RefPoint, %struct..RefPoint }
define i32 @BMT_CommitPartDrawObj() {
- %tmp.19111 = getelementptr %struct..RefRect, %struct..RefRect* null, i64 0, i32 0, i32 1, i32 2
- %tmp.20311 = getelementptr %struct..RefRect, %struct..RefRect* null, i64 0, i32 1, i32 1, i32 2
+ %tmp.19111 = getelementptr %struct..RefRect, ptr null, i64 0, i32 0, i32 1, i32 2
+ %tmp.20311 = getelementptr %struct..RefRect, ptr null, i64 0, i32 1, i32 1, i32 2
ret i32 0
}
diff --git a/llvm/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll b/llvm/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll
index ed4f61c15f9d5..5a6dd044db846 100644
--- a/llvm/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll
+++ b/llvm/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll
@@ -5,11 +5,11 @@
; CHECK: define i32 @test
; CHECK-NEXT: ret i32 0
-define i32 @test(i32* %P) {
+define i32 @test(ptr %P) {
%X = alloca i32
- %V1 = load i32, i32* %P
- store i32 0, i32* %X
- %V2 = load i32, i32* %P
+ %V1 = load i32, ptr %P
+ store i32 0, ptr %X
+ %V2 = load i32, ptr %P
%Diff = sub i32 %V1, %V2
ret i32 %Diff
}
diff --git a/llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll b/llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
index 11c239ca19153..c60b79017ea6f 100644
--- a/llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
+++ b/llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
@@ -10,11 +10,9 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; CHECK: Function: test
; CHECK-NOT: MayAlias:
-define void @test(%T* %P) {
- %A = getelementptr %T, %T* %P, i64 0
- %B = getelementptr %T, %T* %P, i64 0, i32 0
- %C = getelementptr %T, %T* %P, i64 0, i32 1
- %D = getelementptr %T, %T* %P, i64 0, i32 1, i64 0
- %E = getelementptr %T, %T* %P, i64 0, i32 1, i64 5
+define void @test(ptr %P) {
+ %C = getelementptr %T, ptr %P, i64 0, i32 1
+ %D = getelementptr %T, ptr %P, i64 0, i32 1, i64 0
+ %E = getelementptr %T, ptr %P, i64 0, i32 1, i64 5
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll b/llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
index ef46a34f4dfb1..ae5a1f1429d71 100644
--- a/llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
+++ b/llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
@@ -13,10 +13,8 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; CHECK-NOT: MayAlias:
define void @test() {
- %D = getelementptr %T, %T* @G, i64 0, i32 0
- %E = getelementptr %T, %T* @G, i64 0, i32 1, i64 5
- %F = getelementptr i32, i32* getelementptr (%T, %T* @G, i64 0, i32 0), i64 0
- %X = getelementptr [10 x i8], [10 x i8]* getelementptr (%T, %T* @G, i64 0, i32 1), i64 0, i64 5
+ %E = getelementptr %T, ptr @G, i64 0, i32 1, i64 5
+ %X = getelementptr [10 x i8], ptr getelementptr (%T, ptr @G, i64 0, i32 1), i64 0, i64 5
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll b/llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
index af0f8c389b2da..cbc643c89ebba 100644
--- a/llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
+++ b/llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
@@ -6,18 +6,18 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1
define void @test(i32 %N) {
entry:
- %X = alloca [3 x [3 x i32]] ; <[3 x [3 x i32]]*> [#uses=4]
+ %X = alloca [3 x [3 x i32]] ; <ptr> [#uses=4]
%tmp.24 = icmp sgt i32 %N, 0 ; <i1> [#uses=1]
br i1 %tmp.24, label %no_exit, label %loopexit
no_exit: ; preds = %no_exit, %entry
%i.0.0 = phi i32 [ 0, %entry ], [ %inc, %no_exit ] ; <i32> [#uses=2]
- %tmp.6 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 0, i32 %i.0.0 ; <i32*> [#uses=1]
- store i32 1, i32* %tmp.6
- %tmp.8 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp.9 = load i32, i32* %tmp.8 ; <i32> [#uses=1]
- %tmp.11 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 1, i32 0 ; <i32*> [#uses=1]
- %tmp.12 = load i32, i32* %tmp.11 ; <i32> [#uses=1]
+ %tmp.6 = getelementptr [3 x [3 x i32]], ptr %X, i32 0, i32 0, i32 %i.0.0 ; <ptr> [#uses=1]
+ store i32 1, ptr %tmp.6
+ %tmp.8 = getelementptr [3 x [3 x i32]], ptr %X, i32 0, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp.9 = load i32, ptr %tmp.8 ; <i32> [#uses=1]
+ %tmp.11 = getelementptr [3 x [3 x i32]], ptr %X, i32 0, i32 1, i32 0 ; <ptr> [#uses=1]
+ %tmp.12 = load i32, ptr %tmp.11 ; <i32> [#uses=1]
%tmp.13 = add i32 %tmp.12, %tmp.9 ; <i32> [#uses=1]
%inc = add i32 %i.0.0, 1 ; <i32> [#uses=2]
%tmp.2 = icmp slt i32 %inc, %N ; <i1> [#uses=1]
@@ -25,9 +25,9 @@ no_exit: ; preds = %no_exit, %entry
loopexit: ; preds = %no_exit, %entry
%Y.0.1 = phi i32 [ 0, %entry ], [ %tmp.13, %no_exit ] ; <i32> [#uses=1]
- %tmp.4 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 0 ; <[3 x i32]*> [#uses=1]
- load [3 x i32], [3 x i32]* %tmp.4
- %tmp.15 = call i32 (...) @foo( [3 x i32]* %tmp.4, i32 %Y.0.1 ) ; <i32> [#uses=0]
+ %tmp.4 = getelementptr [3 x [3 x i32]], ptr %X, i32 0, i32 0 ; <ptr> [#uses=1]
+ load [3 x i32], ptr %tmp.4
+ %tmp.15 = call i32 (...) @foo( ptr %tmp.4, i32 %Y.0.1 ) ; <i32> [#uses=0]
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll b/llvm/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll
index 33997731471c5..5d84660bb6500 100644
--- a/llvm/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll
+++ b/llvm/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll
@@ -22,8 +22,8 @@ cond_true264.i: ; preds = %bb239.i
ret void
cond_false277.i: ; preds = %bb239.i
- %tmp1062.i = getelementptr [2 x <4 x i32>], [2 x <4 x i32>]* null, i32 0, i32 1 ; <<4 x i32>*> [#uses=1]
- store <4 x i32> zeroinitializer, <4 x i32>* %tmp1062.i
+ %tmp1062.i = getelementptr [2 x <4 x i32>], ptr null, i32 0, i32 1 ; <ptr> [#uses=1]
+ store <4 x i32> zeroinitializer, ptr %tmp1062.i
br i1 false, label %cond_true1032.i, label %cond_false1063.i85
bb917.i: ; preds = %bb205.i
@@ -33,8 +33,8 @@ bb1013.i: ; preds = %bb205.i
ret void
cond_true1032.i: ; preds = %cond_false277.i
- %tmp1187.i = getelementptr [2 x <4 x i32>], [2 x <4 x i32>]* null, i32 0, i32 0, i32 7 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp1187.i
+ %tmp1187.i = getelementptr [2 x <4 x i32>], ptr null, i32 0, i32 0, i32 7 ; <ptr> [#uses=1]
+ store i32 0, ptr %tmp1187.i
br label %bb2037.i
cond_false1063.i85: ; preds = %cond_false277.i
diff --git a/llvm/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll b/llvm/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll
index ef44710614995..4ba9450f25dd2 100644
--- a/llvm/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll
+++ b/llvm/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll
@@ -8,27 +8,26 @@ target triple = "i686-apple-darwin8"
%struct.FIRST_UNION = type { %struct.FILE_POS }
%struct.FOURTH_UNION = type { %struct.CONSTRAINT }
%struct.GAP = type { i8, i8, i16 }
- %struct.LIST = type { %struct.rec*, %struct.rec* }
+ %struct.LIST = type { ptr, ptr }
%struct.SECOND_UNION = type { { i16, i8, i8 } }
%struct.STYLE = type { { %struct.GAP }, { %struct.GAP }, i16, i16, i16, i8, i8 }
%struct.THIRD_UNION = type { { [2 x i32], [2 x i32] } }
- %struct.closure_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* } }
- %struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* }, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i32 }
+ %struct.closure_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, ptr, { ptr } }
+ %struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, ptr, { ptr }, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.rec = type { %struct.head_type }
; CHECK: define i32 @test
; CHECK: %Z = sub i32 %A, %Q
; CHECK: ret i32 %Z
-define i32 @test(%struct.closure_type* %tmp18169) {
- %tmp18174 = getelementptr %struct.closure_type, %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0 ; <i32*> [#uses=2]
- %tmp18269 = bitcast i32* %tmp18174 to %struct.STYLE* ; <%struct.STYLE*> [#uses=1]
- %A = load i32, i32* %tmp18174 ; <i32> [#uses=1]
+define i32 @test(ptr %tmp18169) {
+ %tmp18174 = getelementptr %struct.closure_type, ptr %tmp18169, i32 0, i32 4, i32 0, i32 0 ; <ptr> [#uses=2]
+ %A = load i32, ptr %tmp18174 ; <i32> [#uses=1]
- %tmp18272 = getelementptr %struct.STYLE, %struct.STYLE* %tmp18269, i32 0, i32 0, i32 0, i32 2 ; <i16*> [#uses=1]
- store i16 123, i16* %tmp18272
+ %tmp18272 = getelementptr %struct.STYLE, ptr %tmp18174, i32 0, i32 0, i32 0, i32 2 ; <ptr> [#uses=1]
+ store i16 123, ptr %tmp18272
- %Q = load i32, i32* %tmp18174 ; <i32> [#uses=1]
+ %Q = load i32, ptr %tmp18174 ; <i32> [#uses=1]
%Z = sub i32 %A, %Q ; <i32> [#uses=1]
ret i32 %Z
}
diff --git a/llvm/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll b/llvm/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll
index c20fc54a19b66..4bc3980a30ed9 100644
--- a/llvm/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll
+++ b/llvm/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll
@@ -3,11 +3,11 @@
; CHECK: Function: foo
; CHECK: MayAlias: i32* %x, i32* %y
-define void @foo(i32* noalias %x) {
- %y = call i32* @unclear(i32* %x)
- store i32 0, i32* %x
- store i32 0, i32* %y
+define void @foo(ptr noalias %x) {
+ %y = call ptr @unclear(ptr %x)
+ store i32 0, ptr %x
+ store i32 0, ptr %y
ret void
}
-declare i32* @unclear(i32* %a)
+declare ptr @unclear(ptr %a)
diff --git a/llvm/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll b/llvm/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll
index 8d45b6aac9adb..05576a1b32047 100644
--- a/llvm/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll
+++ b/llvm/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll
@@ -7,16 +7,16 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; CHECK: 9 no alias responses
; CHECK: 6 may alias responses
-define void @foo(i32* noalias %p, i32* noalias %q, i32 %i, i32 %j) {
- %Ipointer = getelementptr i32, i32* %p, i32 %i
- %qi = getelementptr i32, i32* %q, i32 %i
- %Jpointer = getelementptr i32, i32* %p, i32 %j
- %qj = getelementptr i32, i32* %q, i32 %j
- store i32 0, i32* %p
- store i32 0, i32* %Ipointer
- store i32 0, i32* %Jpointer
- store i32 0, i32* %q
- store i32 0, i32* %qi
- store i32 0, i32* %qj
+define void @foo(ptr noalias %p, ptr noalias %q, i32 %i, i32 %j) {
+ %Ipointer = getelementptr i32, ptr %p, i32 %i
+ %qi = getelementptr i32, ptr %q, i32 %i
+ %Jpointer = getelementptr i32, ptr %p, i32 %j
+ %qj = getelementptr i32, ptr %q, i32 %j
+ store i32 0, ptr %p
+ store i32 0, ptr %Ipointer
+ store i32 0, ptr %Jpointer
+ store i32 0, ptr %q
+ store i32 0, ptr %qi
+ store i32 0, ptr %qj
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll b/llvm/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll
index 43eb419fe6ce2..733bc843e9626 100644
--- a/llvm/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll
+++ b/llvm/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll
@@ -3,13 +3,13 @@
declare i16 @llvm.cttz.i16(i16, i1)
-define i32 @test(i32* %P, i16* %Q) {
+define i32 @test(ptr %P, ptr %Q) {
; CHECK: ret i32 0
- %A = load i16, i16* %Q ; <i16> [#uses=1]
- %x = load i32, i32* %P ; <i32> [#uses=1]
+ %A = load i16, ptr %Q ; <i16> [#uses=1]
+ %x = load i32, ptr %P ; <i32> [#uses=1]
%B = call i16 @llvm.cttz.i16( i16 %A, i1 true ) ; <i16> [#uses=1]
- %y = load i32, i32* %P ; <i32> [#uses=1]
- store i16 %B, i16* %Q
+ %y = load i32, ptr %P ; <i32> [#uses=1]
+ store i16 %B, ptr %Q
%z = sub i32 %x, %y ; <i32> [#uses=1]
ret i32 %z
}
diff --git a/llvm/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll b/llvm/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll
index 5c47c3cce0303..37dee1fb32ee2 100644
--- a/llvm/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll
+++ b/llvm/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll
@@ -2,15 +2,15 @@
%struct.A = type { i32 }
%struct.B = type { %struct.A }
- at a = global %struct.B zeroinitializer ; <%struct.B*> [#uses=2]
+ at a = global %struct.B zeroinitializer ; <ptr> [#uses=2]
-define i32 @_Z3fooP1A(%struct.A* %b) {
+define i32 @_Z3fooP1A(ptr %b) {
; CHECK: %tmp7 = load
; CHECK: ret i32 %tmp7
entry:
- store i32 1, i32* getelementptr (%struct.B, %struct.B* @a, i32 0, i32 0, i32 0), align 8
- %tmp4 = getelementptr %struct.A, %struct.A* %b, i32 0, i32 0 ;<i32*> [#uses=1]
- store i32 0, i32* %tmp4, align 4
- %tmp7 = load i32, i32* getelementptr (%struct.B, %struct.B* @a, i32 0, i32 0, i32 0), align 8 ; <i32> [#uses=1]
+ store i32 1, ptr @a, align 8
+ %tmp4 = getelementptr %struct.A, ptr %b, i32 0, i32 0 ;<ptr> [#uses=1]
+ store i32 0, ptr %tmp4, align 4
+ %tmp7 = load i32, ptr @a, align 8 ; <i32> [#uses=1]
ret i32 %tmp7
}
diff --git a/llvm/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll b/llvm/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll
index 44f5269f92d5e..7ec8091794e7c 100644
--- a/llvm/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll
+++ b/llvm/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll
@@ -5,27 +5,25 @@ 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-unknown-linux-gnu"
%struct.device = type { [20 x i8] }
%struct.pci_device_id = type { i32, i32, i32, i32, i32, i32, i64 }
- %struct.usb_bus = type { %struct.device* }
+ %struct.usb_bus = type { ptr }
%struct.usb_hcd = type { %struct.usb_bus, i64, [0 x i64] }
@uhci_pci_ids = constant [1 x %struct.pci_device_id] zeroinitializer
- at __mod_pci_device_table = alias [1 x %struct.pci_device_id], [1 x %struct.pci_device_id]* @uhci_pci_ids
- ; <[1 x %struct.pci_device_id]*> [#uses=0]
+ at __mod_pci_device_table = alias [1 x %struct.pci_device_id], ptr @uhci_pci_ids
+ ; <ptr> [#uses=0]
-define i32 @uhci_suspend(%struct.usb_hcd* %hcd) {
+define i32 @uhci_suspend(ptr %hcd) {
entry:
- %tmp17 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 2, i64 1
- ; <i64*> [#uses=1]
- %tmp1718 = bitcast i64* %tmp17 to i32* ; <i32*> [#uses=1]
- %tmp19 = load i32, i32* %tmp1718, align 4 ; <i32> [#uses=0]
+ %tmp17 = getelementptr %struct.usb_hcd, ptr %hcd, i32 0, i32 2, i64 1
+ ; <ptr> [#uses=1]
+ %tmp19 = load i32, ptr %tmp17, align 4 ; <i32> [#uses=0]
br i1 false, label %cond_true34, label %done_okay
cond_true34: ; preds = %entry
- %tmp631 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 2, i64
-2305843009213693950 ; <i64*> [#uses=1]
- %tmp70 = bitcast i64* %tmp631 to %struct.device**
+ %tmp631 = getelementptr %struct.usb_hcd, ptr %hcd, i32 0, i32 2, i64
+2305843009213693950 ; <ptr> [#uses=1]
- %tmp71 = load %struct.device*, %struct.device** %tmp70, align 8
+ %tmp71 = load ptr, ptr %tmp631, align 8
ret i32 undef
diff --git a/llvm/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll b/llvm/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll
index bf0ce660ba28d..0bcd6e9cabe8d 100644
--- a/llvm/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll
+++ b/llvm/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll
@@ -5,25 +5,24 @@ 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-unknown-linux-gnu"
%struct.device = type { [20 x i8] }
%struct.pci_device_id = type { i32, i32, i32, i32, i32, i32, i64 }
- %struct.usb_bus = type { %struct.device* }
+ %struct.usb_bus = type { ptr }
%struct.usb_hcd = type { %struct.usb_bus, [0 x i64] }
@pci_ids = constant [1 x %struct.pci_device_id] zeroinitializer
- at __mod_pci_device_table = alias [1 x %struct.pci_device_id], [1 x %struct.pci_device_id]* @pci_ids ; <[1 x %struct.pci_device_id]*> [#uses=0]
+ at __mod_pci_device_table = alias [1 x %struct.pci_device_id], ptr @pci_ids ; <ptr> [#uses=0]
-define i32 @ehci_pci_setup(%struct.usb_hcd* %hcd) {
+define i32 @ehci_pci_setup(ptr %hcd) {
entry:
- %tmp14 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 0, i32 0 ; <%struct.device**> [#uses=1]
- %tmp15 = load %struct.device*, %struct.device** %tmp14, align 8 ; <%struct.device*> [#uses=0]
+ %tmp14 = getelementptr %struct.usb_hcd, ptr %hcd, i32 0, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp15 = load ptr, ptr %tmp14, align 8 ; <ptr> [#uses=0]
br i1 false, label %bb25, label %return
bb25: ; preds = %entry
br i1 false, label %cond_true, label %return
cond_true: ; preds = %bb25
- %tmp601 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 1, i64 2305843009213693951 ; <i64*> [#uses=1]
- %tmp67 = bitcast i64* %tmp601 to %struct.device** ; <%struct.device**> [#uses=1]
- %tmp68 = load %struct.device*, %struct.device** %tmp67, align 8 ; <%struct.device*> [#uses=0]
+ %tmp601 = getelementptr %struct.usb_hcd, ptr %hcd, i32 0, i32 1, i64 2305843009213693951 ; <ptr> [#uses=1]
+ %tmp68 = load ptr, ptr %tmp601, align 8 ; <ptr> [#uses=0]
ret i32 undef
return: ; preds = %bb25, %entry
diff --git a/llvm/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll b/llvm/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll
index 0a2bb09517a08..28e391f6a6e5e 100644
--- a/llvm/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll
+++ b/llvm/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll
@@ -5,11 +5,11 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
target triple = "i686-pc-linux-gnu"
%struct.S291 = type <{ %union.anon, i32 }>
%union.anon = type { }
- at a291 = external global [5 x %struct.S291] ; <[5 x %struct.S291]*> [#uses=2]
+ at a291 = external global [5 x %struct.S291] ; <ptr> [#uses=2]
define void @test291() nounwind {
entry:
- store i32 1138410269, i32* getelementptr ([5 x %struct.S291], [5 x %struct.S291]* @a291, i32 0, i32 2, i32 1)
- %tmp54 = load i32, i32* bitcast (%struct.S291* getelementptr ([5 x %struct.S291], [5 x %struct.S291]* @a291, i32 0, i32 2) to i32*), align 4 ; <i32> [#uses=0]
+ store i32 1138410269, ptr getelementptr ([5 x %struct.S291], ptr @a291, i32 0, i32 2, i32 1)
+ %tmp54 = load i32, ptr getelementptr ([5 x %struct.S291], ptr @a291, i32 0, i32 2), align 4 ; <i32> [#uses=0]
unreachable
}
diff --git a/llvm/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll b/llvm/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll
index 0b9cb35729280..5838bd46724eb 100644
--- a/llvm/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll
+++ b/llvm/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll
@@ -1,14 +1,14 @@
; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -disable-output 2>&1 | FileCheck %s
-declare noalias i32* @_Znwj(i32 %x) nounwind
+declare noalias ptr @_Znwj(i32 %x) nounwind
; CHECK: 1 no alias response
define i32 @foo() {
- %A = call i32* @_Znwj(i32 4)
- %B = call i32* @_Znwj(i32 4)
- store i32 1, i32* %A
- store i32 2, i32* %B
- %C = load i32, i32* %A
+ %A = call ptr @_Znwj(i32 4)
+ %B = call ptr @_Znwj(i32 4)
+ store i32 1, ptr %A
+ store i32 2, ptr %B
+ %C = load i32, ptr %A
ret i32 %C
}
diff --git a/llvm/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll b/llvm/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll
index fedd6f7c63a0f..37d47c9d68eb2 100644
--- a/llvm/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll
+++ b/llvm/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll
@@ -1,13 +1,12 @@
; RUN: opt -aa-pipeline=basic-aa -passes=gvn,instcombine -S < %s | FileCheck %s
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
-define i8 @foo(i8* %ptr) {
- %P = getelementptr i8, i8* %ptr, i32 0
- %Q = getelementptr i8, i8* %ptr, i32 1
+define i8 @foo(ptr %ptr) {
+ %Q = getelementptr i8, ptr %ptr, i32 1
; CHECK: getelementptr
- %X = load i8, i8* %P
- %Y = atomicrmw add i8* %Q, i8 1 monotonic
- %Z = load i8, i8* %P
+ %X = load i8, ptr %ptr
+ %Y = atomicrmw add ptr %Q, i8 1 monotonic
+ %Z = load i8, ptr %ptr
; CHECK-NOT: = load
%A = sub i8 %X, %Z
ret i8 %A
diff --git a/llvm/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll b/llvm/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll
index 65f310255cf07..ede8b0170145e 100644
--- a/llvm/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll
+++ b/llvm/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll
@@ -15,17 +15,16 @@ entry:
br i1 %tmp, label %bb, label %bb1
bb:
- %b = getelementptr i32, i32* %a, i32 0
br label %bb2
bb1:
br label %bb2
bb2:
- %P = phi i32* [ %b, %bb ], [ @Y, %bb1 ]
- %tmp1 = load i32, i32* @Z, align 4
- store i32 123, i32* %P, align 4
- %tmp2 = load i32, i32* @Z, align 4
+ %P = phi ptr [ %a, %bb ], [ @Y, %bb1 ]
+ %tmp1 = load i32, ptr @Z, align 4
+ store i32 123, ptr %P, align 4
+ %tmp2 = load i32, ptr @Z, align 4
br label %return
return:
diff --git a/llvm/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll b/llvm/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
index 7299da479e069..51f86b0b98115 100644
--- a/llvm/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
+++ b/llvm/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
@@ -5,13 +5,13 @@ target datalayout = "e-p:32:32:32"
; CHECK: 1 may alias responses
-define i32 @test(i32* %tab, i32 %indvar) nounwind {
+define i32 @test(ptr %tab, i32 %indvar) nounwind {
%tmp31 = mul i32 %indvar, -2
%tmp32 = add i32 %tmp31, 30
- %t.5 = getelementptr i32, i32* %tab, i32 %tmp32
- %loada = load i32, i32* %tab
- store i32 0, i32* %t.5
- %loadb = load i32, i32* %tab
+ %t.5 = getelementptr i32, ptr %tab, i32 %tmp32
+ %loada = load i32, ptr %tab
+ store i32 0, ptr %t.5
+ %loadb = load i32, ptr %tab
%rval = add i32 %loada, %loadb
ret i32 %rval
}
diff --git a/llvm/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll b/llvm/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll
index 323a6372afb01..a8a09a2c8a176 100644
--- a/llvm/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll
+++ b/llvm/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll
@@ -10,27 +10,25 @@ target datalayout = "e"
define i32 @main() {
%t = alloca %struct.foo, align 4
- %1 = getelementptr inbounds %struct.foo, %struct.foo* %t, i32 0, i32 0
- store i32 1, i32* %1, align 4
- %2 = getelementptr inbounds %struct.foo, %struct.foo* %t, i64 1
- %3 = bitcast %struct.foo* %2 to i8*
- %4 = getelementptr inbounds i8, i8* %3, i32 -1
- store i8 0, i8* %4
- %5 = getelementptr inbounds i8, i8* %4, i32 -1
- store i8 0, i8* %5
- %6 = getelementptr inbounds i8, i8* %5, i32 -1
- store i8 0, i8* %6
- %7 = getelementptr inbounds i8, i8* %6, i32 -1
- store i8 0, i8* %7
- %8 = getelementptr inbounds i8, i8* %7, i32 -1
- store i8 0, i8* %8
- %9 = getelementptr inbounds i8, i8* %8, i32 -1
- store i8 0, i8* %9
- %10 = getelementptr inbounds i8, i8* %9, i32 -1
- store i8 0, i8* %10
- %11 = getelementptr inbounds i8, i8* %10, i32 -1
- store i8 0, i8* %11
- %12 = load i32, i32* %1, align 4
- ret i32 %12
-; CHECK: ret i32 %12
+ store i32 1, ptr %t, align 4
+ %1 = getelementptr inbounds %struct.foo, ptr %t, i64 1
+ %2 = getelementptr inbounds i8, ptr %1, i32 -1
+ store i8 0, ptr %2
+ %3 = getelementptr inbounds i8, ptr %2, i32 -1
+ store i8 0, ptr %3
+ %4 = getelementptr inbounds i8, ptr %3, i32 -1
+ store i8 0, ptr %4
+ %5 = getelementptr inbounds i8, ptr %4, i32 -1
+ store i8 0, ptr %5
+ %6 = getelementptr inbounds i8, ptr %5, i32 -1
+ store i8 0, ptr %6
+ %7 = getelementptr inbounds i8, ptr %6, i32 -1
+ store i8 0, ptr %7
+ %8 = getelementptr inbounds i8, ptr %7, i32 -1
+ store i8 0, ptr %8
+ %9 = getelementptr inbounds i8, ptr %8, i32 -1
+ store i8 0, ptr %9
+ %10 = load i32, ptr %t, align 4
+ ret i32 %10
+; CHECK: ret i32 %10
}
diff --git a/llvm/test/Analysis/BasicAA/aligned-overread.ll b/llvm/test/Analysis/BasicAA/aligned-overread.ll
index 49f0790108c58..8beaac3a45107 100644
--- a/llvm/test/Analysis/BasicAA/aligned-overread.ll
+++ b/llvm/test/Analysis/BasicAA/aligned-overread.ll
@@ -9,11 +9,11 @@ target triple = "x86_64-apple-macosx10.8.0"
define i32 @main() nounwind uwtable ssp {
entry:
- %tmp = load i8, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }, { i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4
+ %tmp = load i8, ptr getelementptr inbounds ({ i8, i8, i8, i8, i8 }, ptr @a, i64 0, i32 4), align 4
%tmp1 = or i8 %tmp, -128
- store i8 %tmp1, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }, { i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4
- %tmp2 = load i64, i64* bitcast ({ i8, i8, i8, i8, i8 }* @a to i64*), align 8
- store i8 11, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }, { i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4
+ store i8 %tmp1, ptr getelementptr inbounds ({ i8, i8, i8, i8, i8 }, ptr @a, i64 0, i32 4), align 4
+ %tmp2 = load i64, ptr @a, align 8
+ store i8 11, ptr getelementptr inbounds ({ i8, i8, i8, i8, i8 }, ptr @a, i64 0, i32 4), align 4
%tmp3 = trunc i64 %tmp2 to i32
ret i32 %tmp3
diff --git a/llvm/test/Analysis/BasicAA/bug.23540.ll b/llvm/test/Analysis/BasicAA/bug.23540.ll
index 16d01185d9f6b..4487fa39a5813 100644
--- a/llvm/test/Analysis/BasicAA/bug.23540.ll
+++ b/llvm/test/Analysis/BasicAA/bug.23540.ll
@@ -10,10 +10,10 @@ define void @f() {
%idxprom = zext i32 undef to i64
%add4 = add i32 0, 1
%idxprom5 = zext i32 %add4 to i64
- %arrayidx6 = getelementptr inbounds i32, i32* @c, i64 %idxprom5
- %arrayidx = getelementptr inbounds i32, i32* @c, i64 %idxprom
- load i32, i32* %arrayidx
- load i32, i32* %arrayidx6
+ %arrayidx6 = getelementptr inbounds i32, ptr @c, i64 %idxprom5
+ %arrayidx = getelementptr inbounds i32, ptr @c, i64 %idxprom
+ load i32, ptr %arrayidx
+ load i32, ptr %arrayidx6
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/bug.23626.ll b/llvm/test/Analysis/BasicAA/bug.23626.ll
index f3ffda52dff2f..4b38285e15b13 100644
--- a/llvm/test/Analysis/BasicAA/bug.23626.ll
+++ b/llvm/test/Analysis/BasicAA/bug.23626.ll
@@ -9,29 +9,29 @@ target triple = "x86_64-apple-darwin13.4.0"
; CHECK: NoAlias: i32* %arrayidx14, i32* %out
; CHECK: MayAlias: i32* %arrayidx14, i32* %arrayidx8
; CHECK: MayAlias: i32* %arrayidx11, i32* %arrayidx14
-define void @compute1(i32 %num.0.lcssa, i32* %out) {
+define void @compute1(i32 %num.0.lcssa, ptr %out) {
%idxprom = zext i32 %num.0.lcssa to i64
- %arrayidx8 = getelementptr inbounds i32, i32* %out, i64 %idxprom
+ %arrayidx8 = getelementptr inbounds i32, ptr %out, i64 %idxprom
%add9 = or i32 %num.0.lcssa, 1
%idxprom10 = zext i32 %add9 to i64
- %arrayidx11 = getelementptr inbounds i32, i32* %out, i64 %idxprom10
+ %arrayidx11 = getelementptr inbounds i32, ptr %out, i64 %idxprom10
%add12 = or i32 %num.0.lcssa, 2
%idxprom13 = zext i32 %add12 to i64
- %arrayidx14 = getelementptr inbounds i32, i32* %out, i64 %idxprom13
- load i32, i32* %out
- load i32, i32* %arrayidx8
- load i32, i32* %arrayidx11
- load i32, i32* %arrayidx14
+ %arrayidx14 = getelementptr inbounds i32, ptr %out, i64 %idxprom13
+ load i32, ptr %out
+ load i32, ptr %arrayidx8
+ load i32, ptr %arrayidx11
+ load i32, ptr %arrayidx14
ret void
}
; CHECK-LABEL: compute2
; CHECK: MayAlias: i32* %arrayidx11, i32* %out.addr
-define void @compute2(i32 %num, i32* %out.addr) {
+define void @compute2(i32 %num, ptr %out.addr) {
%add9 = add i32 %num, 1
%idxprom10 = zext i32 %add9 to i64
- %arrayidx11 = getelementptr inbounds i32, i32* %out.addr, i64 %idxprom10
- load i32, i32* %out.addr
- load i32, i32* %arrayidx11
+ %arrayidx11 = getelementptr inbounds i32, ptr %out.addr, i64 %idxprom10
+ load i32, ptr %out.addr
+ load i32, ptr %arrayidx11
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/byval.ll b/llvm/test/Analysis/BasicAA/byval.ll
index 885bdd7afa54f..ee01fad446e37 100644
--- a/llvm/test/Analysis/BasicAA/byval.ll
+++ b/llvm/test/Analysis/BasicAA/byval.ll
@@ -2,15 +2,15 @@
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:128:128"
target triple = "i686-apple-darwin8"
%struct.x = type { i32, i32, i32, i32 }
- at g = weak global i32 0 ; <i32*> [#uses=1]
+ at g = weak global i32 0 ; <ptr> [#uses=1]
-define i32 @foo(%struct.x* byval(%struct.x) %a) nounwind {
+define i32 @foo(ptr byval(%struct.x) %a) nounwind {
; CHECK: ret i32 1
- %tmp1 = tail call i32 (...) @bar( %struct.x* %a ) nounwind ; <i32> [#uses=0]
- %tmp2 = getelementptr %struct.x, %struct.x* %a, i32 0, i32 0 ; <i32*> [#uses=2]
- store i32 1, i32* %tmp2, align 4
- store i32 2, i32* @g, align 4
- %tmp4 = load i32, i32* %tmp2, align 4 ; <i32> [#uses=1]
+ %tmp1 = tail call i32 (...) @bar( ptr %a ) nounwind ; <i32> [#uses=0]
+ %tmp2 = getelementptr %struct.x, ptr %a, i32 0, i32 0 ; <ptr> [#uses=2]
+ store i32 1, ptr %tmp2, align 4
+ store i32 2, ptr @g, align 4
+ %tmp4 = load i32, ptr %tmp2, align 4 ; <i32> [#uses=1]
ret i32 %tmp4
}
diff --git a/llvm/test/Analysis/BasicAA/cas.ll b/llvm/test/Analysis/BasicAA/cas.ll
index b45eb56c1ce6d..c5d634e8a5583 100644
--- a/llvm/test/Analysis/BasicAA/cas.ll
+++ b/llvm/test/Analysis/BasicAA/cas.ll
@@ -6,9 +6,9 @@
; CHECK: ret i32 0
define i32 @main() {
- %a = load i32, i32* @flag0
- %b = atomicrmw xchg i32* @turn, i32 1 monotonic
- %c = load i32, i32* @flag0
+ %a = load i32, ptr @flag0
+ %b = atomicrmw xchg ptr @turn, i32 1 monotonic
+ %c = load i32, ptr @flag0
%d = sub i32 %a, %c
ret i32 %d
}
diff --git a/llvm/test/Analysis/BasicAA/constant-over-index.ll b/llvm/test/Analysis/BasicAA/constant-over-index.ll
index 0665580828f5b..c2759221f66ca 100644
--- a/llvm/test/Analysis/BasicAA/constant-over-index.ll
+++ b/llvm/test/Analysis/BasicAA/constant-over-index.ll
@@ -9,18 +9,18 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; so MayAlias is needed. In practice, basicaa returns PartialAlias
; for GEPs to ignore TBAA.
-define void @foo([3 x [3 x double]]* noalias %p) {
+define void @foo(ptr noalias %p) {
entry:
- %p3 = getelementptr [3 x [3 x double]], [3 x [3 x double]]* %p, i64 0, i64 0, i64 3
+ %p3 = getelementptr [3 x [3 x double]], ptr %p, i64 0, i64 0, i64 3
br label %loop
loop:
%i = phi i64 [ 0, %entry ], [ %i.next, %loop ]
- %p.0.i.0 = getelementptr [3 x [3 x double]], [3 x [3 x double]]* %p, i64 0, i64 %i, i64 0
+ %p.0.i.0 = getelementptr [3 x [3 x double]], ptr %p, i64 0, i64 %i, i64 0
- store volatile double 0.0, double* %p3
- store volatile double 0.1, double* %p.0.i.0
+ store volatile double 0.0, ptr %p3
+ store volatile double 0.1, ptr %p.0.i.0
%i.next = add i64 %i, 1
%cmp = icmp slt i64 %i.next, 3
diff --git a/llvm/test/Analysis/BasicAA/dereferenceable.ll b/llvm/test/Analysis/BasicAA/dereferenceable.ll
index bab8df599b703..98bd5e3d5aa6a 100644
--- a/llvm/test/Analysis/BasicAA/dereferenceable.ll
+++ b/llvm/test/Analysis/BasicAA/dereferenceable.ll
@@ -5,60 +5,60 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@G = global i32 0, align 4
-define i64 @global_and_deref_arg_1(i64* dereferenceable(8) %arg) nofree nosync {
+define i64 @global_and_deref_arg_1(ptr dereferenceable(8) %arg) nofree nosync {
; CHECK: Function: global_and_deref_arg_1: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i64* %arg, i32* @G
bb:
- store i64 1, i64* %arg, align 8
- store i32 0, i32* @G, align 4
- %tmp = load i64, i64* %arg, align 8
+ store i64 1, ptr %arg, align 8
+ store i32 0, ptr @G, align 4
+ %tmp = load i64, ptr %arg, align 8
ret i64 %tmp
}
-define i32 @global_and_deref_arg_2(i32* dereferenceable(8) %arg) nofree nosync {
+define i32 @global_and_deref_arg_2(ptr dereferenceable(8) %arg) nofree nosync {
; CHECK: Function: global_and_deref_arg_2: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i32* %arg, i32* @G
bb:
- store i32 1, i32* %arg, align 8
- store i32 0, i32* @G, align 4
- %tmp = load i32, i32* %arg, align 8
+ store i32 1, ptr %arg, align 8
+ store i32 0, ptr @G, align 4
+ %tmp = load i32, ptr %arg, align 8
ret i32 %tmp
}
-define i32 @byval_and_deref_arg_1(i32* byval(i32) %obj, i64* dereferenceable(8) %arg) nofree nosync {
+define i32 @byval_and_deref_arg_1(ptr byval(i32) %obj, ptr dereferenceable(8) %arg) nofree nosync {
; CHECK: Function: byval_and_deref_arg_1: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i64* %arg, i32* %obj
bb:
- store i32 1, i32* %obj, align 4
- store i64 0, i64* %arg, align 8
- %tmp = load i32, i32* %obj, align 4
+ store i32 1, ptr %obj, align 4
+ store i64 0, ptr %arg, align 8
+ %tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
-define i32 @byval_and_deref_arg_2(i32* byval(i32) %obj, i32* dereferenceable(8) %arg) nofree nosync {
+define i32 @byval_and_deref_arg_2(ptr byval(i32) %obj, ptr dereferenceable(8) %arg) nofree nosync {
; CHECK: Function: byval_and_deref_arg_2: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i32* %arg, i32* %obj
bb:
- store i32 1, i32* %obj, align 4
- store i32 0, i32* %arg, align 8
- %tmp = load i32, i32* %obj, align 4
+ store i32 1, ptr %obj, align 4
+ store i32 0, ptr %arg, align 8
+ %tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
-declare dereferenceable(8) i32* @get_i32_deref8()
-declare dereferenceable(8) i64* @get_i64_deref8()
-declare void @unknown(i32*)
+declare dereferenceable(8) ptr @get_i32_deref8()
+declare dereferenceable(8) ptr @get_i64_deref8()
+declare void @unknown(ptr)
define i32 @local_and_deref_ret_1() {
; CHECK: Function: local_and_deref_ret_1: 2 pointers, 2 call sites
; CHECK-NEXT: NoAlias: i32* %obj, i64* %ret
bb:
%obj = alloca i32
- call void @unknown(i32* %obj)
- %ret = call dereferenceable(8) i64* @get_i64_deref8()
- store i32 1, i32* %obj, align 4
- store i64 0, i64* %ret, align 8
- %tmp = load i32, i32* %obj, align 4
+ call void @unknown(ptr %obj)
+ %ret = call dereferenceable(8) ptr @get_i64_deref8()
+ store i32 1, ptr %obj, align 4
+ store i64 0, ptr %ret, align 8
+ %tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
@@ -67,71 +67,71 @@ define i32 @local_and_deref_ret_2() {
; CHECK-NEXT: NoAlias: i32* %obj, i32* %ret
bb:
%obj = alloca i32
- call void @unknown(i32* %obj)
- %ret = call dereferenceable(8) i32* @get_i32_deref8()
- store i32 1, i32* %obj, align 4
- store i32 0, i32* %ret, align 8
- %tmp = load i32, i32* %obj, align 4
+ call void @unknown(ptr %obj)
+ %ret = call dereferenceable(8) ptr @get_i32_deref8()
+ store i32 1, ptr %obj, align 4
+ store i32 0, ptr %ret, align 8
+ %tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
; Baseline tests, same as above but with 2 instead of 8 dereferenceable bytes.
-define i64 @global_and_deref_arg_non_deref_1(i64* dereferenceable(2) %arg) nofree nosync {
+define i64 @global_and_deref_arg_non_deref_1(ptr dereferenceable(2) %arg) nofree nosync {
; CHECK: Function: global_and_deref_arg_non_deref_1: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i64* %arg, i32* @G
bb:
- store i64 1, i64* %arg, align 8
- store i32 0, i32* @G, align 4
- %tmp = load i64, i64* %arg, align 8
+ store i64 1, ptr %arg, align 8
+ store i32 0, ptr @G, align 4
+ %tmp = load i64, ptr %arg, align 8
ret i64 %tmp
}
-define i32 @global_and_deref_arg_non_deref_2(i32* dereferenceable(2) %arg) nofree nosync {
+define i32 @global_and_deref_arg_non_deref_2(ptr dereferenceable(2) %arg) nofree nosync {
; CHECK: Function: global_and_deref_arg_non_deref_2: 2 pointers, 0 call sites
; Different result than above (see @global_and_deref_arg_2).
; CHECK-NEXT: MayAlias: i32* %arg, i32* @G
bb:
- store i32 1, i32* %arg, align 8
- store i32 0, i32* @G, align 4
- %tmp = load i32, i32* %arg, align 8
+ store i32 1, ptr %arg, align 8
+ store i32 0, ptr @G, align 4
+ %tmp = load i32, ptr %arg, align 8
ret i32 %tmp
}
-define i32 @byval_and_deref_arg_non_deref_1(i32* byval(i32) %obj, i64* dereferenceable(2) %arg) nofree nosync {
+define i32 @byval_and_deref_arg_non_deref_1(ptr byval(i32) %obj, ptr dereferenceable(2) %arg) nofree nosync {
; CHECK: Function: byval_and_deref_arg_non_deref_1: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i64* %arg, i32* %obj
bb:
- store i32 1, i32* %obj, align 4
- store i64 0, i64* %arg, align 8
- %tmp = load i32, i32* %obj, align 4
+ store i32 1, ptr %obj, align 4
+ store i64 0, ptr %arg, align 8
+ %tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
-define i32 @byval_and_deref_arg_non_deref_2(i32* byval(i32) %obj, i32* dereferenceable(2) %arg) nofree nosync {
+define i32 @byval_and_deref_arg_non_deref_2(ptr byval(i32) %obj, ptr dereferenceable(2) %arg) nofree nosync {
; CHECK: Function: byval_and_deref_arg_non_deref_2: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i32* %arg, i32* %obj
bb:
- store i32 1, i32* %obj, align 4
- store i32 0, i32* %arg, align 8
- %tmp = load i32, i32* %obj, align 4
+ store i32 1, ptr %obj, align 4
+ store i32 0, ptr %arg, align 8
+ %tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
-declare dereferenceable(2) i32* @get_i32_deref2()
-declare dereferenceable(2) i64* @get_i64_deref2()
+declare dereferenceable(2) ptr @get_i32_deref2()
+declare dereferenceable(2) ptr @get_i64_deref2()
define i32 @local_and_deref_ret_non_deref_1() {
; CHECK: Function: local_and_deref_ret_non_deref_1: 2 pointers, 2 call sites
; CHECK-NEXT: NoAlias: i32* %obj, i64* %ret
bb:
%obj = alloca i32
- call void @unknown(i32* %obj)
- %ret = call dereferenceable(2) i64* @get_i64_deref2()
- store i32 1, i32* %obj, align 4
- store i64 0, i64* %ret, align 8
- %tmp = load i32, i32* %obj, align 4
+ call void @unknown(ptr %obj)
+ %ret = call dereferenceable(2) ptr @get_i64_deref2()
+ store i32 1, ptr %obj, align 4
+ store i64 0, ptr %ret, align 8
+ %tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
@@ -141,10 +141,10 @@ define i32 @local_and_deref_ret_non_deref_2() {
; CHECK-NEXT: MayAlias: i32* %obj, i32* %ret
bb:
%obj = alloca i32
- call void @unknown(i32* %obj)
- %ret = call dereferenceable(2) i32* @get_i32_deref2()
- store i32 1, i32* %obj, align 4
- store i32 0, i32* %ret, align 8
- %tmp = load i32, i32* %obj, align 4
+ call void @unknown(ptr %obj)
+ %ret = call dereferenceable(2) ptr @get_i32_deref2()
+ store i32 1, ptr %obj, align 4
+ store i32 0, ptr %ret, align 8
+ %tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
diff --git a/llvm/test/Analysis/BasicAA/empty.ll b/llvm/test/Analysis/BasicAA/empty.ll
index c781f78c3c5fa..05a6ac3c0cdab 100644
--- a/llvm/test/Analysis/BasicAA/empty.ll
+++ b/llvm/test/Analysis/BasicAA/empty.ll
@@ -5,8 +5,8 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
; CHECK: Function: foo:
; CHECK-NEXT: NoAlias: {}* %p, {}* %q
-define void @foo({}* %p, {}* %q) {
- store {} {}, {}* %p
- store {} {}, {}* %q
+define void @foo(ptr %p, ptr %q) {
+ store {} {}, ptr %p
+ store {} {}, ptr %q
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/fallback-mayalias.ll b/llvm/test/Analysis/BasicAA/fallback-mayalias.ll
index 63d784d433c6b..861351871f818 100644
--- a/llvm/test/Analysis/BasicAA/fallback-mayalias.ll
+++ b/llvm/test/Analysis/BasicAA/fallback-mayalias.ll
@@ -5,16 +5,16 @@
; CHECK: MayAlias: float* %arrayidxA, float* %arrayidxB
-define void @fallback_mayalias(float* noalias nocapture %C, i64 %i, i64 %j) local_unnamed_addr {
+define void @fallback_mayalias(ptr noalias nocapture %C, i64 %i, i64 %j) local_unnamed_addr {
entry:
%cmp = icmp ne i64 %i, %j
call void @llvm.assume(i1 %cmp)
- %arrayidxA = getelementptr inbounds float, float* %C, i64 %i
- store float undef, float* %arrayidxA, align 4
+ %arrayidxA = getelementptr inbounds float, ptr %C, i64 %i
+ store float undef, ptr %arrayidxA, align 4
- %arrayidxB = getelementptr inbounds float, float* %C, i64 %j
- store float undef, float* %arrayidxB, align 4
+ %arrayidxB = getelementptr inbounds float, ptr %C, i64 %j
+ store float undef, ptr %arrayidxB, align 4
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/full-store-partial-alias.ll b/llvm/test/Analysis/BasicAA/full-store-partial-alias.ll
index 5f69628798c0c..7a982010bbb3e 100644
--- a/llvm/test/Analysis/BasicAA/full-store-partial-alias.ll
+++ b/llvm/test/Analysis/BasicAA/full-store-partial-alias.ll
@@ -18,13 +18,11 @@ define i32 @signbit(double %x) nounwind {
; CHECK: ret i32 0
entry:
%u = alloca %union.anon, align 8
- %tmp9 = getelementptr inbounds %union.anon, %union.anon* %u, i64 0, i32 0
- store double %x, double* %tmp9, align 8, !tbaa !0
- %tmp2 = load i32, i32* bitcast (i64* @endianness_test to i32*), align 8, !tbaa !3
+ store double %x, ptr %u, align 8, !tbaa !0
+ %tmp2 = load i32, ptr @endianness_test, align 8, !tbaa !3
%idxprom = sext i32 %tmp2 to i64
- %tmp4 = bitcast %union.anon* %u to [2 x i32]*
- %arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %tmp4, i64 0, i64 %idxprom
- %tmp5 = load i32, i32* %arrayidx, align 4, !tbaa !3
+ %arrayidx = getelementptr inbounds [2 x i32], ptr %u, i64 0, i64 %idxprom
+ %tmp5 = load i32, ptr %arrayidx, align 4, !tbaa !3
%tmp5.lobit = lshr i32 %tmp5, 31
ret i32 %tmp5.lobit
}
diff --git a/llvm/test/Analysis/BasicAA/gep-and-alias-64.ll b/llvm/test/Analysis/BasicAA/gep-and-alias-64.ll
index 284e8ebdd77e5..92609586e49f8 100644
--- a/llvm/test/Analysis/BasicAA/gep-and-alias-64.ll
+++ b/llvm/test/Analysis/BasicAA/gep-and-alias-64.ll
@@ -6,13 +6,12 @@ target triple = "x86_64-apple-macosx10.6.0"
; The load and store address in the loop body could alias so the load
; can't be hoisted above the store and out of the loop.
-declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i32, i1)
+declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i32, i1)
define i64 @foo(i64 %x, i64 %z, i64 %n) {
entry:
%pool = alloca [59 x i64], align 4
- %tmp = bitcast [59 x i64]* %pool to i8*
- call void @llvm.memset.p0i8.i64(i8* nonnull %tmp, i8 0, i64 236, i32 4, i1 false)
+ call void @llvm.memset.p0.i64(ptr nonnull %pool, i8 0, i64 236, i32 4, i1 false)
%cmp3 = icmp eq i64 %n, 0
br i1 %cmp3, label %for.end, label %for.body.lr.ph
@@ -20,14 +19,14 @@ for.body.lr.ph: ; preds = %entry
%add = add i64 %z, %x
%and = and i64 %add, 9223372036854775807
%sub = add nsw i64 %and, -9223372036844814062
- %arrayidx = getelementptr inbounds [59 x i64], [59 x i64]* %pool, i64 0, i64 %sub
- %arrayidx1 = getelementptr inbounds [59 x i64], [59 x i64]* %pool, i64 0, i64 42
+ %arrayidx = getelementptr inbounds [59 x i64], ptr %pool, i64 0, i64 %sub
+ %arrayidx1 = getelementptr inbounds [59 x i64], ptr %pool, i64 0, i64 42
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%i.04 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
- store i64 %i.04, i64* %arrayidx, align 4
- %tmp1 = load i64, i64* %arrayidx1, align 4
+ store i64 %i.04, ptr %arrayidx, align 4
+ %tmp1 = load i64, ptr %arrayidx1, align 4
%inc = add nuw i64 %i.04, 1
%exitcond = icmp ne i64 %inc, %n
br i1 %exitcond, label %for.body, label %for.end.loopexit
diff --git a/llvm/test/Analysis/BasicAA/gep-and-alias.ll b/llvm/test/Analysis/BasicAA/gep-and-alias.ll
index a3cad19d6c141..54c393a78ccf9 100644
--- a/llvm/test/Analysis/BasicAA/gep-and-alias.ll
+++ b/llvm/test/Analysis/BasicAA/gep-and-alias.ll
@@ -6,13 +6,12 @@ target triple = "i386-apple-macosx10.6.0"
; The load and store address in the loop body could alias so the load
; can't be hoisted above the store and out of the loop.
-declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1)
+declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1)
define i32 @foo(i32 %x, i32 %z, i32 %n) {
entry:
%pool = alloca [59 x i32], align 4
- %tmp = bitcast [59 x i32]* %pool to i8*
- call void @llvm.memset.p0i8.i32(i8* align 4 nonnull %tmp, i8 0, i32 236, i1 false)
+ call void @llvm.memset.p0.i32(ptr align 4 nonnull %pool, i8 0, i32 236, i1 false)
%cmp3 = icmp eq i32 %n, 0
br i1 %cmp3, label %for.end, label %for.body.lr.ph
@@ -20,14 +19,14 @@ for.body.lr.ph: ; preds = %entry
%add = add i32 %z, %x
%and = and i32 %add, 2147483647
%sub = add nsw i32 %and, -2137521902
- %arrayidx = getelementptr inbounds [59 x i32], [59 x i32]* %pool, i32 0, i32 %sub
- %arrayidx1 = getelementptr inbounds [59 x i32], [59 x i32]* %pool, i32 0, i32 42
+ %arrayidx = getelementptr inbounds [59 x i32], ptr %pool, i32 0, i32 %sub
+ %arrayidx1 = getelementptr inbounds [59 x i32], ptr %pool, i32 0, i32 42
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%i.04 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
- store i32 %i.04, i32* %arrayidx, align 4
- %tmp1 = load i32, i32* %arrayidx1, align 4
+ store i32 %i.04, ptr %arrayidx, align 4
+ %tmp1 = load i32, ptr %arrayidx1, align 4
%inc = add nuw i32 %i.04, 1
%exitcond = icmp ne i32 %inc, %n
br i1 %exitcond, label %for.body, label %for.end.loopexit
diff --git a/llvm/test/Analysis/BasicAA/gep-decomposition-limit.ll b/llvm/test/Analysis/BasicAA/gep-decomposition-limit.ll
index 76362d3c69a43..23a96ebca8485 100644
--- a/llvm/test/Analysis/BasicAA/gep-decomposition-limit.ll
+++ b/llvm/test/Analysis/BasicAA/gep-decomposition-limit.ll
@@ -14,27 +14,27 @@
; CHECK-DAG: MayAlias: i8* %gep.inc5, i8* %gep.inc7
; CHECK-DAG: NoAlias: i8* %gep.inc6, i8* %gep.inc7
-define void @test(i8* %base) {
- %gep.add5 = getelementptr i8, i8* %base, i64 5
- %gep.add6 = getelementptr i8, i8* %base, i64 6
- %gep.add7 = getelementptr i8, i8* %base, i64 7
+define void @test(ptr %base) {
+ %gep.add5 = getelementptr i8, ptr %base, i64 5
+ %gep.add6 = getelementptr i8, ptr %base, i64 6
+ %gep.add7 = getelementptr i8, ptr %base, i64 7
- %gep.inc1 = getelementptr i8, i8* %base, i64 1
- %gep.inc2 = getelementptr i8, i8* %gep.inc1, i64 1
- %gep.inc3 = getelementptr i8, i8* %gep.inc2, i64 1
- %gep.inc4 = getelementptr i8, i8* %gep.inc3, i64 1
- %gep.inc5 = getelementptr i8, i8* %gep.inc4, i64 1
- %gep.inc6 = getelementptr i8, i8* %gep.inc5, i64 1
- %gep.inc7 = getelementptr i8, i8* %gep.inc6, i64 1
+ %gep.inc1 = getelementptr i8, ptr %base, i64 1
+ %gep.inc2 = getelementptr i8, ptr %gep.inc1, i64 1
+ %gep.inc3 = getelementptr i8, ptr %gep.inc2, i64 1
+ %gep.inc4 = getelementptr i8, ptr %gep.inc3, i64 1
+ %gep.inc5 = getelementptr i8, ptr %gep.inc4, i64 1
+ %gep.inc6 = getelementptr i8, ptr %gep.inc5, i64 1
+ %gep.inc7 = getelementptr i8, ptr %gep.inc6, i64 1
- load i8, i8* %gep.add5
- load i8, i8* %gep.add6
- load i8, i8* %gep.add7
- load i8, i8* %gep.inc3
- load i8, i8* %gep.inc4
- load i8, i8* %gep.inc5
- load i8, i8* %gep.inc6
- load i8, i8* %gep.inc7
+ load i8, ptr %gep.add5
+ load i8, ptr %gep.add6
+ load i8, ptr %gep.add7
+ load i8, ptr %gep.inc3
+ load i8, ptr %gep.inc4
+ load i8, ptr %gep.inc5
+ load i8, ptr %gep.inc6
+ load i8, ptr %gep.inc7
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/global-size.ll b/llvm/test/Analysis/BasicAA/global-size.ll
index 237b2be6b4d89..765b59c479c62 100644
--- a/llvm/test/Analysis/BasicAA/global-size.ll
+++ b/llvm/test/Analysis/BasicAA/global-size.ll
@@ -7,10 +7,10 @@ target datalayout = "E-p:64:64:64-p1:16:16:16-a0:0:8-f32:32:32-f64:64:64-i1:8:8-
@B = global i16 8
; CHECK-LABEL: @test1(
-define i16 @test1(i32* %P) {
- %X = load i16, i16* @B
- store i32 7, i32* %P
- %Y = load i16, i16* @B
+define i16 @test1(ptr %P) {
+ %X = load i16, ptr @B
+ store i32 7, ptr %P
+ %Y = load i16, ptr @B
%Z = sub i16 %Y, %X
ret i16 %Z
; CHECK: ret i16 0
@@ -18,12 +18,12 @@ define i16 @test1(i32* %P) {
@B_as1 = addrspace(1) global i16 8
-define i16 @test1_as1(i32 addrspace(1)* %P) {
+define i16 @test1_as1(ptr addrspace(1) %P) {
; CHECK-LABEL: @test1_as1(
; CHECK: ret i16 0
- %X = load i16, i16 addrspace(1)* @B_as1
- store i32 7, i32 addrspace(1)* %P
- %Y = load i16, i16 addrspace(1)* @B_as1
+ %X = load i16, ptr addrspace(1) @B_as1
+ store i32 7, ptr addrspace(1) %P
+ %Y = load i16, ptr addrspace(1) @B_as1
%Z = sub i16 %Y, %X
ret i16 %Z
}
@@ -35,14 +35,14 @@ define i16 @test1_as1(i32 addrspace(1)* %P) {
; CHECK-LABEL: @test2(
define i8 @test2(i32 %tmp79, i32 %w.2, i32 %indvar89) nounwind {
%tmp92 = add i32 %tmp79, %indvar89
- %arrayidx412 = getelementptr [0 x i8], [0 x i8]* @window, i32 0, i32 %tmp92
+ %arrayidx412 = getelementptr [0 x i8], ptr @window, i32 0, i32 %tmp92
%tmp93 = add i32 %w.2, %indvar89
- %arrayidx416 = getelementptr [0 x i8], [0 x i8]* @window, i32 0, i32 %tmp93
+ %arrayidx416 = getelementptr [0 x i8], ptr @window, i32 0, i32 %tmp93
- %A = load i8, i8* %arrayidx412, align 1
- store i8 4, i8* %arrayidx416, align 1
+ %A = load i8, ptr %arrayidx412, align 1
+ store i8 4, ptr %arrayidx416, align 1
- %B = load i8, i8* %arrayidx412, align 1
+ %B = load i8, ptr %arrayidx412, align 1
%C = sub i8 %A, %B
ret i8 %C
diff --git a/llvm/test/Analysis/BasicAA/invalidation.ll b/llvm/test/Analysis/BasicAA/invalidation.ll
index facc0305b4bd4..79f4d44b44bc9 100644
--- a/llvm/test/Analysis/BasicAA/invalidation.ll
+++ b/llvm/test/Analysis/BasicAA/invalidation.ll
@@ -30,16 +30,15 @@
; loopinfo that basic-aa cache. But nor does any other test in LLVM. It would
; be good to enhance this to actually use these other analyses to make this
; a more thorough test.
-define void @foo(i1 %x, i8* %p1, i8* %p2) {
+define void @foo(i1 %x, ptr %p1, ptr %p2) {
entry:
%p3 = alloca i8
- store i8 42, i8* %p1
- %gep2 = getelementptr i8, i8* %p2, i32 0
+ store i8 42, ptr %p1
br i1 %x, label %loop, label %exit
loop:
- store i8 13, i8* %p3
- %tmp1 = load i8, i8* %gep2
+ store i8 13, ptr %p3
+ %tmp1 = load i8, ptr %p2
br label %loop
exit:
diff --git a/llvm/test/Analysis/BasicAA/no-escape-call.ll b/llvm/test/Analysis/BasicAA/no-escape-call.ll
index 8049c811834cb..734b19175f990 100644
--- a/llvm/test/Analysis/BasicAA/no-escape-call.ll
+++ b/llvm/test/Analysis/BasicAA/no-escape-call.ll
@@ -6,19 +6,19 @@ target triple = "i386-apple-darwin8"
define i1 @foo(i32 %i) nounwind {
; CHECK: ret i1 true
entry:
- %arr = alloca [10 x i8*] ; <[10 x i8*]*> [#uses=1]
- %tmp2 = call i8* @getPtr( ) nounwind ; <i8*> [#uses=2]
- %tmp4 = getelementptr [10 x i8*], [10 x i8*]* %arr, i32 0, i32 %i ; <i8**> [#uses=2]
- store i8* %tmp2, i8** %tmp4, align 4
- %tmp10 = getelementptr i8, i8* %tmp2, i32 10 ; <i8*> [#uses=1]
- store i8 42, i8* %tmp10, align 1
- %tmp14 = load i8*, i8** %tmp4, align 4 ; <i8*> [#uses=1]
- %tmp16 = getelementptr i8, i8* %tmp14, i32 10 ; <i8*> [#uses=1]
- %tmp17 = load i8, i8* %tmp16, align 1 ; <i8> [#uses=1]
+ %arr = alloca [10 x ptr] ; <ptr> [#uses=1]
+ %tmp2 = call ptr @getPtr( ) nounwind ; <ptr> [#uses=2]
+ %tmp4 = getelementptr [10 x ptr], ptr %arr, i32 0, i32 %i ; <ptr> [#uses=2]
+ store ptr %tmp2, ptr %tmp4, align 4
+ %tmp10 = getelementptr i8, ptr %tmp2, i32 10 ; <ptr> [#uses=1]
+ store i8 42, ptr %tmp10, align 1
+ %tmp14 = load ptr, ptr %tmp4, align 4 ; <ptr> [#uses=1]
+ %tmp16 = getelementptr i8, ptr %tmp14, i32 10 ; <ptr> [#uses=1]
+ %tmp17 = load i8, ptr %tmp16, align 1 ; <i8> [#uses=1]
%tmp19 = icmp eq i8 %tmp17, 42 ; <i1> [#uses=1]
ret i1 %tmp19
}
-declare i8* @getPtr()
+declare ptr @getPtr()
declare void @abort() noreturn nounwind
diff --git a/llvm/test/Analysis/BasicAA/noalias-inttoptr.ll b/llvm/test/Analysis/BasicAA/noalias-inttoptr.ll
index ecfd7e8f42ded..24bbcc55b3202 100644
--- a/llvm/test/Analysis/BasicAA/noalias-inttoptr.ll
+++ b/llvm/test/Analysis/BasicAA/noalias-inttoptr.ll
@@ -1,15 +1,15 @@
; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
target datalayout = "p:64:64"
-declare void @escape(i8* %ptr)
+declare void @escape(ptr %ptr)
; Verify that unescaped noalias parameter does not alias inttoptr
-define void @test1(i8* noalias %P, i64 %Q_as_int) {
+define void @test1(ptr noalias %P, i64 %Q_as_int) {
; CHECK-LABEL: Function: test1:
; CHECK: NoAlias: i8* %P, i8* %Q
- %Q = inttoptr i64 %Q_as_int to i8*
- store i8 0, i8* %P
- store i8 1, i8* %Q
+ %Q = inttoptr i64 %Q_as_int to ptr
+ store i8 0, ptr %P
+ store i8 1, ptr %Q
ret void
}
@@ -18,20 +18,20 @@ define void @test2(i64 %Q_as_int) {
; CHECK-LABEL: Function: test2:
; CHECK: NoAlias: i8* %P, i8* %Q
%P = alloca i8
- %Q = inttoptr i64 %Q_as_int to i8*
- store i8 0, i8* %P
- store i8 1, i8* %Q
+ %Q = inttoptr i64 %Q_as_int to ptr
+ store i8 0, ptr %P
+ store i8 1, ptr %Q
ret void
}
; Verify that escaped noalias parameter may alias inttoptr
-define void @test3(i8* noalias %P, i64 %Q_as_int) {
+define void @test3(ptr noalias %P, i64 %Q_as_int) {
; CHECK-LABEL: Function: test3:
; CHECK: MayAlias: i8* %P, i8* %Q
- call void @escape(i8* %P)
- %Q = inttoptr i64 %Q_as_int to i8*
- store i8 0, i8* %P
- store i8 1, i8* %Q
+ call void @escape(ptr %P)
+ %Q = inttoptr i64 %Q_as_int to ptr
+ store i8 0, ptr %P
+ store i8 1, ptr %Q
ret void
}
@@ -40,10 +40,10 @@ define void @test4(i64 %Q_as_int) {
; CHECK-LABEL: Function: test4:
; CHECK: MayAlias: i8* %P, i8* %Q
%P = alloca i8
- call void @escape(i8* %P)
- %Q = inttoptr i64 %Q_as_int to i8*
- store i8 0, i8* %P
- store i8 1, i8* %Q
+ call void @escape(ptr %P)
+ %Q = inttoptr i64 %Q_as_int to ptr
+ store i8 0, ptr %P
+ store i8 1, ptr %Q
ret void
}
@@ -53,8 +53,8 @@ define void @test4(i64 %Q_as_int) {
define void @test5(i64 %Q_as_int) {
; CHECK-LABEL: Function: test5:
; CHECK: MayAlias: i8* %Q, i8* @G
- %Q = inttoptr i64 %Q_as_int to i8*
- store i8 0, i8* @G
- store i8 1, i8* %Q
+ %Q = inttoptr i64 %Q_as_int to ptr
+ store i8 0, ptr @G
+ store i8 1, ptr %Q
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/noalias-param.ll b/llvm/test/Analysis/BasicAA/noalias-param.ll
index acffc14d2d66d..060364d677b94 100644
--- a/llvm/test/Analysis/BasicAA/noalias-param.ll
+++ b/llvm/test/Analysis/BasicAA/noalias-param.ll
@@ -1,34 +1,34 @@
; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s
-declare i32* @captures(i32* %cap) nounwind readonly
+declare ptr @captures(ptr %cap) nounwind readonly
; CHECK-LABEL: no
; CHECK: NoAlias: i32* %a, i32* %b
-define void @no(i32* noalias %a, i32* %b) nounwind {
+define void @no(ptr noalias %a, ptr %b) nounwind {
entry:
- store i32 1, i32* %a
- %cap = call i32* @captures(i32* %a) nounwind readonly
- %l = load i32, i32* %b
+ store i32 1, ptr %a
+ %cap = call ptr @captures(ptr %a) nounwind readonly
+ %l = load i32, ptr %b
ret void
}
; CHECK-LABEL: yes
; CHECK: MayAlias: i32* %c, i32* %d
-define void @yes(i32* %c, i32* %d) nounwind {
+define void @yes(ptr %c, ptr %d) nounwind {
entry:
- store i32 1, i32* %c
- %cap = call i32* @captures(i32* %c) nounwind readonly
- %l = load i32, i32* %d
+ store i32 1, ptr %c
+ %cap = call ptr @captures(ptr %c) nounwind readonly
+ %l = load i32, ptr %d
ret void
}
; Result should be the same for byval instead of noalias.
; CHECK-LABEL: byval
; CHECK: NoAlias: i32* %a, i32* %b
-define void @byval(i32* byval(i32) %a, i32* %b) nounwind {
+define void @byval(ptr byval(i32) %a, ptr %b) nounwind {
entry:
- store i32 1, i32* %a
- %cap = call i32* @captures(i32* %a) nounwind readonly
- %l = load i32, i32* %b
+ store i32 1, ptr %a
+ %cap = call ptr @captures(ptr %a) nounwind readonly
+ %l = load i32, ptr %b
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/noalias-wraparound-bug.ll b/llvm/test/Analysis/BasicAA/noalias-wraparound-bug.ll
index 19923aaa440aa..8c99f9d6393ff 100644
--- a/llvm/test/Analysis/BasicAA/noalias-wraparound-bug.ll
+++ b/llvm/test/Analysis/BasicAA/noalias-wraparound-bug.ll
@@ -7,18 +7,15 @@ target triple = "i386-apple-macosx10.6.0"
; "tmp12" returning i32 32, since basicaa converted the offsets to 64b
; and missed the wrap-around
-define i32 @foo(i8* %buffer) {
+define i32 @foo(ptr %buffer) {
entry:
- %tmp2 = getelementptr i8, i8* %buffer, i32 -2071408432
- %tmp3 = bitcast i8* %tmp2 to i32*
- %tmp4 = getelementptr i8, i8* %buffer, i32 128
- %tmp5 = bitcast i8* %tmp4 to i32*
- store i32 32, i32* %tmp5, align 4
- %tmp12 = getelementptr i32, i32* %tmp3, i32 -1629631508
- store i32 28, i32* %tmp12, align 4
- %tmp13 = getelementptr i8, i8* %buffer, i32 128
- %tmp14 = bitcast i8* %tmp13 to i32*
- %tmp2083 = load i32, i32* %tmp14, align 4
+ %tmp2 = getelementptr i8, ptr %buffer, i32 -2071408432
+ %tmp4 = getelementptr i8, ptr %buffer, i32 128
+ store i32 32, ptr %tmp4, align 4
+ %tmp12 = getelementptr i32, ptr %tmp2, i32 -1629631508
+ store i32 28, ptr %tmp12, align 4
+ %tmp13 = getelementptr i8, ptr %buffer, i32 128
+ %tmp2083 = load i32, ptr %tmp13, align 4
; CHECK: ret i32 28
ret i32 %tmp2083
}
diff --git a/llvm/test/Analysis/BasicAA/phi-and-select.ll b/llvm/test/Analysis/BasicAA/phi-and-select.ll
index 8b5352b25ac7b..afd7bb21aeffd 100644
--- a/llvm/test/Analysis/BasicAA/phi-and-select.ll
+++ b/llvm/test/Analysis/BasicAA/phi-and-select.ll
@@ -5,7 +5,7 @@
; Two PHIs in the same block.
; CHECK-LABEL: Function: foo
; CHECK: NoAlias: double* %a, double* %b
-define void @foo(i1 %m, double* noalias %x, double* noalias %y) {
+define void @foo(i1 %m, ptr noalias %x, ptr noalias %y) {
entry:
br i1 %m, label %true, label %false
@@ -16,30 +16,30 @@ false:
br label %exit
exit:
- %a = phi double* [ %x, %true ], [ %y, %false ]
- %b = phi double* [ %x, %false ], [ %y, %true ]
- store volatile double 0.0, double* %a
- store volatile double 1.0, double* %b
+ %a = phi ptr [ %x, %true ], [ %y, %false ]
+ %b = phi ptr [ %x, %false ], [ %y, %true ]
+ store volatile double 0.0, ptr %a
+ store volatile double 1.0, ptr %b
ret void
}
; Two selects with the same condition.
; CHECK-LABEL: Function: bar
; CHECK: NoAlias: double* %a, double* %b
-define void @bar(i1 %m, double* noalias %x, double* noalias %y) {
+define void @bar(i1 %m, ptr noalias %x, ptr noalias %y) {
entry:
- %a = select i1 %m, double* %x, double* %y
- %b = select i1 %m, double* %y, double* %x
- store volatile double 0.000000e+00, double* %a
- store volatile double 1.000000e+00, double* %b
+ %a = select i1 %m, ptr %x, ptr %y
+ %b = select i1 %m, ptr %y, ptr %x
+ store volatile double 0.000000e+00, ptr %a
+ store volatile double 1.000000e+00, ptr %b
ret void
}
; Two PHIs with disjoint sets of inputs.
; CHECK-LABEL: Function: qux
; CHECK: NoAlias: double* %a, double* %b
-define void @qux(i1 %m, double* noalias %x, double* noalias %y,
- i1 %n, double* noalias %v, double* noalias %w) {
+define void @qux(i1 %m, ptr noalias %x, ptr noalias %y,
+ i1 %n, ptr noalias %v, ptr noalias %w) {
entry:
br i1 %m, label %true, label %false
@@ -50,7 +50,7 @@ false:
br label %exit
exit:
- %a = phi double* [ %x, %true ], [ %y, %false ]
+ %a = phi ptr [ %x, %true ], [ %y, %false ]
br i1 %n, label %ntrue, label %nfalse
ntrue:
@@ -60,22 +60,22 @@ nfalse:
br label %nexit
nexit:
- %b = phi double* [ %v, %ntrue ], [ %w, %nfalse ]
- store volatile double 0.0, double* %a
- store volatile double 1.0, double* %b
+ %b = phi ptr [ %v, %ntrue ], [ %w, %nfalse ]
+ store volatile double 0.0, ptr %a
+ store volatile double 1.0, ptr %b
ret void
}
; Two selects with disjoint sets of arms.
; CHECK-LABEL: Function: fin
; CHECK: NoAlias: double* %a, double* %b
-define void @fin(i1 %m, double* noalias %x, double* noalias %y,
- i1 %n, double* noalias %v, double* noalias %w) {
+define void @fin(i1 %m, ptr noalias %x, ptr noalias %y,
+ i1 %n, ptr noalias %v, ptr noalias %w) {
entry:
- %a = select i1 %m, double* %x, double* %y
- %b = select i1 %n, double* %v, double* %w
- store volatile double 0.000000e+00, double* %a
- store volatile double 1.000000e+00, double* %b
+ %a = select i1 %m, ptr %x, ptr %y
+ %b = select i1 %n, ptr %v, ptr %w
+ store volatile double 0.000000e+00, ptr %a
+ store volatile double 1.000000e+00, ptr %b
ret void
}
@@ -94,12 +94,12 @@ entry:
br label %loop
loop:
- %phi = phi i32* [ %a3, %entry ], [ %sel2, %loop ]
+ %phi = phi ptr [ %a3, %entry ], [ %sel2, %loop ]
%c = phi i1 [ true, %entry ], [ false, %loop ]
- %sel1 = select i1 %c, i32* %a1, i32* %a2
- %sel2 = select i1 %c, i32* %a2, i32* %a1
- load i32, i32* %sel1
- load i32, i32* %sel2
- load i32, i32* %phi
+ %sel1 = select i1 %c, ptr %a1, ptr %a2
+ %sel2 = select i1 %c, ptr %a2, ptr %a1
+ load i32, ptr %sel1
+ load i32, ptr %sel2
+ load i32, ptr %phi
br label %loop
}
diff --git a/llvm/test/Analysis/BasicAA/phi-loop.ll b/llvm/test/Analysis/BasicAA/phi-loop.ll
index 2eed9ce4a30d2..b82c72199fb5e 100644
--- a/llvm/test/Analysis/BasicAA/phi-loop.ll
+++ b/llvm/test/Analysis/BasicAA/phi-loop.ll
@@ -27,46 +27,45 @@
; CHECK-LABEL: for.body:
; CHECK-NOT: load i32, i32* %word_ofs
-%struct.section_t = type { i32, i32, i32* }
+%struct.section_t = type { i32, i32, ptr }
-define void @test2(%struct.section_t* noalias nocapture readonly %section, i32* noalias nocapture %dst) {
+define void @test2(ptr noalias nocapture readonly %section, ptr noalias nocapture %dst) {
entry:
- %data13 = getelementptr inbounds %struct.section_t, %struct.section_t* %section, i32 0, i32 2
- %0 = load i32*, i32** %data13, align 4
- %cmp14 = icmp eq i32* %0, null
+ %data13 = getelementptr inbounds %struct.section_t, ptr %section, i32 0, i32 2
+ %0 = load ptr, ptr %data13, align 4
+ %cmp14 = icmp eq ptr %0, null
br i1 %cmp14, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
- %1 = phi i32* [ %6, %for.end ], [ %0, %entry ]
- %section.addr.015 = phi %struct.section_t* [ %incdec.ptr, %for.end ], [ %section, %entry ]
- %num_words = getelementptr inbounds %struct.section_t, %struct.section_t* %section.addr.015, i32 0, i32 0
- %2 = load i32, i32* %num_words, align 4
+ %1 = phi ptr [ %6, %for.end ], [ %0, %entry ]
+ %section.addr.015 = phi ptr [ %incdec.ptr, %for.end ], [ %section, %entry ]
+ %2 = load i32, ptr %section.addr.015, align 4
%cmp211 = icmp eq i32 %2, 0
br i1 %cmp211, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %for.cond.preheader
- %word_ofs = getelementptr inbounds %struct.section_t, %struct.section_t* %section.addr.015, i32 0, i32 1
+ %word_ofs = getelementptr inbounds %struct.section_t, ptr %section.addr.015, i32 0, i32 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
- %arrayidx.phi = phi i32* [ %1, %for.body.lr.ph ], [ %arrayidx.inc, %for.body ]
+ %arrayidx.phi = phi ptr [ %1, %for.body.lr.ph ], [ %arrayidx.inc, %for.body ]
%i.012 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
- %3 = load i32, i32* %arrayidx.phi, align 4
- %4 = load i32, i32* %word_ofs, align 4
+ %3 = load i32, ptr %arrayidx.phi, align 4
+ %4 = load i32, ptr %word_ofs, align 4
%add = add i32 %4, %i.012
- %arrayidx3 = getelementptr inbounds i32, i32* %dst, i32 %add
- store i32 %3, i32* %arrayidx3, align 4
+ %arrayidx3 = getelementptr inbounds i32, ptr %dst, i32 %add
+ store i32 %3, ptr %arrayidx3, align 4
%inc = add i32 %i.012, 1
- %5 = load i32, i32* %num_words, align 4
+ %5 = load i32, ptr %section.addr.015, align 4
%cmp2 = icmp ult i32 %inc, %5
- %arrayidx.inc = getelementptr i32, i32* %arrayidx.phi, i32 1
+ %arrayidx.inc = getelementptr i32, ptr %arrayidx.phi, i32 1
br i1 %cmp2, label %for.body, label %for.end
for.end: ; preds = %for.body, %for.cond.preheader
- %incdec.ptr = getelementptr inbounds %struct.section_t, %struct.section_t* %section.addr.015, i32 1
- %data = getelementptr inbounds %struct.section_t, %struct.section_t* %section.addr.015, i32 1, i32 2
- %6 = load i32*, i32** %data, align 4
- %cmp = icmp eq i32* %6, null
+ %incdec.ptr = getelementptr inbounds %struct.section_t, ptr %section.addr.015, i32 1
+ %data = getelementptr inbounds %struct.section_t, ptr %section.addr.015, i32 1, i32 2
+ %6 = load ptr, ptr %data, align 4
+ %cmp = icmp eq ptr %6, null
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end, %entry
diff --git a/llvm/test/Analysis/BasicAA/phi-values-usage.ll b/llvm/test/Analysis/BasicAA/phi-values-usage.ll
index b618beb44d830..4c5f071ab9669 100644
--- a/llvm/test/Analysis/BasicAA/phi-values-usage.ll
+++ b/llvm/test/Analysis/BasicAA/phi-values-usage.ll
@@ -12,39 +12,38 @@
target datalayout = "p:8:8-n8"
-declare void @otherfn([4 x i8]*)
+declare void @otherfn(ptr)
declare i32 @__gxx_personality_v0(...)
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
- at c = external global i8*, align 1
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
+ at c = external global ptr, align 1
; This function is one where if we didn't free basicaa after memcpyopt then the
; usage of basicaa in instcombine would cause a segfault due to stale phi-values
; results being used.
-define void @fn(i8* %this, i64* %ptr) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @fn(ptr %this, ptr %ptr) personality ptr @__gxx_personality_v0 {
entry:
%arr = alloca [4 x i8], align 8
- %gep1 = getelementptr inbounds [4 x i8], [4 x i8]* %arr, i64 0, i32 0
br i1 undef, label %then, label %if
if:
br label %then
then:
- %phi = phi i64* [ %ptr, %if ], [ null, %entry ]
- store i8 1, i8* %gep1, align 8
- %load = load i64, i64* %phi, align 8
- %gep2 = getelementptr inbounds i8, i8* undef, i64 %load
- %gep3 = getelementptr inbounds i8, i8* %gep2, i64 40
- invoke i32 undef(i8* undef)
+ %phi = phi ptr [ %ptr, %if ], [ null, %entry ]
+ store i8 1, ptr %arr, align 8
+ %load = load i64, ptr %phi, align 8
+ %gep2 = getelementptr inbounds i8, ptr undef, i64 %load
+ %gep3 = getelementptr inbounds i8, ptr %gep2, i64 40
+ invoke i32 undef(ptr undef)
to label %invoke unwind label %lpad
invoke:
unreachable
lpad:
- landingpad { i8*, i32 }
- catch i8* null
- call void @otherfn([4 x i8]* nonnull %arr)
+ landingpad { ptr, i32 }
+ catch ptr null
+ call void @otherfn(ptr nonnull %arr)
unreachable
}
@@ -54,21 +53,20 @@ lpad:
define void @fn2() {
entry:
%a = alloca i8, align 1
- %0 = load i8*, i8** @c, align 1
- %1 = bitcast i8* %0 to i8**
+ %0 = load ptr, ptr @c, align 1
br label %for.cond
for.cond: ; preds = %for.body, %entry
- %d.0 = phi i8** [ %1, %entry ], [ null, %for.body ]
+ %d.0 = phi ptr [ %0, %entry ], [ null, %for.body ]
br i1 undef, label %for.body, label %for.cond.cleanup
for.body: ; preds = %for.cond
- store volatile i8 undef, i8* %a, align 1
+ store volatile i8 undef, ptr %a, align 1
br label %for.cond
for.cond.cleanup: ; preds = %for.cond
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %a)
- %2 = load i8*, i8** %d.0, align 1
- store i8* %2, i8** @c, align 1
+ call void @llvm.lifetime.end.p0(i64 1, ptr %a)
+ %1 = load ptr, ptr %d.0, align 1
+ store ptr %1, ptr @c, align 1
ret void
}
diff --git a/llvm/test/Analysis/BasicAA/pr18573.ll b/llvm/test/Analysis/BasicAA/pr18573.ll
index 7029c14af0fdd..5c37f9f4a275c 100644
--- a/llvm/test/Analysis/BasicAA/pr18573.ll
+++ b/llvm/test/Analysis/BasicAA/pr18573.ll
@@ -5,18 +5,18 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: nounwind readonly
-declare <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float>, i8*, <8 x i32>, <8 x float>, i8) #0
+declare <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float>, ptr, <8 x i32>, <8 x float>, i8) #0
; Function Attrs: nounwind
-define <8 x float> @foo1(i8* noalias %arr.ptr, <8 x i32>* noalias readonly %vix.ptr, i8* noalias %t2.ptr) #1 {
+define <8 x float> @foo1(ptr noalias %arr.ptr, ptr noalias readonly %vix.ptr, ptr noalias %t2.ptr) #1 {
allocas:
- %vix = load <8 x i32>, <8 x i32>* %vix.ptr, align 4
- %t1.ptr = getelementptr i8, i8* %arr.ptr, i8 4
+ %vix = load <8 x i32>, ptr %vix.ptr, align 4
+ %t1.ptr = getelementptr i8, ptr %arr.ptr, i8 4
- %v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2
- store i8 1, i8* %t1.ptr, align 4
+ %v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, ptr %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2
+ store i8 1, ptr %t1.ptr, align 4
- %v2 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2
+ %v2 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, ptr %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2
%res = fadd <8 x float> %v1, %v2
ret <8 x float> %res
@@ -29,15 +29,15 @@ allocas:
; Check that second gather is eliminated as gather and store memory accesses are based on
diff erent no-aliasing pointers
; Function Attrs: nounwind
-define <8 x float> @foo2(i8* noalias readonly %arr.ptr, <8 x i32>* noalias readonly %vix.ptr, i8* noalias %t2.ptr) #1 {
+define <8 x float> @foo2(ptr noalias readonly %arr.ptr, ptr noalias readonly %vix.ptr, ptr noalias %t2.ptr) #1 {
allocas:
- %vix = load <8 x i32>, <8 x i32>* %vix.ptr, align 4
- %t1.ptr = getelementptr i8, i8* %arr.ptr, i8 4
+ %vix = load <8 x i32>, ptr %vix.ptr, align 4
+ %t1.ptr = getelementptr i8, ptr %arr.ptr, i8 4
- %v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2
- store i8 1, i8* %t2.ptr, align 4
+ %v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, ptr %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2
+ store i8 1, ptr %t2.ptr, align 4
- %v2 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2
+ %v2 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, ptr %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2
%res = fadd <8 x float> %v1, %v2
ret <8 x float> %res
diff --git a/llvm/test/Analysis/BasicAA/ptrmask.ll b/llvm/test/Analysis/BasicAA/ptrmask.ll
index b9041ad1ef13a..d2ddba08779df 100644
--- a/llvm/test/Analysis/BasicAA/ptrmask.ll
+++ b/llvm/test/Analysis/BasicAA/ptrmask.ll
@@ -6,28 +6,28 @@
; CHECK-NEXT: NoAlias: %struct* %ptr1, i64* %ptr2
; CHECK-NEXT: NoAlias: %struct* %addr.ptr, i64* %ptr2
; CHECK-NEXT: NoAlias: i64* %gep, i64* %ptr2
-define void @test_noalias(%struct* noalias %ptr1, i64* %ptr2, i64 %offset) {
+define void @test_noalias(ptr noalias %ptr1, ptr %ptr2, i64 %offset) {
entry:
- %addr.ptr = call %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct* %ptr1, i64 72057594037927928)
- load %struct, %struct* %ptr1
- load %struct, %struct* %addr.ptr
- store i64 10, i64* %ptr2
- %gep = getelementptr inbounds %struct, %struct* %addr.ptr, i64 0, i32 0, i64 %offset
- store i64 1, i64* %gep, align 8
+ %addr.ptr = call ptr @llvm.ptrmask.p0.p0.struct.i64(ptr %ptr1, i64 72057594037927928)
+ load %struct, ptr %ptr1
+ load %struct, ptr %addr.ptr
+ store i64 10, ptr %ptr2
+ %gep = getelementptr inbounds %struct, ptr %addr.ptr, i64 0, i32 0, i64 %offset
+ store i64 1, ptr %gep, align 8
ret void
}
; CHECK-NEXT: Function: test_alias
; CHECK-NOT: NoAlias
-define void @test_alias(%struct* %ptr1, i64* %ptr2, i64 %offset) {
+define void @test_alias(ptr %ptr1, ptr %ptr2, i64 %offset) {
entry:
- %addr.ptr = call %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct* %ptr1, i64 72057594037927928)
- load %struct, %struct* %ptr1
- load %struct, %struct* %addr.ptr
- store i64 10, i64* %ptr2
- %gep = getelementptr inbounds %struct, %struct* %addr.ptr, i64 0, i32 0, i64 %offset
- store i64 1, i64* %gep, align 8
+ %addr.ptr = call ptr @llvm.ptrmask.p0.p0.struct.i64(ptr %ptr1, i64 72057594037927928)
+ load %struct, ptr %ptr1
+ load %struct, ptr %addr.ptr
+ store i64 10, ptr %ptr2
+ %gep = getelementptr inbounds %struct, ptr %addr.ptr, i64 0, i32 0, i64 %offset
+ store i64 1, ptr %gep, align 8
ret void
}
-declare %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct*, i64)
+declare ptr @llvm.ptrmask.p0.p0.struct.i64(ptr, i64)
diff --git a/llvm/test/Analysis/BasicAA/tailcall-modref.ll b/llvm/test/Analysis/BasicAA/tailcall-modref.ll
index 05988dd43626f..22dab2d758af7 100644
--- a/llvm/test/Analysis/BasicAA/tailcall-modref.ll
+++ b/llvm/test/Analysis/BasicAA/tailcall-modref.ll
@@ -2,15 +2,15 @@
define i32 @test() {
; CHECK: ret i32 0
- %A = alloca i32 ; <i32*> [#uses=3]
- call void @foo( i32* %A )
- %X = load i32, i32* %A ; <i32> [#uses=1]
+ %A = alloca i32 ; <ptr> [#uses=3]
+ call void @foo( ptr %A )
+ %X = load i32, ptr %A ; <i32> [#uses=1]
tail call void @bar( )
- %Y = load i32, i32* %A ; <i32> [#uses=1]
+ %Y = load i32, ptr %A ; <i32> [#uses=1]
%Z = sub i32 %X, %Y ; <i32> [#uses=1]
ret i32 %Z
}
-declare void @foo(i32*)
+declare void @foo(ptr)
declare void @bar()
diff --git a/llvm/test/Analysis/BasicAA/underlying-value.ll b/llvm/test/Analysis/BasicAA/underlying-value.ll
index 007ec279c1fe2..4d267af8c4443 100644
--- a/llvm/test/Analysis/BasicAA/underlying-value.ll
+++ b/llvm/test/Analysis/BasicAA/underlying-value.ll
@@ -14,10 +14,9 @@ for.cond2: ; preds = %for.body5, %for.con
br i1 false, label %for.body5, label %for.cond
for.body5: ; preds = %for.cond2
- %arrayidx = getelementptr inbounds [2 x i64], [2 x i64]* undef, i32 0, i64 0
- %tmp7 = load i64, i64* %arrayidx, align 8
- %arrayidx9 = getelementptr inbounds [2 x i64], [2 x i64]* undef, i32 0, i64 undef
- %tmp10 = load i64, i64* %arrayidx9, align 8
+ %tmp7 = load i64, ptr undef, align 8
+ %arrayidx9 = getelementptr inbounds [2 x i64], ptr undef, i32 0, i64 undef
+ %tmp10 = load i64, ptr %arrayidx9, align 8
br label %for.cond2
for.end22: ; preds = %for.cond
diff --git a/llvm/test/Analysis/BasicAA/unreachable-block.ll b/llvm/test/Analysis/BasicAA/unreachable-block.ll
index e30176eb79a5b..e59a16b0b79e6 100644
--- a/llvm/test/Analysis/BasicAA/unreachable-block.ll
+++ b/llvm/test/Analysis/BasicAA/unreachable-block.ll
@@ -8,9 +8,8 @@ entry:
unreachable
bb:
- %t = select i1 undef, i32* %t, i32* undef
- %p = select i1 undef, i32* %p, i32* %p
- %q = select i1 undef, i32* undef, i32* %p
- %a = getelementptr i8, i8* %a, i32 0
+ %t = select i1 undef, ptr %t, ptr undef
+ %p = select i1 undef, ptr %p, ptr %p
+ %q = select i1 undef, ptr undef, ptr %p
unreachable
}
More information about the llvm-commits
mailing list