[llvm] 47f0b66 - [GlobalAA] Convert tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 16 03:21:55 PST 2022
Author: Nikita Popov
Date: 2022-12-16T12:21:31+01:00
New Revision: 47f0b6630c78ab52c2197ec5e1c2d13a6acffed1
URL: https://github.com/llvm/llvm-project/commit/47f0b6630c78ab52c2197ec5e1c2d13a6acffed1
DIFF: https://github.com/llvm/llvm-project/commit/47f0b6630c78ab52c2197ec5e1c2d13a6acffed1.diff
LOG: [GlobalAA] Convert tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadGlobals.ll
llvm/test/Analysis/GlobalsModRef/addrspacecast.ll
llvm/test/Analysis/GlobalsModRef/aliastest.ll
llvm/test/Analysis/GlobalsModRef/atomic-instrs.ll
llvm/test/Analysis/GlobalsModRef/chaining-analysis.ll
llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll
llvm/test/Analysis/GlobalsModRef/dead-uses.ll
llvm/test/Analysis/GlobalsModRef/func-memattributes.ll
llvm/test/Analysis/GlobalsModRef/functions_without_nosync.ll
llvm/test/Analysis/GlobalsModRef/global-used-by-global.ll
llvm/test/Analysis/GlobalsModRef/inaccessiblememonly.ll
llvm/test/Analysis/GlobalsModRef/indirect-global.ll
llvm/test/Analysis/GlobalsModRef/intrinsic_addressnottaken1.ll
llvm/test/Analysis/GlobalsModRef/intrinsic_addressnottaken2.ll
llvm/test/Analysis/GlobalsModRef/intrinsic_addresstaken.ll
llvm/test/Analysis/GlobalsModRef/memset-escape.ll
llvm/test/Analysis/GlobalsModRef/modreftest.ll
llvm/test/Analysis/GlobalsModRef/no-escape.ll
llvm/test/Analysis/GlobalsModRef/nonescaping-noalias.ll
llvm/test/Analysis/GlobalsModRef/pr12351.ll
llvm/test/Analysis/GlobalsModRef/pr25309.ll
llvm/test/Analysis/GlobalsModRef/pr35899-dbg-value.ll
llvm/test/Analysis/GlobalsModRef/purecse.ll
llvm/test/Analysis/GlobalsModRef/volatile-instrs.ll
llvm/test/Analysis/GlobalsModRef/weak-interposition.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadGlobals.ll b/llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadGlobals.ll
index 92daa4332dbf7..9678de6bad19d 100644
--- a/llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadGlobals.ll
+++ b/llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadGlobals.ll
@@ -1,9 +1,9 @@
; RUN: opt < %s -aa-pipeline=globals-aa -passes='require<globals-aa>,gvn' -S | FileCheck %s
- at g = internal global i32 0 ; <i32*> [#uses=2]
+ at g = internal global i32 0 ; <ptr> [#uses=2]
define i32 @r() {
- %tmp = load i32, i32* @g ; <i32> [#uses=1]
+ %tmp = load i32, ptr @g ; <i32> [#uses=1]
ret i32 %tmp
}
@@ -12,7 +12,7 @@ define i32 @f() {
; CHECK: call i32 @e()
entry:
%tmp = call i32 @e( ) ; <i32> [#uses=1]
- store i32 %tmp, i32* @g
+ store i32 %tmp, ptr @g
%tmp2 = call i32 @e( ) ; <i32> [#uses=1]
ret i32 %tmp2
}
diff --git a/llvm/test/Analysis/GlobalsModRef/addrspacecast.ll b/llvm/test/Analysis/GlobalsModRef/addrspacecast.ll
index 7bc8032ad76d8..9432dc02ef2c6 100644
--- a/llvm/test/Analysis/GlobalsModRef/addrspacecast.ll
+++ b/llvm/test/Analysis/GlobalsModRef/addrspacecast.ll
@@ -6,11 +6,11 @@
; CHECK-DAG: NoAlias: i32* %gp, i32* %p
; CHECK-DAG: NoAlias: i32* %p, i32 addrspace(3)* @g0
; CHECK-DAG: MustAlias: i32* %gp, i32 addrspace(3)* @g0
-define i32 @test1(i32* %p) {
- load i32, i32 addrspace(3)* @g0
- %gp = addrspacecast i32 addrspace(3)* @g0 to i32*
- store i32 0, i32* %gp
- store i32 1, i32* %p
- %v = load i32, i32* %gp
+define i32 @test1(ptr %p) {
+ load i32, ptr addrspace(3) @g0
+ %gp = addrspacecast ptr addrspace(3) @g0 to ptr
+ store i32 0, ptr %gp
+ store i32 1, ptr %p
+ %v = load i32, ptr %gp
ret i32 %v
}
diff --git a/llvm/test/Analysis/GlobalsModRef/aliastest.ll b/llvm/test/Analysis/GlobalsModRef/aliastest.ll
index 6b7154e735faa..2836a7c43559f 100644
--- a/llvm/test/Analysis/GlobalsModRef/aliastest.ll
+++ b/llvm/test/Analysis/GlobalsModRef/aliastest.ll
@@ -3,15 +3,15 @@
; Note that this test relies on an unsafe feature of GlobalsModRef. While this
; test is correct and safe, GMR's technique for handling this isn't generally.
- at X = internal global i32 4 ; <i32*> [#uses=1]
+ at X = internal global i32 4 ; <ptr> [#uses=1]
-define i32 @test(i32* %P) {
+define i32 @test(ptr %P) {
; CHECK: @test
-; CHECK-NEXT: store i32 7, i32* %P
-; CHECK-NEXT: store i32 12, i32* @X
+; CHECK-NEXT: store i32 7, ptr %P
+; CHECK-NEXT: store i32 12, ptr @X
; CHECK-NEXT: ret i32 7
- store i32 7, i32* %P
- store i32 12, i32* @X
- %V = load i32, i32* %P ; <i32> [#uses=1]
+ store i32 7, ptr %P
+ store i32 12, ptr @X
+ %V = load i32, ptr %P ; <i32> [#uses=1]
ret i32 %V
}
diff --git a/llvm/test/Analysis/GlobalsModRef/atomic-instrs.ll b/llvm/test/Analysis/GlobalsModRef/atomic-instrs.ll
index 4670330e47fa4..a68facb9e899b 100644
--- a/llvm/test/Analysis/GlobalsModRef/atomic-instrs.ll
+++ b/llvm/test/Analysis/GlobalsModRef/atomic-instrs.ll
@@ -2,36 +2,36 @@
@X = internal global i32 4
-define i32 @test_cmpxchg(i32* %P) {
+define i32 @test_cmpxchg(ptr %P) {
; CHECK-LABEL: @test_cmpxchg
-; CHECK-NEXT: store i32 12, i32* @X
+; CHECK-NEXT: store i32 12, ptr @X
; CHECK-NEXT: call void @modrefX_cmpxchg()
-; CHECK-NEXT: %V = load i32, i32* @X
+; CHECK-NEXT: %V = load i32, ptr @X
; CHECK-NEXT: ret i32 %V
- store i32 12, i32* @X
+ store i32 12, ptr @X
call void @modrefX_cmpxchg()
- %V = load i32, i32* @X
+ %V = load i32, ptr @X
ret i32 %V
}
define void @modrefX_cmpxchg() {
- %1 = cmpxchg i32* @X, i32 0, i32 -1 monotonic monotonic
+ %1 = cmpxchg ptr @X, i32 0, i32 -1 monotonic monotonic
ret void
}
-define i32 @test_atomicrmw(i32* %P) {
+define i32 @test_atomicrmw(ptr %P) {
; CHECK-LABEL: @test_atomicrmw
-; CHECK-NEXT: store i32 12, i32* @X
+; CHECK-NEXT: store i32 12, ptr @X
; CHECK-NEXT: call void @modrefXatomicrmw()
-; CHECK-NEXT: %V = load i32, i32* @X
+; CHECK-NEXT: %V = load i32, ptr @X
; CHECK-NEXT: ret i32 %V
- store i32 12, i32* @X
+ store i32 12, ptr @X
call void @modrefXatomicrmw()
- %V = load i32, i32* @X
+ %V = load i32, ptr @X
ret i32 %V
}
define void @modrefXatomicrmw() {
- %1 = atomicrmw add i32* @X, i32 1 acquire
+ %1 = atomicrmw add ptr @X, i32 1 acquire
ret void
}
diff --git a/llvm/test/Analysis/GlobalsModRef/chaining-analysis.ll b/llvm/test/Analysis/GlobalsModRef/chaining-analysis.ll
index 2f498984d4650..da230b772aaa1 100644
--- a/llvm/test/Analysis/GlobalsModRef/chaining-analysis.ll
+++ b/llvm/test/Analysis/GlobalsModRef/chaining-analysis.ll
@@ -3,18 +3,18 @@
; This test requires the use of previous analyses to determine that
; doesnotmodX does not modify X (because 'sin' doesn't).
- at X = internal global i32 4 ; <i32*> [#uses=2]
+ at X = internal global i32 4 ; <ptr> [#uses=2]
declare double @sin(double) readnone
-define i32 @test(i32* %P) {
+define i32 @test(ptr %P) {
; CHECK: @test
-; CHECK-NEXT: store i32 12, i32* @X
+; CHECK-NEXT: store i32 12, ptr @X
; CHECK-NEXT: call double @doesnotmodX(double 1.000000e+00)
; CHECK-NEXT: ret i32 12
- store i32 12, i32* @X
+ store i32 12, ptr @X
call double @doesnotmodX( double 1.000000e+00 ) ; <double>:1 [#uses=0]
- %V = load i32, i32* @X ; <i32> [#uses=1]
+ %V = load i32, ptr @X ; <i32> [#uses=1]
ret i32 %V
}
diff --git a/llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll b/llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll
index 35afceec09d00..1eb4de173171b 100644
--- a/llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll
+++ b/llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll
@@ -4,15 +4,15 @@
@X = internal global i32 4
-define i32 @test(i32* %P) {
+define i32 @test(ptr %P) {
; CHECK: @test
-; CHECK-NEXT: store i32 12, i32* @X
+; CHECK-NEXT: store i32 12, ptr @X
; CHECK-NEXT: call void @doesnotmodX()
-; CHECK-NEXT: %V = load i32, i32* @X
+; CHECK-NEXT: %V = load i32, ptr @X
; CHECK-NEXT: ret i32 %V
- store i32 12, i32* @X
+ store i32 12, ptr @X
call void @doesnotmodX( )
- %V = load i32, i32* @X
+ %V = load i32, ptr @X
ret i32 %V
}
diff --git a/llvm/test/Analysis/GlobalsModRef/dead-uses.ll b/llvm/test/Analysis/GlobalsModRef/dead-uses.ll
index 0a16001ddb11c..04d3011b98adc 100644
--- a/llvm/test/Analysis/GlobalsModRef/dead-uses.ll
+++ b/llvm/test/Analysis/GlobalsModRef/dead-uses.ll
@@ -10,7 +10,7 @@ define i32 @g() {
; Make sure the load of @a is hoisted.
; CHECK-LABEL: define i32 @g()
; CHECK: entry:
-; CHECK-NEXT: load i32, i32* @a, align 4
+; CHECK-NEXT: load i32, ptr @a, align 4
; CHECK-NEXT: br label %for.cond
entry:
br label %for.cond
@@ -22,7 +22,7 @@ for.cond: ; preds = %for.inc, %entry
br i1 %cmp, label %for.body, label %for.end
for.body: ; preds = %for.cond
- %0 = load i32, i32* @a, align 4
+ %0 = load i32, ptr @a, align 4
%add = add nsw i32 %sum.0, %0
call void @f()
br label %for.inc
@@ -42,13 +42,13 @@ entry:
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
- store i32 ptrtoint (i32* @a to i32), i32* @c, align 4
+ store i32 ptrtoint (ptr @a to i32), ptr @c, align 4
br label %if.end
if.end: ; preds = %if.then, %entry
- %0 = load i32, i32* @c, align 4
+ %0 = load i32, ptr @c, align 4
%inc = add nsw i32 %0, 1
- store i32 %inc, i32* @c, align 4
+ store i32 %inc, ptr @c, align 4
ret void
}
diff --git a/llvm/test/Analysis/GlobalsModRef/func-memattributes.ll b/llvm/test/Analysis/GlobalsModRef/func-memattributes.ll
index 3c912b2e1df50..85fc02cfc39a2 100644
--- a/llvm/test/Analysis/GlobalsModRef/func-memattributes.ll
+++ b/llvm/test/Analysis/GlobalsModRef/func-memattributes.ll
@@ -4,12 +4,12 @@
define i32 @test0() {
; CHECK-LABEL: @test0
-; CHECK: store i32 0, i32* @X
+; CHECK: store i32 0, ptr @X
; CHECK-NEXT: call i32 @func_readonly() #0
-; CHECK-NEXT: store i32 1, i32* @X
- store i32 0, i32* @X
+; CHECK-NEXT: store i32 1, ptr @X
+ store i32 0, ptr @X
%x = call i32 @func_readonly() #0
- store i32 1, i32* @X
+ store i32 1, ptr @X
ret i32 %x
}
@@ -17,10 +17,10 @@ define i32 @test1() {
; CHECK-LABEL: @test1
; CHECK-NOT: store
; CHECK: call i32 @func_read_argmem_only() #1
-; CHECK-NEXT: store i32 3, i32* @X
- store i32 2, i32* @X
+; CHECK-NEXT: store i32 3, ptr @X
+ store i32 2, ptr @X
%x = call i32 @func_read_argmem_only() #1
- store i32 3, i32* @X
+ store i32 3, ptr @X
ret i32 %x
}
diff --git a/llvm/test/Analysis/GlobalsModRef/functions_without_nosync.ll b/llvm/test/Analysis/GlobalsModRef/functions_without_nosync.ll
index 1eb1aa158ceab..e92a45807ed9c 100644
--- a/llvm/test/Analysis/GlobalsModRef/functions_without_nosync.ll
+++ b/llvm/test/Analysis/GlobalsModRef/functions_without_nosync.ll
@@ -14,9 +14,9 @@ target triple = "nvptx64-nvidia-cuda"
; CHECK: tail call void @llvm.nvvm.bar.sync(i32 0)
; CHECK: load
define dso_local i32 @bar_sync(i32 %0) local_unnamed_addr {
- store i32 %0, i32* addrspacecast (i32 addrspace(3)* @s to i32*), align 4
+ store i32 %0, ptr addrspacecast (ptr addrspace(3) @s to ptr), align 4
tail call void @llvm.nvvm.bar.sync(i32 0)
- %2 = load i32, i32* addrspacecast (i32 addrspace(3)* @s to i32*), align 4
+ %2 = load i32, ptr addrspacecast (ptr addrspace(3) @s to ptr), align 4
ret i32 %2
}
@@ -27,9 +27,9 @@ declare void @llvm.nvvm.bar.sync(i32) #0
; CHECK: tail call void @llvm.nvvm.barrier0()
; CHECK: load
define dso_local i32 @barrier0(i32 %0) local_unnamed_addr {
- store i32 %0, i32* addrspacecast (i32 addrspace(3)* @s to i32*), align 4
+ store i32 %0, ptr addrspacecast (ptr addrspace(3) @s to ptr), align 4
tail call void @llvm.nvvm.barrier0()
- %2 = load i32, i32* addrspacecast (i32 addrspace(3)* @s to i32*), align 4
+ %2 = load i32, ptr addrspacecast (ptr addrspace(3) @s to ptr), align 4
ret i32 %2
}
diff --git a/llvm/test/Analysis/GlobalsModRef/global-used-by-global.ll b/llvm/test/Analysis/GlobalsModRef/global-used-by-global.ll
index 3265c6530d348..d8fa4a1c9da4c 100644
--- a/llvm/test/Analysis/GlobalsModRef/global-used-by-global.ll
+++ b/llvm/test/Analysis/GlobalsModRef/global-used-by-global.ll
@@ -2,9 +2,9 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
- at a = internal global i32* null, align 8
- at b = global i32** @a, align 8
- at c = global i32** @a, align 8
+ at a = internal global ptr null, align 8
+ at b = global ptr @a, align 8
+ at c = global ptr @a, align 8
@d = common global i32 0, align 4
; Make sure we globals-aa doesn't get confused and allow hoisting
@@ -12,15 +12,15 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; CHECK-LABEL: define i32 @main()
; CHECK: for.body:
-; CHECK-NEXT: %2 = load i32**, i32*** @b, align 8
-; CHECK-NEXT: store i32* @d, i32** %2, align 8
-; CHECK-NEXT: %3 = load i32*, i32** @a, align 8
-; CHECK-NEXT: %cmp1 = icmp ne i32* %3, @d
+; CHECK-NEXT: %2 = load ptr, ptr @b, align 8
+; CHECK-NEXT: store ptr @d, ptr %2, align 8
+; CHECK-NEXT: %3 = load ptr, ptr @a, align 8
+; CHECK-NEXT: %cmp1 = icmp ne ptr %3, @d
; CHECK-NEXT: br i1 %cmp1, label %if.then, label %if.end
define i32 @main() {
entry:
- %0 = load i32, i32* @d, align 4
+ %0 = load i32, ptr @d, align 4
br label %for.cond
for.cond: ; preds = %if.end, %entry
@@ -29,19 +29,19 @@ for.cond: ; preds = %if.end, %entry
br i1 %cmp, label %for.body, label %for.end
for.body: ; preds = %for.cond
- %2 = load i32**, i32*** @b, align 8
- store i32* @d, i32** %2, align 8
- %3 = load i32*, i32** @a, align 8
- %cmp1 = icmp ne i32* %3, @d
+ %2 = load ptr, ptr @b, align 8
+ store ptr @d, ptr %2, align 8
+ %3 = load ptr, ptr @a, align 8
+ %cmp1 = icmp ne ptr %3, @d
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %for.body
br label %return
if.end: ; preds = %for.body
- %4 = load i32, i32* @d, align 4
+ %4 = load i32, ptr @d, align 4
%inc = add nsw i32 %4, 1
- store i32 %inc, i32* @d, align 4
+ store i32 %inc, ptr @d, align 4
br label %for.cond
for.end: ; preds = %for.cond
diff --git a/llvm/test/Analysis/GlobalsModRef/inaccessiblememonly.ll b/llvm/test/Analysis/GlobalsModRef/inaccessiblememonly.ll
index d7a3cfc78a333..f808a6e963fbb 100644
--- a/llvm/test/Analysis/GlobalsModRef/inaccessiblememonly.ll
+++ b/llvm/test/Analysis/GlobalsModRef/inaccessiblememonly.ll
@@ -5,17 +5,17 @@ target triple = "x86_64-unknown-linux-gnu"
define void @donteliminate() {
; CHECK-LABEL: donteliminate
-; CHECK-NEXT: tail call noalias i8* @allocmemory()
-; CHECK-NEXT: tail call noalias i8* @allocmemory()
-; CHECK-NEXT: tail call noalias i8* @allocmemory()
+; CHECK-NEXT: tail call noalias ptr @allocmemory()
+; CHECK-NEXT: tail call noalias ptr @allocmemory()
+; CHECK-NEXT: tail call noalias ptr @allocmemory()
; CHECK-NEXT: ret void
- %1 = tail call noalias i8* @allocmemory()
- %2 = tail call noalias i8* @allocmemory()
- %3 = tail call noalias i8* @allocmemory()
+ %1 = tail call noalias ptr @allocmemory()
+ %2 = tail call noalias ptr @allocmemory()
+ %3 = tail call noalias ptr @allocmemory()
ret void
}
; Function Attrs: inaccessiblememonly
-declare noalias i8* @allocmemory() #0
+declare noalias ptr @allocmemory() #0
attributes #0 = { inaccessiblememonly }
diff --git a/llvm/test/Analysis/GlobalsModRef/indirect-global.ll b/llvm/test/Analysis/GlobalsModRef/indirect-global.ll
index 45fec10004a5c..fc7f2164fb1c8 100644
--- a/llvm/test/Analysis/GlobalsModRef/indirect-global.ll
+++ b/llvm/test/Analysis/GlobalsModRef/indirect-global.ll
@@ -6,89 +6,86 @@
target datalayout = "p:32:32:32"
- at G = internal global i32* null ; <i32**> [#uses=3]
+ at G = internal global ptr null ; <ptr> [#uses=3]
-declare noalias i8* @malloc(i32) allockind("alloc,uninitialized") allocsize(0) inaccessiblememonly
+declare noalias ptr @malloc(i32) allockind("alloc,uninitialized") allocsize(0) inaccessiblememonly
define void @malloc_init() {
; CHECK-LABEL: @malloc_init(
-; CHECK-NEXT: [[A:%.*]] = call dereferenceable_or_null(4) i8* @malloc(i32 4)
-; CHECK-NEXT: store i8* [[A]], i8** bitcast (i32** @G to i8**), align 4
+; CHECK-NEXT: [[A:%.*]] = call dereferenceable_or_null(4) ptr @malloc(i32 4)
+; CHECK-NEXT: store ptr [[A]], ptr @G, align 4
; CHECK-NEXT: ret void
;
- %a = call i8* @malloc(i32 4)
- %A = bitcast i8* %a to i32*
- store i32* %A, i32** @G
+ %a = call ptr @malloc(i32 4)
+ store ptr %a, ptr @G
ret void
}
-define i32 @malloc_test(i32* %P) {
+define i32 @malloc_test(ptr %P) {
; CHECK-LABEL: @malloc_test(
-; CHECK-NEXT: store i32 123, i32* [[P:%.*]], align 4
+; CHECK-NEXT: store i32 123, ptr [[P:%.*]], align 4
; CHECK-NEXT: ret i32 0
;
- %g1 = load i32*, i32** @G ; <i32*> [#uses=2]
- %h1 = load i32, i32* %g1 ; <i32> [#uses=1]
- store i32 123, i32* %P
- %g2 = load i32*, i32** @G ; <i32*> [#uses=0]
- %h2 = load i32, i32* %g1 ; <i32> [#uses=1]
+ %g1 = load ptr, ptr @G ; <ptr> [#uses=2]
+ %h1 = load i32, ptr %g1 ; <i32> [#uses=1]
+ store i32 123, ptr %P
+ %g2 = load ptr, ptr @G ; <ptr> [#uses=0]
+ %h2 = load i32, ptr %g1 ; <i32> [#uses=1]
%X = sub i32 %h1, %h2 ; <i32> [#uses=1]
ret i32 %X
}
- at G2 = internal global i32* null ; <i32**> [#uses=3]
+ at G2 = internal global ptr null ; <ptr> [#uses=3]
-declare noalias i8* @calloc(i32, i32) allockind("alloc,zeroed") allocsize(0,1) inaccessiblememonly
+declare noalias ptr @calloc(i32, i32) allockind("alloc,zeroed") allocsize(0,1) inaccessiblememonly
define void @calloc_init() {
; CHECK-LABEL: @calloc_init(
-; CHECK-NEXT: [[A:%.*]] = call dereferenceable_or_null(4) i8* @calloc(i32 4, i32 1)
-; CHECK-NEXT: store i8* [[A]], i8** bitcast (i32** @G2 to i8**), align 4
+; CHECK-NEXT: [[A:%.*]] = call dereferenceable_or_null(4) ptr @calloc(i32 4, i32 1)
+; CHECK-NEXT: store ptr [[A]], ptr @G2, align 4
; CHECK-NEXT: ret void
;
- %a = call i8* @calloc(i32 4, i32 1)
- %A = bitcast i8* %a to i32*
- store i32* %A, i32** @G2
+ %a = call ptr @calloc(i32 4, i32 1)
+ store ptr %a, ptr @G2
ret void
}
-define i32 @calloc_test(i32* %P) {
+define i32 @calloc_test(ptr %P) {
; CHECK-LABEL: @calloc_test(
-; CHECK-NEXT: store i32 123, i32* [[P:%.*]], align 4
+; CHECK-NEXT: store i32 123, ptr [[P:%.*]], align 4
; CHECK-NEXT: ret i32 0
;
- %g1 = load i32*, i32** @G2 ; <i32*> [#uses=2]
- %h1 = load i32, i32* %g1 ; <i32> [#uses=1]
- store i32 123, i32* %P
- %g2 = load i32*, i32** @G2 ; <i32*> [#uses=0]
- %h2 = load i32, i32* %g1 ; <i32> [#uses=1]
+ %g1 = load ptr, ptr @G2 ; <ptr> [#uses=2]
+ %h1 = load i32, ptr %g1 ; <i32> [#uses=1]
+ store i32 123, ptr %P
+ %g2 = load ptr, ptr @G2 ; <ptr> [#uses=0]
+ %h2 = load i32, ptr %g1 ; <i32> [#uses=1]
%X = sub i32 %h1, %h2 ; <i32> [#uses=1]
ret i32 %X
}
- at G3 = internal global i32* null ; <i32**> [#uses=3]
+ at G3 = internal global ptr null ; <ptr> [#uses=3]
-declare noalias i8* @my_alloc(i32)
+declare noalias ptr @my_alloc(i32)
define void @my_alloc_init() {
; CHECK-LABEL: @my_alloc_init(
-; CHECK-NEXT: [[A:%.*]] = call i8* @my_alloc(i32 4)
-; CHECK-NEXT: store i8* [[A]], i8** bitcast (i32** @G3 to i8**), align 4
+; CHECK-NEXT: [[A:%.*]] = call ptr @my_alloc(i32 4)
+; CHECK-NEXT: store ptr [[A]], ptr @G3, align 4
; CHECK-NEXT: ret void
;
- %a = call i8* @my_alloc(i32 4)
- %A = bitcast i8* %a to i32*
- store i32* %A, i32** @G3
+ %a = call ptr @my_alloc(i32 4)
+ store ptr %a, ptr @G3
ret void
}
-define i32 @my_alloc_test(i32* %P) {
+define i32 @my_alloc_test(ptr %P) {
; CHECK-LABEL: @my_alloc_test(
-; CHECK-NEXT: store i32 123, i32* [[P:%.*]], align 4
+; CHECK-NEXT: store i32 123, ptr [[P:%.*]], align 4
; CHECK-NEXT: ret i32 0
;
- %g1 = load i32*, i32** @G3 ; <i32*> [#uses=2]
- %h1 = load i32, i32* %g1 ; <i32> [#uses=1]
- store i32 123, i32* %P
- %g2 = load i32*, i32** @G3 ; <i32*> [#uses=0]
- %h2 = load i32, i32* %g1 ; <i32> [#uses=1]
+ %g1 = load ptr, ptr @G3 ; <ptr> [#uses=2]
+ %h1 = load i32, ptr %g1 ; <i32> [#uses=1]
+ store i32 123, ptr %P
+ %g2 = load ptr, ptr @G3 ; <ptr> [#uses=0]
+ %h2 = load i32, ptr %g1 ; <i32> [#uses=1]
%X = sub i32 %h1, %h2 ; <i32> [#uses=1]
ret i32 %X
}
diff --git a/llvm/test/Analysis/GlobalsModRef/intrinsic_addressnottaken1.ll b/llvm/test/Analysis/GlobalsModRef/intrinsic_addressnottaken1.ll
index 399843dc1de80..84bae7fe01b87 100644
--- a/llvm/test/Analysis/GlobalsModRef/intrinsic_addressnottaken1.ll
+++ b/llvm/test/Analysis/GlobalsModRef/intrinsic_addressnottaken1.ll
@@ -8,8 +8,8 @@ target triple = "x86_64-unknown-linux-gnu"
; CHECK-LABEL: @main()
define dso_local i32 @main() {
entry:
- %tmp0 = call i8* @llvm.stacksave() #1
- %tmp6 = load i8, i8* @deallocCalled, align 1
+ %tmp0 = call ptr @llvm.stacksave() #1
+ %tmp6 = load i8, ptr @deallocCalled, align 1
%tobool = icmp ne i8 %tmp6, 0
br i1 %tobool, label %if.else, label %if.end
@@ -19,10 +19,10 @@ if.else: ; preds = %entry
; CHECK-LABEL: if.end:
; CHECK-NEXT: call void @llvm.stackrestore
-; CHECK-NOT: load i8, i8* @deallocCalled
+; CHECK-NOT: load i8, ptr @deallocCalled
if.end: ; preds = %entry
- call void @llvm.stackrestore(i8* %tmp0)
- %tmp7 = load i8, i8* @deallocCalled, align 1
+ call void @llvm.stackrestore(ptr %tmp0)
+ %tmp7 = load i8, ptr @deallocCalled, align 1
%tobool3 = icmp ne i8 %tmp7, 0
br i1 %tobool3, label %if.end6, label %if.else5
@@ -31,12 +31,12 @@ if.else5: ; preds = %if.end
unreachable
if.end6: ; preds = %if.end
- store i8 0, i8* @deallocCalled, align 1
+ store i8 0, ptr @deallocCalled, align 1
ret i32 0
}
-declare i8* @llvm.stacksave() #1
-declare void @llvm.stackrestore(i8*) #1
+declare ptr @llvm.stacksave() #1
+declare void @llvm.stackrestore(ptr) #1
declare dso_local void @__assert_fail() #0
attributes #0 = { noreturn nosync nounwind }
diff --git a/llvm/test/Analysis/GlobalsModRef/intrinsic_addressnottaken2.ll b/llvm/test/Analysis/GlobalsModRef/intrinsic_addressnottaken2.ll
index ba4b65089dd36..503a513286065 100644
--- a/llvm/test/Analysis/GlobalsModRef/intrinsic_addressnottaken2.ll
+++ b/llvm/test/Analysis/GlobalsModRef/intrinsic_addressnottaken2.ll
@@ -5,17 +5,17 @@ target triple = "x86_64-unknown-linux-gnu"
@deallocCalled = internal global i8 0, align 1
-define internal i8* @_i_Associated__dealloc() {
+define internal ptr @_i_Associated__dealloc() {
entry:
- store i8 1, i8* @deallocCalled, align 1
- ret i8* null
+ store i8 1, ptr @deallocCalled, align 1
+ ret ptr null
}
; CHECK-LABEL: @main()
define dso_local i32 @main() {
entry:
- %tmp0 = call i8* @llvm.stacksave() #1
- %tmp6 = load i8, i8* @deallocCalled, align 1
+ %tmp0 = call ptr @llvm.stacksave() #1
+ %tmp6 = load i8, ptr @deallocCalled, align 1
%tobool = icmp ne i8 %tmp6, 0
br i1 %tobool, label %if.else, label %if.end
@@ -25,10 +25,10 @@ if.else: ; preds = %entry
; CHECK-LABEL: if.end:
; CHECK-NEXT: call void @llvm.stackrestore
-; CHECK-NOT: load i8, i8* @deallocCalled
+; CHECK-NOT: load i8, ptr @deallocCalled
if.end: ; preds = %entry
- call void @llvm.stackrestore(i8* %tmp0)
- %tmp7 = load i8, i8* @deallocCalled, align 1
+ call void @llvm.stackrestore(ptr %tmp0)
+ %tmp7 = load i8, ptr @deallocCalled, align 1
%tobool3 = icmp ne i8 %tmp7, 0
br i1 %tobool3, label %if.end6, label %if.else5
@@ -37,12 +37,12 @@ if.else5: ; preds = %if.end
unreachable
if.end6: ; preds = %if.end
- store i8 0, i8* @deallocCalled, align 1
+ store i8 0, ptr @deallocCalled, align 1
ret i32 0
}
-declare i8* @llvm.stacksave() #1
-declare void @llvm.stackrestore(i8*) #1
+declare ptr @llvm.stacksave() #1
+declare void @llvm.stackrestore(ptr) #1
declare dso_local void @__assert_fail() #0
attributes #0 = { noreturn nosync nounwind }
diff --git a/llvm/test/Analysis/GlobalsModRef/intrinsic_addresstaken.ll b/llvm/test/Analysis/GlobalsModRef/intrinsic_addresstaken.ll
index 40ca37e459269..1a0b4c6696276 100644
--- a/llvm/test/Analysis/GlobalsModRef/intrinsic_addresstaken.ll
+++ b/llvm/test/Analysis/GlobalsModRef/intrinsic_addresstaken.ll
@@ -4,22 +4,22 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
target triple = "x86_64-unknown-linux-gnu"
@deallocCalled = internal global i8 0, align 1
- at .objc_method_list = internal global { i8* ()* } { i8* ()* @_i_Associated__dealloc }, align 8
- at ._OBJC_CLASS_Associated = global { i8* } { i8* bitcast ({ i8* ()* }* @.objc_method_list to i8*) }, align 8
- at ._OBJC_INIT_CLASS_Associated = global { i8* }* @._OBJC_CLASS_Associated
- at llvm.used = appending global [1 x i8*] [i8* bitcast ({ i8* }** @._OBJC_INIT_CLASS_Associated to i8*)]
+ at .objc_method_list = internal global { ptr } { ptr @_i_Associated__dealloc }, align 8
+ at ._OBJC_CLASS_Associated = global { ptr } { ptr @.objc_method_list }, align 8
+ at ._OBJC_INIT_CLASS_Associated = global ptr @._OBJC_CLASS_Associated
+ at llvm.used = appending global [1 x ptr] [ptr @._OBJC_INIT_CLASS_Associated]
-define internal i8* @_i_Associated__dealloc() {
+define internal ptr @_i_Associated__dealloc() {
entry:
- store i8 1, i8* @deallocCalled, align 1
- ret i8* null
+ store i8 1, ptr @deallocCalled, align 1
+ ret ptr null
}
; CHECK-LABEL: @main()
define dso_local i32 @main() {
entry:
- %tmp0 = call i8* @llvm.stacksave() #1
- %tmp6 = load i8, i8* @deallocCalled, align 1
+ %tmp0 = call ptr @llvm.stacksave() #1
+ %tmp6 = load i8, ptr @deallocCalled, align 1
%tobool = icmp ne i8 %tmp6, 0
br i1 %tobool, label %if.else, label %if.end
@@ -30,8 +30,8 @@ if.else: ; preds = %entry
; CHECK-LABEL: if.end:
; CHECK-NEXT: call void @llvm.stackrestore
if.end: ; preds = %entry
- call void @llvm.stackrestore(i8* %tmp0)
- %tmp7 = load i8, i8* @deallocCalled, align 1
+ call void @llvm.stackrestore(ptr %tmp0)
+ %tmp7 = load i8, ptr @deallocCalled, align 1
%tobool3 = icmp ne i8 %tmp7, 0
br i1 %tobool3, label %if.end6, label %if.else5
@@ -40,12 +40,12 @@ if.else5: ; preds = %if.end
unreachable
if.end6: ; preds = %if.end
- store i8 0, i8* @deallocCalled, align 1
+ store i8 0, ptr @deallocCalled, align 1
ret i32 0
}
-declare i8* @llvm.stacksave() #1
-declare void @llvm.stackrestore(i8*) #1
+declare ptr @llvm.stacksave() #1
+declare void @llvm.stackrestore(ptr) #1
declare dso_local void @__assert_fail() #0
attributes #0 = { noreturn nounwind }
diff --git a/llvm/test/Analysis/GlobalsModRef/memset-escape.ll b/llvm/test/Analysis/GlobalsModRef/memset-escape.ll
index b3b902b3dfb3f..a84987c3bc695 100644
--- a/llvm/test/Analysis/GlobalsModRef/memset-escape.ll
+++ b/llvm/test/Analysis/GlobalsModRef/memset-escape.ll
@@ -10,9 +10,9 @@ target triple = "x86_64-apple-macosx10.10.0"
; @a after the memset.
; CHECK-LABEL: @main
-; CHECK: call void @llvm.memset.p0i8.i64{{.*}} @a
+; CHECK: call void @llvm.memset.p0.i64{{.*}} @a
; CHECK: store i32 3
-; CHECK: load i32, i32* getelementptr {{.*}} @a
+; CHECK: load i32, ptr getelementptr {{.*}} @a
; CHECK: icmp eq i32
; CHECK: br i1
@@ -20,34 +20,33 @@ define i32 @main() {
entry:
%retval = alloca i32, align 4
%c = alloca [1 x i32], align 4
- store i32 0, i32* %retval, align 4
- %0 = bitcast [1 x i32]* %c to i8*
- call void @llvm.memset.p0i8.i64(i8* align 4 %0, i8 0, i64 4, i1 false)
- store i32 1, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @a, i64 0, i64 2), align 4
- store i32 0, i32* @b, align 4
+ store i32 0, ptr %retval, align 4
+ call void @llvm.memset.p0.i64(ptr align 4 %c, i8 0, i64 4, i1 false)
+ store i32 1, ptr getelementptr inbounds ([3 x i32], ptr @a, i64 0, i64 2), align 4
+ store i32 0, ptr @b, align 4
br label %for.cond
for.cond: ; preds = %for.inc, %entry
- %1 = load i32, i32* @b, align 4
- %cmp = icmp slt i32 %1, 3
+ %0 = load i32, ptr @b, align 4
+ %cmp = icmp slt i32 %0, 3
br i1 %cmp, label %for.body, label %for.end
for.body: ; preds = %for.cond
- %2 = load i32, i32* @b, align 4
- %idxprom = sext i32 %2 to i64
- %arrayidx = getelementptr inbounds [3 x i32], [3 x i32]* @a, i64 0, i64 %idxprom
- store i32 0, i32* %arrayidx, align 4
+ %1 = load i32, ptr @b, align 4
+ %idxprom = sext i32 %1 to i64
+ %arrayidx = getelementptr inbounds [3 x i32], ptr @a, i64 0, i64 %idxprom
+ store i32 0, ptr %arrayidx, align 4
br label %for.inc
for.inc: ; preds = %for.body
- %3 = load i32, i32* @b, align 4
- %inc = add nsw i32 %3, 1
- store i32 %inc, i32* @b, align 4
+ %2 = load i32, ptr @b, align 4
+ %inc = add nsw i32 %2, 1
+ store i32 %inc, ptr @b, align 4
br label %for.cond
for.end: ; preds = %for.cond
- %4 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @a, i64 0, i64 2), align 4
- %cmp1 = icmp ne i32 %4, 0
+ %3 = load i32, ptr getelementptr inbounds ([3 x i32], ptr @a, i64 0, i64 2), align 4
+ %cmp1 = icmp ne i32 %3, 0
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %for.end
@@ -59,7 +58,7 @@ if.end: ; preds = %for.end
}
; Function Attrs: nounwind argmemonly
-declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind argmemonly
+declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) nounwind argmemonly
; Function Attrs: noreturn nounwind
declare void @abort() noreturn nounwind
diff --git a/llvm/test/Analysis/GlobalsModRef/modreftest.ll b/llvm/test/Analysis/GlobalsModRef/modreftest.ll
index e2eec172763c8..908a6a05842cd 100644
--- a/llvm/test/Analysis/GlobalsModRef/modreftest.ll
+++ b/llvm/test/Analysis/GlobalsModRef/modreftest.ll
@@ -1,15 +1,15 @@
; RUN: opt < %s -aa-pipeline=basic-aa,globals-aa -passes='require<globals-aa>,gvn' -S | FileCheck %s
- at X = internal global i32 4 ; <i32*> [#uses=2]
+ at X = internal global i32 4 ; <ptr> [#uses=2]
-define i32 @test(i32* %P) {
+define i32 @test(ptr %P) {
; CHECK: @test
-; CHECK-NEXT: store i32 12, i32* @X
+; CHECK-NEXT: store i32 12, ptr @X
; CHECK-NEXT: call void @doesnotmodX()
; CHECK-NEXT: ret i32 12
- store i32 12, i32* @X
+ store i32 12, ptr @X
call void @doesnotmodX( )
- %V = load i32, i32* @X ; <i32> [#uses=1]
+ %V = load i32, ptr @X ; <i32> [#uses=1]
ret i32 %V
}
diff --git a/llvm/test/Analysis/GlobalsModRef/no-escape.ll b/llvm/test/Analysis/GlobalsModRef/no-escape.ll
index d129e9fc36111..1b70acbf7c71e 100644
--- a/llvm/test/Analysis/GlobalsModRef/no-escape.ll
+++ b/llvm/test/Analysis/GlobalsModRef/no-escape.ll
@@ -6,19 +6,19 @@ target triple = "x86_64-apple-macosx10.10.0"
@b = common global i32 0, align 4
@c = internal global i32 0, align 4
@d = common global i32 0, align 4
- at e = common global i32* null, align 4
+ at e = common global ptr null, align 4
-define void @foo(i32* %P) noinline {
+define void @foo(ptr %P) noinline {
; CHECK: define void @foo
- %loadp = load i32, i32* %P, align 4
- store i32 %loadp, i32* @d, align 4
+ %loadp = load i32, ptr %P, align 4
+ store i32 %loadp, ptr @d, align 4
ret void
}
define void @bar() noinline {
; CHECK: define void @bar
- %loadp = load i32, i32* @d, align 4
- store i32 %loadp, i32* @c, align 4
+ %loadp = load i32, ptr @d, align 4
+ store i32 %loadp, ptr @c, align 4
ret void
}
@@ -26,32 +26,32 @@ define i32 @main() {
entry:
%retval = alloca i32, align 4
%c = alloca [1 x i32], align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
call void @bar()
- store i32 0, i32* @b, align 4
+ store i32 0, ptr @b, align 4
br label %for.cond
;; Check that @c is LICM'ed out.
-; CHECK: load i32, i32* @c
+; CHECK: load i32, ptr @c
for.cond: ; preds = %for.inc, %entry
; CHECK-LABEL: for.cond:
-; CHECK: load i32, i32* @b
- %a1 = load i32, i32* @b, align 4
- %aa2 = load i32, i32* @c, align 4
+; CHECK: load i32, ptr @b
+ %a1 = load i32, ptr @b, align 4
+ %aa2 = load i32, ptr @c, align 4
%add = add nsw i32 %a1, %aa2
- %p1 = load i32*, i32** @e, align 4
- call void @foo(i32* %p1)
+ %p1 = load ptr, ptr @e, align 4
+ call void @foo(ptr %p1)
%cmp = icmp slt i32 %add, 3
br i1 %cmp, label %for.body, label %for.end
for.body: ; preds = %for.cond
- %a2 = load i32, i32* @b, align 4
+ %a2 = load i32, ptr @b, align 4
%idxprom = sext i32 %a2 to i64
br label %for.inc
for.inc: ; preds = %for.body
- %a3 = load i32, i32* @b, align 4
+ %a3 = load i32, ptr @b, align 4
%inc = add nsw i32 %a3, 1
- store i32 %inc, i32* @b, align 4
+ store i32 %inc, ptr @b, align 4
br label %for.cond
for.end: ; preds = %for.cond
@@ -59,7 +59,7 @@ for.end: ; preds = %for.cond
}
; Function Attrs: nounwind argmemonly
-declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind argmemonly
+declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) nounwind argmemonly
; Function Attrs: noreturn nounwind
declare void @abort() noreturn nounwind
diff --git a/llvm/test/Analysis/GlobalsModRef/nonescaping-noalias.ll b/llvm/test/Analysis/GlobalsModRef/nonescaping-noalias.ll
index fe0435ad2fb40..d109b3b8748ba 100644
--- a/llvm/test/Analysis/GlobalsModRef/nonescaping-noalias.ll
+++ b/llvm/test/Analysis/GlobalsModRef/nonescaping-noalias.ll
@@ -7,22 +7,22 @@
@g1 = internal global i32 0
-define i32 @test1(i32* %param) {
+define i32 @test1(ptr %param) {
; Ensure that we can fold a store to a load of a global across a store to
; a parameter when the global is non-escaping.
;
; CHECK-LABEL: @test1(
-; CHECK: store i32 42, i32* @g1
+; CHECK: store i32 42, ptr @g1
; CHECK-NOT: load i32
; CHECK: ret i32 42
entry:
- store i32 42, i32* @g1
- store i32 7, i32* %param
- %v = load i32, i32* @g1
+ store i32 42, ptr @g1
+ store i32 7, ptr %param
+ %v = load i32, ptr @g1
ret i32 %v
}
-declare i32* @f()
+declare ptr @f()
define i32 @test2() {
; Ensure that we can fold a store to a load of a global across a store to
@@ -30,18 +30,18 @@ define i32 @test2() {
; this function cannot be returning its address.
;
; CHECK-LABEL: @test2(
-; CHECK: store i32 42, i32* @g1
+; CHECK: store i32 42, ptr @g1
; CHECK-NOT: load i32
; CHECK: ret i32 42
entry:
- %ptr = call i32* @f() readnone
- store i32 42, i32* @g1
- store i32 7, i32* %ptr
- %v = load i32, i32* @g1
+ %ptr = call ptr @f() readnone
+ store i32 42, ptr @g1
+ store i32 7, ptr %ptr
+ %v = load i32, ptr @g1
ret i32 %v
}
- at g2 = external global i32*
+ at g2 = external global ptr
define i32 @test3() {
; Ensure that we can fold a store to a load of a global across a store to
@@ -49,22 +49,22 @@ define i32 @test3() {
; cannot alias a pointer loaded out of a global.
;
; CHECK-LABEL: @test3(
-; CHECK: store i32 42, i32* @g1
-; CHECK: store i32 7, i32*
+; CHECK: store i32 42, ptr @g1
+; CHECK: store i32 7, ptr
; CHECK-NOT: load i32
; CHECK: ret i32 42
entry:
- store i32 42, i32* @g1
- %ptr1 = load i32*, i32** @g2
- store i32 7, i32* %ptr1
- %v = load i32, i32* @g1
+ store i32 42, ptr @g1
+ %ptr1 = load ptr, ptr @g2
+ store i32 7, ptr %ptr1
+ %v = load i32, ptr @g1
ret i32 %v
}
@g3 = internal global i32 1
- at g4 = internal global [10 x i32*] zeroinitializer
+ at g4 = internal global [10 x ptr] zeroinitializer
-define i32 @test4(i32* %param, i32 %n, i1 %c1, i1 %c2, i1 %c3) {
+define i32 @test4(ptr %param, i32 %n, i1 %c1, i1 %c2, i1 %c3) {
; Ensure that we can fold a store to a load of a global across a store to
; the pointer loaded from that global even when the load is behind PHIs and
; selects, and there is a mixture of a load and another global or argument.
@@ -72,45 +72,45 @@ define i32 @test4(i32* %param, i32 %n, i1 %c1, i1 %c2, i1 %c3) {
; GVN doesn't try to do real DCE. The store is still forwarded by GVN though.
;
; CHECK-LABEL: @test4(
-; CHECK: store i32 42, i32* @g1
-; CHECK: store i32 7, i32*
+; CHECK: store i32 42, ptr @g1
+; CHECK: store i32 7, ptr
; CHECK: ret i32 42
entry:
- %call = call i32* @f()
- store i32 42, i32* @g1
- %ptr1 = load i32*, i32** @g2
- %ptr2 = select i1 %c1, i32* %ptr1, i32* %param
- %ptr3 = select i1 %c3, i32* %ptr2, i32* @g3
+ %call = call ptr @f()
+ store i32 42, ptr @g1
+ %ptr1 = load ptr, ptr @g2
+ %ptr2 = select i1 %c1, ptr %ptr1, ptr %param
+ %ptr3 = select i1 %c3, ptr %ptr2, ptr @g3
br label %loop
loop:
%iv = phi i32 [ 0, %entry ], [ %inc, %loop ]
- %ptr = phi i32* [ %ptr3, %entry ], [ %ptr5, %loop ]
- store i32 7, i32* %ptr
- %ptr4 = load i32*, i32** getelementptr ([10 x i32*], [10 x i32*]* @g4, i32 0, i32 1)
- %ptr5 = select i1 %c2, i32* %ptr4, i32* %call
+ %ptr = phi ptr [ %ptr3, %entry ], [ %ptr5, %loop ]
+ store i32 7, ptr %ptr
+ %ptr4 = load ptr, ptr getelementptr ([10 x ptr], ptr @g4, i32 0, i32 1)
+ %ptr5 = select i1 %c2, ptr %ptr4, ptr %call
%inc = add i32 %iv, 1
%test = icmp slt i32 %inc, %n
br i1 %test, label %loop, label %exit
exit:
- %v = load i32, i32* @g1
+ %v = load i32, ptr @g1
ret i32 %v
}
-define i32 @test5(i32** %param) {
+define i32 @test5(ptr %param) {
; Ensure that we can fold a store to a load of a global across a store to
; a parameter that has been dereferenced when the global is non-escaping.
;
; CHECK-LABEL: @test5(
-; CHECK: %p = load i32*
-; CHECK: store i32 42, i32* @g1
+; CHECK: %p = load ptr
+; CHECK: store i32 42, ptr @g1
; CHECK-NOT: load i32
; CHECK: ret i32 42
entry:
- %p = load i32*, i32** %param
- store i32 42, i32* @g1
- store i32 7, i32* %p
- %v = load i32, i32* @g1
+ %p = load ptr, ptr %param
+ store i32 42, ptr @g1
+ store i32 7, ptr %p
+ %v = load i32, ptr @g1
ret i32 %v
}
diff --git a/llvm/test/Analysis/GlobalsModRef/pr12351.ll b/llvm/test/Analysis/GlobalsModRef/pr12351.ll
index b1720b8fbeb89..c76312dcb7425 100644
--- a/llvm/test/Analysis/GlobalsModRef/pr12351.ll
+++ b/llvm/test/Analysis/GlobalsModRef/pr12351.ll
@@ -1,31 +1,31 @@
; RUN: opt < %s -aa-pipeline=basic-aa,globals-aa -passes=gvn -S -disable-verify | FileCheck %s
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1)
-define void @foo(i8* %x, i8* %y) {
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x, i8* %y, i32 1, i1 false);
+declare void @llvm.memcpy.p0.p0.i32(ptr, ptr, i32, i1)
+define void @foo(ptr %x, ptr %y) {
+ call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 1, i1 false);
ret void
}
-define void @bar(i8* %y, i8* %z) {
+define void @bar(ptr %y, ptr %z) {
%x = alloca i8
- call void @foo(i8* %x, i8* %y)
- %t = load i8, i8* %x
- store i8 %t, i8* %y
-; CHECK: store i8 %t, i8* %y
+ call void @foo(ptr %x, ptr %y)
+ %t = load i8, ptr %x
+ store i8 %t, ptr %y
+; CHECK: store i8 %t, ptr %y
ret void
}
define i32 @foo2() {
%foo = alloca i32
- call void @bar2(i32* %foo)
- %t0 = load i32, i32* %foo, align 4
-; CHECK: %t0 = load i32, i32* %foo, align 4
+ call void @bar2(ptr %foo)
+ %t0 = load i32, ptr %foo, align 4
+; CHECK: %t0 = load i32, ptr %foo, align 4
ret i32 %t0
}
-define void @bar2(i32* %foo) {
- store i32 0, i32* %foo, align 4
+define void @bar2(ptr %foo) {
+ store i32 0, ptr %foo, align 4
tail call void @llvm.dbg.value(metadata !{}, i64 0, metadata !{}, metadata !{})
ret void
}
diff --git a/llvm/test/Analysis/GlobalsModRef/pr25309.ll b/llvm/test/Analysis/GlobalsModRef/pr25309.ll
index c7f2f8c9128af..ddd99995d852e 100644
--- a/llvm/test/Analysis/GlobalsModRef/pr25309.ll
+++ b/llvm/test/Analysis/GlobalsModRef/pr25309.ll
@@ -5,21 +5,21 @@ target triple = "x86_64-unknown-linux-gnu"
; @o and @m are initialized to @i, so they should not be classed as
; indirect globals referring only to allocation functions.
- at o = internal global i32* @i, align 8
- at m = internal global i32* @i, align 8
+ at o = internal global ptr @i, align 8
+ at m = internal global ptr @i, align 8
@i = internal global i32 0, align 4
; CHECK-LABEL: @f
define i1 @f() {
entry:
- %0 = load i32*, i32** @o, align 8
- store i32 0, i32* %0, align 4
- %1 = load volatile i32*, i32** @m, align 8
- store i32 1, i32* %1, align 4
- ; CHECK: %[[a:.*]] = load i32*
- %2 = load i32*, i32** @o, align 8
- ; CHECK: %[[b:.*]] = load i32, i32* %[[a]]
- %3 = load i32, i32* %2, align 4
+ %0 = load ptr, ptr @o, align 8
+ store i32 0, ptr %0, align 4
+ %1 = load volatile ptr, ptr @m, align 8
+ store i32 1, ptr %1, align 4
+ ; CHECK: %[[a:.*]] = load ptr
+ %2 = load ptr, ptr @o, align 8
+ ; CHECK: %[[b:.*]] = load i32, ptr %[[a]]
+ %3 = load i32, ptr %2, align 4
; CHECK: %[[c:.*]] = icmp ne i32 %[[b]], 0
%tobool.i = icmp ne i32 %3, 0
; CHECK: ret i1 %[[c]]
diff --git a/llvm/test/Analysis/GlobalsModRef/pr35899-dbg-value.ll b/llvm/test/Analysis/GlobalsModRef/pr35899-dbg-value.ll
index d9ce2190346be..925a1df9ead85 100644
--- a/llvm/test/Analysis/GlobalsModRef/pr35899-dbg-value.ll
+++ b/llvm/test/Analysis/GlobalsModRef/pr35899-dbg-value.ll
@@ -13,9 +13,9 @@ define void @bar(i8 %p) {
declare void @gaz(i8 %p)
define void @foo() {
- store i8 42, i8* @g, align 1
+ store i8 42, ptr @g, align 1
call void @bar(i8 1)
- %_tmp = load i8, i8* @g, align 1
+ %_tmp = load i8, ptr @g, align 1
call void @gaz(i8 %_tmp)
ret void
}
@@ -50,7 +50,7 @@ attributes #0 = { nounwind readnone speculatable }
; gaz regardless of the dbg.value in bar.
; CHECK: define void @foo() {
-; CHECK-NEXT: store i8 42, i8* @g, align 1
+; CHECK-NEXT: store i8 42, ptr @g, align 1
; CHECK-NEXT: call void @bar(i8 1)
; CHECK-NEXT: call void @gaz(i8 42)
; CHECK-NEXT: ret void
diff --git a/llvm/test/Analysis/GlobalsModRef/purecse.ll b/llvm/test/Analysis/GlobalsModRef/purecse.ll
index de30af84173aa..78f7f163657a2 100644
--- a/llvm/test/Analysis/GlobalsModRef/purecse.ll
+++ b/llvm/test/Analysis/GlobalsModRef/purecse.ll
@@ -15,12 +15,12 @@ define i32 @test1(i32 %X) {
ret i32 %C
}
-define i32 @test2(i32 %X, i32* %P) {
+define i32 @test2(i32 %X, ptr %P) {
; CHECK: %A = call i32 @pure(i32 %X)
-; CHECK-NEXT: store i32 %X, i32* %P
+; CHECK-NEXT: store i32 %X, ptr %P
; CHECK-NEXT: ret i32 0
%A = call i32 @pure( i32 %X ) ; <i32> [#uses=1]
- store i32 %X, i32* %P ;; Does not invalidate 'pure' call.
+ store i32 %X, ptr %P ;; Does not invalidate 'pure' call.
%B = call i32 @pure( i32 %X ) ; <i32> [#uses=1]
%C = sub i32 %A, %B ; <i32> [#uses=1]
ret i32 %C
diff --git a/llvm/test/Analysis/GlobalsModRef/volatile-instrs.ll b/llvm/test/Analysis/GlobalsModRef/volatile-instrs.ll
index 94ee17d06fe83..c502126fc3a42 100644
--- a/llvm/test/Analysis/GlobalsModRef/volatile-instrs.ll
+++ b/llvm/test/Analysis/GlobalsModRef/volatile-instrs.ll
@@ -9,22 +9,22 @@ target triple = "x86_64-apple-macosx10.8.0"
@a = common global %struct.anon zeroinitializer, align 4
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
-declare i32 @printf(i8* nocapture, ...) nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
+declare i32 @printf(ptr nocapture, ...) nounwind
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind
; Make sure that the initial memcpy call does not go away
; because the volatile load is in the way. PR12899
; CHECK: main_entry:
-; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64
+; CHECK-NEXT: tail call void @llvm.memcpy.p0.p0.i64
define i32 @main() nounwind uwtable ssp {
main_entry:
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 bitcast (%struct.anon* @b to i8*), i8* align 4 bitcast (%struct.anon* @a to i8*), i64 12, i1 false)
- %0 = load volatile i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @b, i64 0, i32 0), align 4
- store i32 %0, i32* @c, align 4
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 bitcast (%struct.anon* @b to i8*), i8* align 4 bitcast (%struct.anon* @a to i8*), i64 12, i1 false) nounwind
- %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0) nounwind
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 @b, ptr align 4 @a, i64 12, i1 false)
+ %0 = load volatile i32, ptr @b, align 4
+ store i32 %0, ptr @c, align 4
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 @b, ptr align 4 @a, i64 12, i1 false) nounwind
+ %call = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %0) nounwind
ret i32 0
}
diff --git a/llvm/test/Analysis/GlobalsModRef/weak-interposition.ll b/llvm/test/Analysis/GlobalsModRef/weak-interposition.ll
index 8e94d2b64943d..af5292537dc7b 100644
--- a/llvm/test/Analysis/GlobalsModRef/weak-interposition.ll
+++ b/llvm/test/Analysis/GlobalsModRef/weak-interposition.ll
@@ -13,12 +13,12 @@ define weak i32 @hook_me() {
; Function Attrs: nounwind ssp uwtable
define i32 @f() {
%1 = alloca i32, align 4
- store i32 4, i32* @a, align 4
+ store i32 4, ptr @a, align 4
%2 = call i32 @hook_me()
- ; CHECK: load i32, i32* @a, align 4
- %3 = load i32, i32* @a, align 4
+ ; CHECK: load i32, ptr @a, align 4
+ %3 = load i32, ptr @a, align 4
%4 = add nsw i32 %3, %2
- store i32 %4, i32* @a, align 4
- %5 = load i32, i32* %1
+ store i32 %4, ptr @a, align 4
+ %5 = load i32, ptr %1
ret i32 %5
}
More information about the llvm-commits
mailing list