[llvm] 38386b4 - [Tests] Convert Other tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 13 04:11:51 PST 2022
Author: Nikita Popov
Date: 2022-12-13T13:11:26+01:00
New Revision: 38386b4318e3ba54f450480ad49b237a9c357af4
URL: https://github.com/llvm/llvm-project/commit/38386b4318e3ba54f450480ad49b237a9c357af4
DIFF: https://github.com/llvm/llvm-project/commit/38386b4318e3ba54f450480ad49b237a9c357af4.diff
LOG: [Tests] Convert Other tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/Other/2002-01-31-CallGraph.ll
llvm/test/Other/2004-08-16-PackedConstantInlineStore.ll
llvm/test/Other/2004-08-16-PackedGlobalConstant.ll
llvm/test/Other/2004-08-16-PackedSelect.ll
llvm/test/Other/2004-08-16-PackedSimple.ll
llvm/test/Other/2004-08-20-PackedControlFlow.ll
llvm/test/Other/2007-09-10-PassManager.ll
llvm/test/Other/2008-06-04-FieldSizeInPacked.ll
llvm/test/Other/2008-10-15-MissingSpace.ll
llvm/test/Other/available-externally-lto.ll
llvm/test/Other/cfg_deopt_unreach.ll
llvm/test/Other/cgscc-devirt-iteration.ll
llvm/test/Other/cgscc-disconnected-invalidation.ll
llvm/test/Other/cgscc-iterate-function-mutation.ll
llvm/test/Other/cgscc-libcall-update.ll
llvm/test/Other/cgscc-observe-devirt.ll
llvm/test/Other/cgscc-refscc-mutation-order.ll
llvm/test/Other/codegenprepare-and-debug.ll
llvm/test/Other/constant-fold-gep-address-spaces.ll
llvm/test/Other/constant-fold-gep.ll
llvm/test/Other/devirtualization-undef.ll
llvm/test/Other/force-opaque-ptrs.ll
llvm/test/Other/invariant.group.ll
llvm/test/Other/lint.ll
llvm/test/Other/llvm-nm-without-aliases.ll
llvm/test/Other/loop-pass-printer.ll
llvm/test/Other/loop-pm-invalidation.ll
llvm/test/Other/machine-size-remarks.ll
llvm/test/Other/mixed-opaque-ptrs-2.ll
llvm/test/Other/new-pass-manager-verify-each.ll
llvm/test/Other/new-pass-manager.ll
llvm/test/Other/new-pm-pr42726-cgscc.ll
llvm/test/Other/new-pm-thinlto-prelink-samplepgo-inline-threshold.ll
llvm/test/Other/new-pm-time-trace.ll
llvm/test/Other/no-rerun-function-simplification-pipeline.ll
llvm/test/Other/opt-bisect-new-pass-manager.ll
llvm/test/Other/opt-pipeline-vector-passes.ll
llvm/test/Other/optimization-remarks-inline.ll
llvm/test/Other/optimization-remarks-invalidation.ll
llvm/test/Other/optimization-remarks-lazy-bfi.ll
llvm/test/Other/optimize-inrange-gep.ll
llvm/test/Other/pr32085.ll
llvm/test/Other/print-on-crash.ll
llvm/test/Other/scalable-vectors-core-ir.ll
llvm/test/Other/unroll-sroa.ll
Removed:
################################################################################
diff --git a/llvm/test/Other/2002-01-31-CallGraph.ll b/llvm/test/Other/2002-01-31-CallGraph.ll
index b2922f8c86c2c..d39e85a04895a 100644
--- a/llvm/test/Other/2002-01-31-CallGraph.ll
+++ b/llvm/test/Other/2002-01-31-CallGraph.ll
@@ -5,7 +5,7 @@
%FunTy = type i32 (i32)
-define void @invoke(%FunTy* %x) {
+define void @invoke(ptr %x) {
%foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
ret void
}
diff --git a/llvm/test/Other/2004-08-16-PackedConstantInlineStore.ll b/llvm/test/Other/2004-08-16-PackedConstantInlineStore.ll
index 36ac4fd5af445..f26f1d81a2667 100644
--- a/llvm/test/Other/2004-08-16-PackedConstantInlineStore.ll
+++ b/llvm/test/Other/2004-08-16-PackedConstantInlineStore.ll
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | llvm-dis
- at bar = external global <2 x i32> ; <<2 x i32>*> [#uses=1]
+ at bar = external global <2 x i32> ; <ptr> [#uses=1]
define void @main() {
- store <2 x i32> < i32 0, i32 1 >, <2 x i32>* @bar
+ store <2 x i32> < i32 0, i32 1 >, ptr @bar
ret void
}
diff --git a/llvm/test/Other/2004-08-16-PackedGlobalConstant.ll b/llvm/test/Other/2004-08-16-PackedGlobalConstant.ll
index 4f15c9ef42738..169a67c0a6bb7 100644
--- a/llvm/test/Other/2004-08-16-PackedGlobalConstant.ll
+++ b/llvm/test/Other/2004-08-16-PackedGlobalConstant.ll
@@ -1,11 +1,11 @@
; RUN: llvm-as < %s | llvm-dis
- at foo = global <2 x i32> < i32 0, i32 1 > ; <<2 x i32>*> [#uses=1]
- at bar = external global <2 x i32> ; <<2 x i32>*> [#uses=1]
+ at foo = global <2 x i32> < i32 0, i32 1 > ; <ptr> [#uses=1]
+ at bar = external global <2 x i32> ; <ptr> [#uses=1]
define void @main() {
- %t0 = load <2 x i32>, <2 x i32>* @foo ; <<2 x i32>> [#uses=1]
- store <2 x i32> %t0, <2 x i32>* @bar
+ %t0 = load <2 x i32>, ptr @foo ; <<2 x i32>> [#uses=1]
+ store <2 x i32> %t0, ptr @bar
ret void
}
diff --git a/llvm/test/Other/2004-08-16-PackedSelect.ll b/llvm/test/Other/2004-08-16-PackedSelect.ll
index 1d0e7aab3009c..d398c63792433 100644
--- a/llvm/test/Other/2004-08-16-PackedSelect.ll
+++ b/llvm/test/Other/2004-08-16-PackedSelect.ll
@@ -1,13 +1,13 @@
; RUN: llvm-as < %s | llvm-dis
- at foo = external global <4 x float> ; <<4 x float>*> [#uses=1]
- at bar = external global <4 x float> ; <<4 x float>*> [#uses=1]
+ at foo = external global <4 x float> ; <ptr> [#uses=1]
+ at bar = external global <4 x float> ; <ptr> [#uses=1]
define void @main() {
- %t0 = load <4 x float>, <4 x float>* @foo ; <<4 x float>> [#uses=3]
+ %t0 = load <4 x float>, ptr @foo ; <<4 x float>> [#uses=3]
%t1 = fadd <4 x float> %t0, %t0 ; <<4 x float>> [#uses=1]
%t2 = select i1 true, <4 x float> %t0, <4 x float> %t1 ; <<4 x float>> [#uses=1]
- store <4 x float> %t2, <4 x float>* @bar
+ store <4 x float> %t2, ptr @bar
ret void
}
diff --git a/llvm/test/Other/2004-08-16-PackedSimple.ll b/llvm/test/Other/2004-08-16-PackedSimple.ll
index 3923c9648ecf3..688f88294615b 100644
--- a/llvm/test/Other/2004-08-16-PackedSimple.ll
+++ b/llvm/test/Other/2004-08-16-PackedSimple.ll
@@ -1,13 +1,13 @@
; RUN: llvm-as < %s | llvm-dis
- at foo = external global <4 x float> ; <<4 x float>*> [#uses=1]
- at bar = external global <4 x float> ; <<4 x float>*> [#uses=1]
+ at foo = external global <4 x float> ; <ptr> [#uses=1]
+ at bar = external global <4 x float> ; <ptr> [#uses=1]
define void @main() {
- %t0 = load <4 x float>, <4 x float>* @foo ; <<4 x float>> [#uses=3]
+ %t0 = load <4 x float>, ptr @foo ; <<4 x float>> [#uses=3]
%t2 = fadd <4 x float> %t0, %t0 ; <<4 x float>> [#uses=1]
%t3 = select i1 false, <4 x float> %t0, <4 x float> %t2 ; <<4 x float>> [#uses=1]
- store <4 x float> %t3, <4 x float>* @bar
+ store <4 x float> %t3, ptr @bar
ret void
}
diff --git a/llvm/test/Other/2004-08-20-PackedControlFlow.ll b/llvm/test/Other/2004-08-20-PackedControlFlow.ll
index 64da59d13b2b3..bd70731eb7f32 100644
--- a/llvm/test/Other/2004-08-20-PackedControlFlow.ll
+++ b/llvm/test/Other/2004-08-20-PackedControlFlow.ll
@@ -1,14 +1,14 @@
; RUN: llvm-as < %s | llvm-dis | llvm-as > /dev/null
%v4f = type <4 x float>
- at foo = external global %v4f ; <%v4f*> [#uses=1]
- at bar = external global %v4f ; <%v4f*> [#uses=1]
+ at foo = external global %v4f ; <ptr> [#uses=1]
+ at bar = external global %v4f ; <ptr> [#uses=1]
define void @main() {
br label %A
C: ; preds = %B
- store %v4f %t2, %v4f* @bar
+ store %v4f %t2, ptr @bar
ret void
B: ; preds = %A
@@ -16,7 +16,7 @@ B: ; preds = %A
br label %C
A: ; preds = %0
- %t0 = load %v4f, %v4f* @foo ; <%v4f> [#uses=2]
+ %t0 = load %v4f, ptr @foo ; <%v4f> [#uses=2]
br label %B
}
diff --git a/llvm/test/Other/2007-09-10-PassManager.ll b/llvm/test/Other/2007-09-10-PassManager.ll
index bff11ee56e0cc..3209c2697499a 100644
--- a/llvm/test/Other/2007-09-10-PassManager.ll
+++ b/llvm/test/Other/2007-09-10-PassManager.ll
@@ -2,21 +2,21 @@
; Require SCEV before LCSSA.
define void @foo() {
entry:
- %i = alloca i32, align 4 ; <i32*> [#uses=5]
+ %i = alloca i32, align 4 ; <ptr> [#uses=5]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 0, i32* %i, align 4
+ store i32 0, ptr %i, align 4
br label %bb3
bb: ; preds = %bb3
- %tmp = load i32, i32* %i, align 4 ; <i32> [#uses=1]
+ %tmp = load i32, ptr %i, align 4 ; <i32> [#uses=1]
call void @bar( i32 %tmp )
- %tmp1 = load i32, i32* %i, align 4 ; <i32> [#uses=1]
+ %tmp1 = load i32, ptr %i, align 4 ; <i32> [#uses=1]
%tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1]
- store i32 %tmp2, i32* %i, align 4
+ store i32 %tmp2, ptr %i, align 4
br label %bb3
bb3: ; preds = %bb, %entry
- %tmp4 = load i32, i32* %i, align 4 ; <i32> [#uses=1]
+ %tmp4 = load i32, ptr %i, align 4 ; <i32> [#uses=1]
%tmp5 = icmp sle i32 %tmp4, 9 ; <i1> [#uses=1]
%tmp56 = zext i1 %tmp5 to i8 ; <i8> [#uses=1]
%toBool = icmp ne i8 %tmp56, 0 ; <i1> [#uses=1]
diff --git a/llvm/test/Other/2008-06-04-FieldSizeInPacked.ll b/llvm/test/Other/2008-06-04-FieldSizeInPacked.ll
index 735cc2e77416c..df99c2ffae192 100644
--- a/llvm/test/Other/2008-06-04-FieldSizeInPacked.ll
+++ b/llvm/test/Other/2008-06-04-FieldSizeInPacked.ll
@@ -7,8 +7,8 @@ target triple = "x86_64-unknown-linux-gnu"
define i1 @q() nounwind {
entry:
- %char_p = getelementptr %packed, %packed* null, i32 0, i32 1 ; <i8*> [#uses=1]
- %char_u = getelementptr %unpacked, %unpacked* null, i32 0, i32 1 ; <i8*> [#uses=1]
- %res = icmp eq i8* %char_p, %char_u ; <i1> [#uses=1]
+ %char_p = getelementptr %packed, ptr null, i32 0, i32 1 ; <ptr> [#uses=1]
+ %char_u = getelementptr %unpacked, ptr null, i32 0, i32 1 ; <ptr> [#uses=1]
+ %res = icmp eq ptr %char_p, %char_u ; <i1> [#uses=1]
ret i1 %res
}
diff --git a/llvm/test/Other/2008-10-15-MissingSpace.ll b/llvm/test/Other/2008-10-15-MissingSpace.ll
index 37b3f0cb94da7..5169f0bedd233 100644
--- a/llvm/test/Other/2008-10-15-MissingSpace.ll
+++ b/llvm/test/Other/2008-10-15-MissingSpace.ll
@@ -1,14 +1,14 @@
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
; PR2894
declare void @g()
-define void @f() personality i32 (...)* @__gxx_personality_v0 {
+define void @f() personality ptr @__gxx_personality_v0 {
; CHECK: invoke void @g()
; CHECK: to label %d unwind label %c
invoke void @g() to label %d unwind label %c
d:
ret void
c:
- %exn = landingpad {i8*, i32}
+ %exn = landingpad {ptr, i32}
cleanup
ret void
}
diff --git a/llvm/test/Other/available-externally-lto.ll b/llvm/test/Other/available-externally-lto.ll
index e7f5e0e0ec220..e8b19f5dbc91f 100644
--- a/llvm/test/Other/available-externally-lto.ll
+++ b/llvm/test/Other/available-externally-lto.ll
@@ -16,7 +16,7 @@ entry:
; LTO: define available_externally void @f0(i32 %y)
define available_externally void @f0(i32 %y) local_unnamed_addr #0 {
entry:
- store i32 %y, i32* @x, align 4
+ store i32 %y, ptr @x, align 4
ret void
}
diff --git a/llvm/test/Other/cfg_deopt_unreach.ll b/llvm/test/Other/cfg_deopt_unreach.ll
index d001b7f459348..94895d7950c83 100644
--- a/llvm/test/Other/cfg_deopt_unreach.ll
+++ b/llvm/test/Other/cfg_deopt_unreach.ll
@@ -11,8 +11,8 @@
declare i8 @llvm.experimental.deoptimize.i8(...)
-define i8 @callee(i1* %c) alwaysinline {
- %c0 = load volatile i1, i1* %c
+define i8 @callee(ptr %c) alwaysinline {
+ %c0 = load volatile i1, ptr %c
br i1 %c0, label %lleft, label %lright
; NO-FLAGS: label="{lleft: \l %v0 = call i8 (...) @llvm.experimental.deoptimize.i8(i32 1) [ \"deopt\"(i32 1)\l... ]\l ret i8 %v0\l}"
; DEOPT-NOT: label="{lleft: \l %v0 = call i8 (...) @llvm.experimental.deoptimize.i8(i32 1) [ \"deopt\"(i32 1)\l... ]\l ret i8 %v0\l}"
diff --git a/llvm/test/Other/cgscc-devirt-iteration.ll b/llvm/test/Other/cgscc-devirt-iteration.ll
index 93056e962bd82..54229461cb394 100644
--- a/llvm/test/Other/cgscc-devirt-iteration.ll
+++ b/llvm/test/Other/cgscc-devirt-iteration.ll
@@ -31,9 +31,9 @@ define void @test1() {
; AFTER: Function Attrs: nofree nosync memory(none)
; CHECK-LABEL: define void @test1()
entry:
- %fptr = alloca void ()*
- store void ()* @readnone, void ()** %fptr
- %f = load void ()*, void ()** %fptr
+ %fptr = alloca ptr
+ store ptr @readnone, ptr %fptr
+ %f = load ptr, ptr %fptr
call void %f()
ret void
}
@@ -50,24 +50,24 @@ entry:
; to make that possible. This forces us to first deduce readonly, then
; devirtualize again, and then deduce readnone.
-declare void @readnone_with_arg(void ()**) readnone
+declare void @readnone_with_arg(ptr) readnone
; CHECK: Function Attrs: nofree nosync memory(none)
-; CHECK-LABEL: declare void @readnone_with_arg(void ()**)
+; CHECK-LABEL: declare void @readnone_with_arg(ptr)
-define void @test2_a(void ()** %ignore) {
+define void @test2_a(ptr %ignore) {
; BEFORE-NOT: Function Attrs
; AFTER1: Function Attrs: nofree memory(read)
; AFTER2: Function Attrs: nofree nosync memory(none)
-; BEFORE: define void @test2_a(void ()** %ignore)
-; AFTER: define void @test2_a(void ()** readnone %ignore)
+; BEFORE: define void @test2_a(ptr %ignore)
+; AFTER: define void @test2_a(ptr readnone %ignore)
entry:
- %f1ptr = alloca void (void ()**)*
- store void (void ()**)* @readnone_with_arg, void (void ()**)** %f1ptr
- %f1 = load void (void ()**)*, void (void ()**)** %f1ptr
+ %f1ptr = alloca ptr
+ store ptr @readnone_with_arg, ptr %f1ptr
+ %f1 = load ptr, ptr %f1ptr
; This indirect call is the first to be resolved, allowing us to deduce
; readonly but not (yet) readnone.
- call void %f1(void ()** %ignore)
-; CHECK: call void @readnone_with_arg(void ()** %ignore)
+ call void %f1(ptr %ignore)
+; CHECK: call void @readnone_with_arg(ptr %ignore)
; Bogus call to test2_b to make this a cycle.
call void @test2_b()
@@ -81,13 +81,13 @@ define void @test2_b() {
; AFTER2: Function Attrs: nofree nosync memory(none)
; CHECK-LABEL: define void @test2_b()
entry:
- %f2ptr = alloca void ()*
- store void ()* @readnone, void ()** %f2ptr
+ %f2ptr = alloca ptr
+ store ptr @readnone, ptr %f2ptr
; Call the other function here to prevent forwarding until the SCC has had
; function attrs deduced.
- call void @test2_a(void ()** %f2ptr)
+ call void @test2_a(ptr %f2ptr)
- %f2 = load void ()*, void ()** %f2ptr
+ %f2 = load ptr, ptr %f2ptr
; This is the second indirect call to be resolved, and can only be resolved
; after we deduce 'readonly' for the rest of the SCC. Once it is
; devirtualized, we can deduce readnone for the SCC.
@@ -98,8 +98,8 @@ entry:
ret void
}
-declare i8* @memcpy(i8*, i8*, i64)
-; CHECK-LABEL: i8* @memcpy(
+declare ptr @memcpy(ptr, ptr, i64)
+; CHECK-LABEL: ptr @memcpy(
; The @test3 function checks that when we refine an indirect call to an
; intrinsic we still revisit the SCC pass. This also covers cases where the
@@ -107,28 +107,28 @@ declare i8* @memcpy(i8*, i8*, i64)
; creates the memcpy intrinsic call, and we rely on the count of indirect calls
; decreasing and the count of direct calls increasing.
; Adding 'noinline' attribute to force attributes for improved matching.
-define void @test3(i8* %src, i8* %dest, i64 %size) noinline {
+define void @test3(ptr %src, ptr %dest, i64 %size) noinline {
; CHECK: Function Attrs
; CHECK-NOT: read
; CHECK-SAME: noinline
-; BEFORE-LABEL: define void @test3(i8* %src, i8* %dest, i64 %size)
-; AFTER-LABEL: define void @test3(i8* nocapture readonly %src, i8* nocapture writeonly %dest, i64 %size)
- %fptr = alloca i8* (i8*, i8*, i64)*
- store i8* (i8*, i8*, i64)* @memcpy, i8* (i8*, i8*, i64)** %fptr
- %f = load i8* (i8*, i8*, i64)*, i8* (i8*, i8*, i64)** %fptr
- call i8* %f(i8* %dest, i8* %src, i64 %size)
+; BEFORE-LABEL: define void @test3(ptr %src, ptr %dest, i64 %size)
+; AFTER-LABEL: define void @test3(ptr nocapture readonly %src, ptr nocapture writeonly %dest, i64 %size)
+ %fptr = alloca ptr
+ store ptr @memcpy, ptr %fptr
+ %f = load ptr, ptr %fptr
+ call ptr %f(ptr %dest, ptr %src, i64 %size)
; CHECK: call void @llvm.memcpy
ret void
}
; A boring function that just keeps our declarations around.
-define void @keep(i8** %sink) {
+define void @keep(ptr %sink) {
; CHECK-NOT: Function Attrs
; CHECK-LABEL: define void @keep(
entry:
- store volatile i8* bitcast (void ()* @readnone to i8*), i8** %sink
- store volatile i8* bitcast (void ()* @unknown to i8*), i8** %sink
- store volatile i8* bitcast (i8* (i8*, i8*, i64)* @memcpy to i8*), i8** %sink
+ store volatile ptr @readnone, ptr %sink
+ store volatile ptr @unknown, ptr %sink
+ store volatile ptr @memcpy, ptr %sink
call void @unknown()
ret void
}
diff --git a/llvm/test/Other/cgscc-disconnected-invalidation.ll b/llvm/test/Other/cgscc-disconnected-invalidation.ll
index 4f50729153e54..907b17d255abc 100644
--- a/llvm/test/Other/cgscc-disconnected-invalidation.ll
+++ b/llvm/test/Other/cgscc-disconnected-invalidation.ll
@@ -24,31 +24,31 @@ entry:
ret void
}
-define internal void @test_refscc_internal(i1 %flag, i8* %ptr) {
+define internal void @test_refscc_internal(i1 %flag, ptr %ptr) {
; CHECK-NOT: @test_refscc_internal
entry:
br i1 %flag, label %then, label %else
then:
- call void @test_refscc_internal(i1 false, i8* bitcast (i8* ()* @test_refscc_external to i8*))
+ call void @test_refscc_internal(i1 false, ptr @test_refscc_external)
br label %else
else:
ret void
}
-define i8* @test_refscc_external() {
-; CHECK-LABEL: define i8* @test_refscc_external()
+define ptr @test_refscc_external() {
+; CHECK-LABEL: define ptr @test_refscc_external()
entry:
br i1 true, label %then, label %else
; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i8* null
+; CHECK-NEXT: ret ptr null
; CHECK-NEXT: }
; CHECK-NOT: @test_refscc_internal
then:
- ret i8* null
+ ret ptr null
else:
- ret i8* bitcast (void (i1, i8*)* @test_refscc_internal to i8*)
+ ret ptr @test_refscc_internal
}
diff --git a/llvm/test/Other/cgscc-iterate-function-mutation.ll b/llvm/test/Other/cgscc-iterate-function-mutation.ll
index 50e0c748076eb..aafd38d1e8825 100644
--- a/llvm/test/Other/cgscc-iterate-function-mutation.ll
+++ b/llvm/test/Other/cgscc-iterate-function-mutation.ll
@@ -2,7 +2,7 @@
declare void @readnone() nofree nosync readnone
declare void @unknown()
-declare void @reference_function_pointer(void()*) nofree nosync readnone
+declare void @reference_function_pointer(ptr) nofree nosync readnone
; The @test1_* set of functions checks that when we mutate functions with
; simplifycfg to delete call edges and this ends up splitting both the SCCs
@@ -85,7 +85,7 @@ define void @test2_b1() {
; CHECK: define void @test2_b2() #0 {
define void @test2_b2() {
- call void @reference_function_pointer(void()* @test2_a)
+ call void @reference_function_pointer(ptr @test2_a)
br i1 false, label %dead, label %exit
dead:
@@ -98,7 +98,7 @@ exit:
; CHECK: define void @test2_b3() {
define void @test2_b3() {
- call void @reference_function_pointer(void()* @test2_a)
+ call void @reference_function_pointer(ptr @test2_a)
call void @unknown()
br i1 false, label %dead, label %exit
@@ -112,7 +112,7 @@ exit:
; CHECK: define void @test2_b4() #0 {
define void @test2_b4() {
- call void @reference_function_pointer(void()* @test2_a)
+ call void @reference_function_pointer(ptr @test2_a)
br i1 false, label %dead, label %exit
dead:
@@ -276,7 +276,7 @@ define void @test4_b22() {
; CHECK: define void @test4_b23() #0 {
define void @test4_b23() {
- call void @reference_function_pointer(void()* @test4_a)
+ call void @reference_function_pointer(ptr @test4_a)
br i1 false, label %dead, label %exit
dead:
@@ -301,7 +301,7 @@ define void @test4_b32() {
; CHECK: define void @test4_b33() {
define void @test4_b33() {
- call void @reference_function_pointer(void()* @test4_a)
+ call void @reference_function_pointer(ptr @test4_a)
call void @unknown()
br i1 false, label %dead, label %exit
@@ -327,7 +327,7 @@ define void @test4_b42() {
; CHECK: define void @test4_b43() #0 {
define void @test4_b43() {
- call void @reference_function_pointer(void()* @test4_a)
+ call void @reference_function_pointer(ptr @test4_a)
br i1 false, label %dead, label %exit
dead:
diff --git a/llvm/test/Other/cgscc-libcall-update.ll b/llvm/test/Other/cgscc-libcall-update.ll
index 0be64c67a40b8..05dc0cfb60685 100644
--- a/llvm/test/Other/cgscc-libcall-update.ll
+++ b/llvm/test/Other/cgscc-libcall-update.ll
@@ -8,47 +8,46 @@
;
; RUN: opt -passes='cgscc(inline,function(instcombine,invalidate<all>))' -S < %s | FileCheck %s
-define i8* @wibble(i8* %arg1, i8* %arg2) {
-; CHECK-LABEL: define i8* @wibble(
+define ptr @wibble(ptr %arg1, ptr %arg2) {
+; CHECK-LABEL: define ptr @wibble(
bb:
%tmp = alloca [1024 x i8], align 16
- %tmp2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %tmp, i64 0, i64 0
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp2, i8* %arg1, i64 1024, i1 false)
-; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* noundef nonnull align 16 dereferenceable(1024)
- %tmp3 = call i64 @llvm.objectsize.i64.p0i8(i8* %tmp2, i1 false, i1 true, i1 false)
- %tmp4 = call i8* @__strncpy_chk(i8* %arg2, i8* %tmp2, i64 1023, i64 %tmp3)
+ call void @llvm.memcpy.p0.p0.i64(ptr %tmp, ptr %arg1, i64 1024, i1 false)
+; CHECK: call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024)
+ %tmp3 = call i64 @llvm.objectsize.i64.p0(ptr %tmp, i1 false, i1 true, i1 false)
+ %tmp4 = call ptr @__strncpy_chk(ptr %arg2, ptr %tmp, i64 1023, i64 %tmp3)
; CHECK-NOT: call
-; CHECK: call i8* @strncpy(i8* noundef nonnull dereferenceable(1) %arg2, i8* noundef nonnull dereferenceable(1) %tmp2, i64 1023)
+; CHECK: call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %arg2, ptr noundef nonnull dereferenceable(1) %tmp, i64 1023)
; CHECK-NOT: call
- ret i8* %tmp4
+ ret ptr %tmp4
; CHECK: ret
}
-define i8* @strncpy(i8* %arg1, i8* %arg2, i64 %size) noinline {
+define ptr @strncpy(ptr %arg1, ptr %arg2, i64 %size) noinline {
bb:
-; CHECK: call i8* @my_special_strncpy(i8* %arg1, i8* %arg2, i64 %size)
- %result = call i8* @my_special_strncpy(i8* %arg1, i8* %arg2, i64 %size)
- ret i8* %result
+; CHECK: call ptr @my_special_strncpy(ptr %arg1, ptr %arg2, i64 %size)
+ %result = call ptr @my_special_strncpy(ptr %arg1, ptr %arg2, i64 %size)
+ ret ptr %result
}
-declare i8* @my_special_strncpy(i8* %arg1, i8* %arg2, i64 %size)
+declare ptr @my_special_strncpy(ptr %arg1, ptr %arg2, i64 %size)
-declare i64 @llvm.objectsize.i64.p0i8(i8*, i1, i1, i1)
+declare i64 @llvm.objectsize.i64.p0(ptr, i1, i1, i1)
-declare i8* @__strncpy_chk(i8*, i8*, i64, i64)
+declare ptr @__strncpy_chk(ptr, ptr, i64, i64)
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)
; Check that even when we completely remove a libcall we don't get the call
; graph wrong once we handle libcalls in the call graph specially to address
; the above case.
-define i32 @hoge(i32* %arg1) {
+define i32 @hoge(ptr %arg1) {
; CHECK-LABEL: define i32 @hoge(
bb:
- %tmp41 = load i32*, i32** null
- %tmp6 = load i32, i32* %arg1
+ %tmp41 = load ptr, ptr null
+ %tmp6 = load i32, ptr %arg1
%tmp7 = call i32 @ntohl(i32 %tmp6)
; CHECK-NOT: call i32 @ntohl
ret i32 %tmp7
@@ -65,14 +64,14 @@ entry:
ret i32 %shr
}
-define i64 @write(i32 %i, i8* %p, i64 %j) {
+define i64 @write(i32 %i, ptr %p, i64 %j) {
entry:
- %val = call i64 @write_wrapper(i32 %i, i8* %p, i64 %j) noinline
+ %val = call i64 @write_wrapper(i32 %i, ptr %p, i64 %j) noinline
ret i64 %val
}
-define i64 @write_wrapper(i32 %i, i8* %p, i64 %j) {
+define i64 @write_wrapper(i32 %i, ptr %p, i64 %j) {
entry:
- %val = call i64 @write(i32 %i, i8* %p, i64 %j) noinline
+ %val = call i64 @write(i32 %i, ptr %p, i64 %j) noinline
ret i64 %val
}
diff --git a/llvm/test/Other/cgscc-observe-devirt.ll b/llvm/test/Other/cgscc-observe-devirt.ll
index 6a6168ca49d4d..f9af9ecb306b9 100644
--- a/llvm/test/Other/cgscc-observe-devirt.ll
+++ b/llvm/test/Other/cgscc-observe-devirt.ll
@@ -20,10 +20,10 @@ declare void @unknown()
; BEFORE: define void @test1_a1() {
; AFTER: define void @test1_a1() {
define void @test1_a1() {
- %fptr = alloca void()*
- store void()* @test1_b2, void()** %fptr
- store void()* @test1_b1, void()** %fptr
- %f = load void()*, void()** %fptr
+ %fptr = alloca ptr
+ store ptr @test1_b2, ptr %fptr
+ store ptr @test1_b1, ptr %fptr
+ %f = load ptr, ptr %fptr
call void %f()
ret void
}
@@ -39,10 +39,10 @@ define void @test1_b1() {
; BEFORE: define void @test1_a2() {
; AFTER: define void @test1_a2() #0 {
define void @test1_a2() {
- %fptr = alloca void()*
- store void()* @test1_b1, void()** %fptr
- store void()* @test1_b2, void()** %fptr
- %f = load void()*, void()** %fptr
+ %fptr = alloca ptr
+ store ptr @test1_b1, ptr %fptr
+ store ptr @test1_b2, ptr %fptr
+ %f = load ptr, ptr %fptr
call void %f()
ret void
}
@@ -71,34 +71,34 @@ define void @test2_a() {
; CHECK: define void @test2_b1() #0 {
define void @test2_b1() {
- %fptr = alloca void()*
- store void()* @test2_a, void()** %fptr
- store void()* @readnone, void()** %fptr
- %f = load void()*, void()** %fptr
+ %fptr = alloca ptr
+ store ptr @test2_a, ptr %fptr
+ store ptr @readnone, ptr %fptr
+ %f = load ptr, ptr %fptr
call void %f()
ret void
}
; CHECK: define void @test2_b2() #0 {
define void @test2_b2() {
- %fptr = alloca void()*
- store void()* @test2_a, void()** %fptr
- store void()* @test2_b2, void()** %fptr
- store void()* @test2_b3, void()** %fptr
- store void()* @test2_b1, void()** %fptr
- %f = load void()*, void()** %fptr
+ %fptr = alloca ptr
+ store ptr @test2_a, ptr %fptr
+ store ptr @test2_b2, ptr %fptr
+ store ptr @test2_b3, ptr %fptr
+ store ptr @test2_b1, ptr %fptr
+ %f = load ptr, ptr %fptr
call void %f()
ret void
}
; CHECK: define void @test2_b3() #0 {
define void @test2_b3() {
- %fptr = alloca void()*
- store void()* @test2_a, void()** %fptr
- store void()* @test2_b2, void()** %fptr
- store void()* @test2_b3, void()** %fptr
- store void()* @test2_b1, void()** %fptr
- %f = load void()*, void()** %fptr
+ %fptr = alloca ptr
+ store ptr @test2_a, ptr %fptr
+ store ptr @test2_b2, ptr %fptr
+ store ptr @test2_b3, ptr %fptr
+ store ptr @test2_b1, ptr %fptr
+ %f = load ptr, ptr %fptr
call void %f()
ret void
}
diff --git a/llvm/test/Other/cgscc-refscc-mutation-order.ll b/llvm/test/Other/cgscc-refscc-mutation-order.ll
index c4d698a2cafdf..13a46503c1f4c 100644
--- a/llvm/test/Other/cgscc-refscc-mutation-order.ll
+++ b/llvm/test/Other/cgscc-refscc-mutation-order.ll
@@ -18,10 +18,10 @@
; CHECK: Running pass: InstCombinePass on f1
; CHECK-NOT: InstCombinePass
- at a1 = alias void (), void ()* @f1
- at a2 = alias void (), void ()* @f2
- at a3 = alias void (), void ()* @f3
- at a4 = alias void (), void ()* @f4
+ at a1 = alias void (), ptr @f1
+ at a2 = alias void (), ptr @f2
+ at a3 = alias void (), ptr @f3
+ at a4 = alias void (), ptr @f4
define void @f1() {
call void @a2()
diff --git a/llvm/test/Other/codegenprepare-and-debug.ll b/llvm/test/Other/codegenprepare-and-debug.ll
index 30ea12fd18d40..cc6344c1143f2 100644
--- a/llvm/test/Other/codegenprepare-and-debug.ll
+++ b/llvm/test/Other/codegenprepare-and-debug.ll
@@ -29,7 +29,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
declare void @llvm.dbg.value(metadata, metadata, metadata) #0
; Function Attrs: noinline nounwind uwtable
-define dso_local void @foobar(i32* nocapture %arg0) local_unnamed_addr #0 {
+define dso_local void @foobar(ptr nocapture %arg0) local_unnamed_addr #0 {
entry:
br label %while.cond
diff --git a/llvm/test/Other/constant-fold-gep-address-spaces.ll b/llvm/test/Other/constant-fold-gep-address-spaces.ll
index ee2f48b64a336..e2589ce77ebd2 100644
--- a/llvm/test/Other/constant-fold-gep-address-spaces.ll
+++ b/llvm/test/Other/constant-fold-gep-address-spaces.ll
@@ -7,140 +7,140 @@ target datalayout = "e-p:128:128:128-p1:32:32:32-p2:8:8:8-p3:16:16:16-p4:64:64:6
; The automatic constant folder in opt does not have targetdata access, so
; it can't fold gep arithmetic, in general. However, the constant folder run
; from instcombine and global opt can use targetdata.
-; PLAIN: @G8 = global i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* inttoptr (i32 1 to i8 addrspace(1)*), i32 -1)
- at G8 = global i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* inttoptr (i32 1 to i8 addrspace(1)*), i32 -1)
-; PLAIN: @G1 = global i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* inttoptr (i8 1 to i1 addrspace(2)*), i8 -1)
- at G1 = global i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* inttoptr (i8 1 to i1 addrspace(2)*), i8 -1)
-; PLAIN: @F8 = global i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* inttoptr (i32 1 to i8 addrspace(1)*), i32 -2)
- at F8 = global i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* inttoptr (i32 1 to i8 addrspace(1)*), i32 -2)
-; PLAIN: @F1 = global i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* inttoptr (i8 1 to i1 addrspace(2)*), i8 -2)
- at F1 = global i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* inttoptr (i8 1 to i1 addrspace(2)*), i8 -2)
-; PLAIN: @H8 = global i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* null, i32 -1)
- at H8 = global i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* inttoptr (i32 0 to i8 addrspace(1)*), i32 -1)
-; PLAIN: @H1 = global i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* null, i8 -1)
- at H1 = global i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* inttoptr (i8 0 to i1 addrspace(2)*), i8 -1)
+; PLAIN: @G8 = global ptr addrspace(1) getelementptr (i8, ptr addrspace(1) inttoptr (i32 1 to ptr addrspace(1)), i32 -1)
+ at G8 = global ptr addrspace(1) getelementptr (i8, ptr addrspace(1) inttoptr (i32 1 to ptr addrspace(1)), i32 -1)
+; PLAIN: @G1 = global ptr addrspace(2) getelementptr (i1, ptr addrspace(2) inttoptr (i8 1 to ptr addrspace(2)), i8 -1)
+ at G1 = global ptr addrspace(2) getelementptr (i1, ptr addrspace(2) inttoptr (i8 1 to ptr addrspace(2)), i8 -1)
+; PLAIN: @F8 = global ptr addrspace(1) getelementptr (i8, ptr addrspace(1) inttoptr (i32 1 to ptr addrspace(1)), i32 -2)
+ at F8 = global ptr addrspace(1) getelementptr (i8, ptr addrspace(1) inttoptr (i32 1 to ptr addrspace(1)), i32 -2)
+; PLAIN: @F1 = global ptr addrspace(2) getelementptr (i1, ptr addrspace(2) inttoptr (i8 1 to ptr addrspace(2)), i8 -2)
+ at F1 = global ptr addrspace(2) getelementptr (i1, ptr addrspace(2) inttoptr (i8 1 to ptr addrspace(2)), i8 -2)
+; PLAIN: @H8 = global ptr addrspace(1) getelementptr (i8, ptr addrspace(1) null, i32 -1)
+ at H8 = global ptr addrspace(1) getelementptr (i8, ptr addrspace(1) inttoptr (i32 0 to ptr addrspace(1)), i32 -1)
+; PLAIN: @H1 = global ptr addrspace(2) getelementptr (i1, ptr addrspace(2) null, i8 -1)
+ at H1 = global ptr addrspace(2) getelementptr (i1, ptr addrspace(2) inttoptr (i8 0 to ptr addrspace(2)), i8 -1)
; The target-independent folder should be able to do some clever
; simplifications on sizeof, alignof, and offsetof expressions. The
; target-dependent folder should fold these down to constants.
-; PLAIN-X: @a = constant i64 mul (i64 ptrtoint (double addrspace(4)* getelementptr (double, double addrspace(4)* null, i32 1) to i64), i64 2310)
- at a = constant i64 mul (i64 3, i64 mul (i64 ptrtoint ({[7 x double], [7 x double]} addrspace(4)* getelementptr ({[7 x double], [7 x double]}, {[7 x double], [7 x double]} addrspace(4)* null, i64 11) to i64), i64 5))
+; PLAIN-X: @a = constant i64 mul (i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64), i64 2310)
+ at a = constant i64 mul (i64 3, i64 mul (i64 ptrtoint (ptr addrspace(4) getelementptr ({[7 x double], [7 x double]}, ptr addrspace(4) null, i64 11) to i64), i64 5))
-; PLAIN-X: @b = constant i64 ptrtoint (double addrspace(4)* getelementptr ({ i1, double }, { i1, double }* null, i64 0, i32 1) to i64)
- at b = constant i64 ptrtoint ([13 x double] addrspace(4)* getelementptr ({i1, [13 x double]}, {i1, [13 x double]} addrspace(4)* null, i64 0, i32 1) to i64)
+; PLAIN-X: @b = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({ i1, double }, ptr null, i64 0, i32 1) to i64)
+ at b = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({i1, [13 x double]}, ptr addrspace(4) null, i64 0, i32 1) to i64)
-; PLAIN-X: @c = constant i64 mul nuw (i64 ptrtoint (double addrspace(4)* getelementptr (double, double addrspace(4)* null, i32 1) to i64), i64 2)
- at c = constant i64 ptrtoint (double addrspace(4)* getelementptr ({double, double, double, double}, {double, double, double, double} addrspace(4)* null, i64 0, i32 2) to i64)
+; PLAIN-X: @c = constant i64 mul nuw (i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64), i64 2)
+ at c = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({double, double, double, double}, ptr addrspace(4) null, i64 0, i32 2) to i64)
-; PLAIN-X: @d = constant i64 mul nuw (i64 ptrtoint (double addrspace(4)* getelementptr (double, double addrspace(4)* null, i32 1) to i64), i64 11)
- at d = constant i64 ptrtoint (double addrspace(4)* getelementptr ([13 x double], [13 x double] addrspace(4)* null, i64 0, i32 11) to i64)
+; PLAIN-X: @d = constant i64 mul nuw (i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64), i64 11)
+ at d = constant i64 ptrtoint (ptr addrspace(4) getelementptr ([13 x double], ptr addrspace(4) null, i64 0, i32 11) to i64)
-; PLAIN-X: @e = constant i64 ptrtoint (double addrspace(4)* getelementptr ({ double, float, double, double }, { double, float, double, double }* null, i64 0, i32 2) to i64)
- at e = constant i64 ptrtoint (double addrspace(4)* getelementptr ({double, float, double, double}, {double, float, double, double} addrspace(4)* null, i64 0, i32 2) to i64)
+; PLAIN-X: @e = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({ double, float, double, double }, ptr null, i64 0, i32 2) to i64)
+ at e = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({double, float, double, double}, ptr addrspace(4) null, i64 0, i32 2) to i64)
; PLAIN-X: @f = constant i64 1
- at f = constant i64 ptrtoint (<{ i16, i128 }> addrspace(4)* getelementptr ({i1, <{ i16, i128 }>}, {i1, <{ i16, i128 }>} addrspace(4)* null, i64 0, i32 1) to i64)
+ at f = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({i1, <{ i16, i128 }>}, ptr addrspace(4) null, i64 0, i32 1) to i64)
-; PLAIN-X: @g = constant i64 ptrtoint (double addrspace(4)* getelementptr ({ i1, double }, { i1, double }* null, i64 0, i32 1) to i64)
- at g = constant i64 ptrtoint ({double, double} addrspace(4)* getelementptr ({i1, {double, double}}, {i1, {double, double}} addrspace(4)* null, i64 0, i32 1) to i64)
+; PLAIN-X: @g = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({ i1, double }, ptr null, i64 0, i32 1) to i64)
+ at g = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({i1, {double, double}}, ptr addrspace(4) null, i64 0, i32 1) to i64)
-; PLAIN-X: @h = constant i64 ptrtoint (i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* null, i32 1) to i64)
- at h = constant i64 ptrtoint (double addrspace(4)* getelementptr (double, double addrspace(4)* null, i64 1) to i64)
+; PLAIN-X: @h = constant i64 ptrtoint (ptr addrspace(2) getelementptr (i1, ptr addrspace(2) null, i32 1) to i64)
+ at h = constant i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i64 1) to i64)
-; PLAIN-X: @i = constant i64 ptrtoint (i1 addrspace(2)* getelementptr ({ i1, i1 addrspace(2)* }, { i1, i1 addrspace(2)* }* null, i64 0, i32 1) to i64)
- at i = constant i64 ptrtoint (double addrspace(4)* getelementptr ({i1, double}, {i1, double} addrspace(4)* null, i64 0, i32 1) to i64)
+; PLAIN-X: @i = constant i64 ptrtoint (ptr addrspace(2) getelementptr ({ i1, ptr addrspace(2) }, ptr null, i64 0, i32 1) to i64)
+ at i = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({i1, double}, ptr addrspace(4) null, i64 0, i32 1) to i64)
; The target-dependent folder should cast GEP indices to integer-sized pointers.
-; PLAIN: @M = constant i64 addrspace(4)* getelementptr (i64, i64 addrspace(4)* null, i32 1)
-; PLAIN: @N = constant i64 addrspace(4)* getelementptr ({ i64, i64 }, { i64, i64 } addrspace(4)* null, i32 0, i32 1)
-; PLAIN: @O = constant i64 addrspace(4)* getelementptr ([2 x i64], [2 x i64] addrspace(4)* null, i32 0, i32 1)
+; PLAIN: @M = constant ptr addrspace(4) getelementptr (i64, ptr addrspace(4) null, i32 1)
+; PLAIN: @N = constant ptr addrspace(4) getelementptr ({ i64, i64 }, ptr addrspace(4) null, i32 0, i32 1)
+; PLAIN: @O = constant ptr addrspace(4) getelementptr ([2 x i64], ptr addrspace(4) null, i32 0, i32 1)
- at M = constant i64 addrspace(4)* getelementptr (i64, i64 addrspace(4)* null, i32 1)
- at N = constant i64 addrspace(4)* getelementptr ({ i64, i64 }, { i64, i64 } addrspace(4)* null, i32 0, i32 1)
- at O = constant i64 addrspace(4)* getelementptr ([2 x i64], [2 x i64] addrspace(4)* null, i32 0, i32 1)
+ at M = constant ptr addrspace(4) getelementptr (i64, ptr addrspace(4) null, i32 1)
+ at N = constant ptr addrspace(4) getelementptr ({ i64, i64 }, ptr addrspace(4) null, i32 0, i32 1)
+ at O = constant ptr addrspace(4) getelementptr ([2 x i64], ptr addrspace(4) null, i32 0, i32 1)
; Fold GEP of a GEP. Very simple cases are folded.
-; PLAIN-X: @Y = global [3 x { i32, i32 }]addrspace(3)* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]addrspace(3)* @ext, i64 2)
+; PLAIN-X: @Y = global ptraddrspace(3) getelementptr inbounds ([3 x { i32, i32 }], ptraddrspace(3) @ext, i64 2)
@ext = external addrspace(3) global [3 x { i32, i32 }]
- at Y = global [3 x { i32, i32 }]addrspace(3)* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]addrspace(3)* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]addrspace(3)* @ext, i64 1), i64 1)
+ at Y = global ptr addrspace(3) getelementptr inbounds ([3 x { i32, i32 }], ptr addrspace(3) getelementptr inbounds ([3 x { i32, i32 }], ptr addrspace(3) @ext, i64 1), i64 1)
-; PLAIN-X: @Z = global i32addrspace(3)* getelementptr inbounds (i32, i32addrspace(3)* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]addrspace(3)* @ext, i64 0, i64 1, i32 0), i64 1)
- at Z = global i32addrspace(3)* getelementptr inbounds (i32, i32addrspace(3)* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]addrspace(3)* @ext, i64 0, i64 1, i32 0), i64 1)
+; PLAIN-X: @Z = global ptraddrspace(3) getelementptr inbounds (i32, ptr addrspace(3) getelementptr inbounds ([3 x { i32, i32 }], ptr addrspace(3) @ext, i64 0, i64 1, i32 0), i64 1)
+ at Z = global ptr addrspace(3) getelementptr inbounds (i32, ptr addrspace(3) getelementptr inbounds ([3 x { i32, i32 }], ptr addrspace(3) @ext, i64 0, i64 1, i32 0), i64 1)
; Duplicate all of the above as function return values rather than
; global initializers.
-; PLAIN: define i8 addrspace(1)* @goo8() #0 {
-; PLAIN: %t = bitcast i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* inttoptr (i32 1 to i8 addrspace(1)*), i32 -1) to i8 addrspace(1)*
-; PLAIN: ret i8 addrspace(1)* %t
+; PLAIN: define ptr addrspace(1) @goo8() #0 {
+; PLAIN: %t = bitcast ptr addrspace(1) getelementptr (i8, ptr addrspace(1) inttoptr (i32 1 to ptr addrspace(1)), i32 -1) to ptr addrspace(1)
+; PLAIN: ret ptr addrspace(1) %t
; PLAIN: }
-; PLAIN: define i1 addrspace(2)* @goo1() #0 {
-; PLAIN: %t = bitcast i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* inttoptr (i32 1 to i1 addrspace(2)*), i32 -1) to i1 addrspace(2)*
-; PLAIN: ret i1 addrspace(2)* %t
+; PLAIN: define ptr addrspace(2) @goo1() #0 {
+; PLAIN: %t = bitcast ptr addrspace(2) getelementptr (i1, ptr addrspace(2) inttoptr (i32 1 to ptr addrspace(2)), i32 -1) to ptr addrspace(2)
+; PLAIN: ret ptr addrspace(2) %t
; PLAIN: }
-; PLAIN: define i8 addrspace(1)* @foo8() #0 {
-; PLAIN: %t = bitcast i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* inttoptr (i32 1 to i8 addrspace(1)*), i32 -2) to i8 addrspace(1)*
-; PLAIN: ret i8 addrspace(1)* %t
+; PLAIN: define ptr addrspace(1) @foo8() #0 {
+; PLAIN: %t = bitcast ptr addrspace(1) getelementptr (i8, ptr addrspace(1) inttoptr (i32 1 to ptr addrspace(1)), i32 -2) to ptr addrspace(1)
+; PLAIN: ret ptr addrspace(1) %t
; PLAIN: }
-; PLAIN: define i1 addrspace(2)* @foo1() #0 {
-; PLAIN: %t = bitcast i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* inttoptr (i32 1 to i1 addrspace(2)*), i32 -2) to i1 addrspace(2)*
-; PLAIN: ret i1 addrspace(2)* %t
+; PLAIN: define ptr addrspace(2) @foo1() #0 {
+; PLAIN: %t = bitcast ptr addrspace(2) getelementptr (i1, ptr addrspace(2) inttoptr (i32 1 to ptr addrspace(2)), i32 -2) to ptr addrspace(2)
+; PLAIN: ret ptr addrspace(2) %t
; PLAIN: }
-; PLAIN: define i8 addrspace(1)* @hoo8() #0 {
-; PLAIN: %t = bitcast i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* null, i32 -1) to i8 addrspace(1)*
-; PLAIN: ret i8 addrspace(1)* %t
+; PLAIN: define ptr addrspace(1) @hoo8() #0 {
+; PLAIN: %t = bitcast ptr addrspace(1) getelementptr (i8, ptr addrspace(1) null, i32 -1) to ptr addrspace(1)
+; PLAIN: ret ptr addrspace(1) %t
; PLAIN: }
-; PLAIN: define i1 addrspace(2)* @hoo1() #0 {
-; PLAIN: %t = bitcast i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* null, i32 -1) to i1 addrspace(2)*
-; PLAIN: ret i1 addrspace(2)* %t
+; PLAIN: define ptr addrspace(2) @hoo1() #0 {
+; PLAIN: %t = bitcast ptr addrspace(2) getelementptr (i1, ptr addrspace(2) null, i32 -1) to ptr addrspace(2)
+; PLAIN: ret ptr addrspace(2) %t
; PLAIN: }
-define i8 addrspace(1)* @goo8() #0 {
- %t = bitcast i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* inttoptr (i32 1 to i8 addrspace(1)*), i32 -1) to i8 addrspace(1)*
- ret i8 addrspace(1)* %t
+define ptr addrspace(1) @goo8() #0 {
+ %t = bitcast ptr addrspace(1) getelementptr (i8, ptr addrspace(1) inttoptr (i32 1 to ptr addrspace(1)), i32 -1) to ptr addrspace(1)
+ ret ptr addrspace(1) %t
}
-define i1 addrspace(2)* @goo1() #0 {
- %t = bitcast i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* inttoptr (i32 1 to i1 addrspace(2)*), i32 -1) to i1 addrspace(2)*
- ret i1 addrspace(2)* %t
+define ptr addrspace(2) @goo1() #0 {
+ %t = bitcast ptr addrspace(2) getelementptr (i1, ptr addrspace(2) inttoptr (i32 1 to ptr addrspace(2)), i32 -1) to ptr addrspace(2)
+ ret ptr addrspace(2) %t
}
-define i8 addrspace(1)* @foo8() #0 {
- %t = bitcast i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* inttoptr (i32 1 to i8 addrspace(1)*), i32 -2) to i8 addrspace(1)*
- ret i8 addrspace(1)* %t
+define ptr addrspace(1) @foo8() #0 {
+ %t = bitcast ptr addrspace(1) getelementptr (i8, ptr addrspace(1) inttoptr (i32 1 to ptr addrspace(1)), i32 -2) to ptr addrspace(1)
+ ret ptr addrspace(1) %t
}
-define i1 addrspace(2)* @foo1() #0 {
- %t = bitcast i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* inttoptr (i32 1 to i1 addrspace(2)*), i32 -2) to i1 addrspace(2)*
- ret i1 addrspace(2)* %t
+define ptr addrspace(2) @foo1() #0 {
+ %t = bitcast ptr addrspace(2) getelementptr (i1, ptr addrspace(2) inttoptr (i32 1 to ptr addrspace(2)), i32 -2) to ptr addrspace(2)
+ ret ptr addrspace(2) %t
}
-define i8 addrspace(1)* @hoo8() #0 {
- %t = bitcast i8 addrspace(1)* getelementptr (i8, i8 addrspace(1)* inttoptr (i32 0 to i8 addrspace(1)*), i32 -1) to i8 addrspace(1)*
- ret i8 addrspace(1)* %t
+define ptr addrspace(1) @hoo8() #0 {
+ %t = bitcast ptr addrspace(1) getelementptr (i8, ptr addrspace(1) inttoptr (i32 0 to ptr addrspace(1)), i32 -1) to ptr addrspace(1)
+ ret ptr addrspace(1) %t
}
-define i1 addrspace(2)* @hoo1() #0 {
- %t = bitcast i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* inttoptr (i32 0 to i1 addrspace(2)*), i32 -1) to i1 addrspace(2)*
- ret i1 addrspace(2)* %t
+define ptr addrspace(2) @hoo1() #0 {
+ %t = bitcast ptr addrspace(2) getelementptr (i1, ptr addrspace(2) inttoptr (i32 0 to ptr addrspace(2)), i32 -1) to ptr addrspace(2)
+ ret ptr addrspace(2) %t
}
; PLAIN-X: define i64 @fa() #0 {
-; PLAIN-X: %t = bitcast i64 mul (i64 ptrtoint (double addrspace(4)* getelementptr (double, double addrspace(4)* null, i32 1) to i64), i64 2310) to i64
+; PLAIN-X: %t = bitcast i64 mul (i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64), i64 2310) to i64
; PLAIN-X: ret i64 %t
; PLAIN-X: }
; PLAIN-X: define i64 @fb() #0 {
-; PLAIN-X: %t = bitcast i64 ptrtoint (double addrspace(4)* getelementptr ({ i1, double }, { i1, double }* null, i64 0, i32 1) to i64) to i64
+; PLAIN-X: %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({ i1, double }, ptr null, i64 0, i32 1) to i64) to i64
; PLAIN-X: ret i64 %t
; PLAIN-X: }
; PLAIN-X: define i64 @fc() #0 {
-; PLAIN-X: %t = bitcast i64 mul nuw (i64 ptrtoint (double addrspace(4)* getelementptr (double, double addrspace(4)* null, i32 1) to i64), i64 2) to i64
+; PLAIN-X: %t = bitcast i64 mul nuw (i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64), i64 2) to i64
; PLAIN-X: ret i64 %t
; PLAIN-X: }
; PLAIN-X: define i64 @fd() #0 {
-; PLAIN-X: %t = bitcast i64 mul nuw (i64 ptrtoint (double addrspace(4)* getelementptr (double, double addrspace(4)* null, i32 1) to i64), i64 11) to i64
+; PLAIN-X: %t = bitcast i64 mul nuw (i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64), i64 11) to i64
; PLAIN-X: ret i64 %t
; PLAIN-X: }
; PLAIN-X: define i64 @fe() #0 {
-; PLAIN-X: %t = bitcast i64 ptrtoint (double addrspace(4)* getelementptr ({ double, float, double, double }, { double, float, double, double }* null, i64 0, i32 2) to i64) to i64
+; PLAIN-X: %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({ double, float, double, double }, ptr null, i64 0, i32 2) to i64) to i64
; PLAIN-X: ret i64 %t
; PLAIN-X: }
; PLAIN-X: define i64 @ff() #0 {
@@ -148,88 +148,88 @@ define i1 addrspace(2)* @hoo1() #0 {
; PLAIN-X: ret i64 %t
; PLAIN-X: }
; PLAIN-X: define i64 @fg() #0 {
-; PLAIN-X: %t = bitcast i64 ptrtoint (double addrspace(4)* getelementptr ({ i1, double }, { i1, double }* null, i64 0, i32 1) to i64) to i64
+; PLAIN-X: %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({ i1, double }, ptr null, i64 0, i32 1) to i64) to i64
; PLAIN-X: ret i64 %t
; PLAIN-X: }
; PLAIN-X: define i64 @fh() #0 {
-; PLAIN-X: %t = bitcast i64 ptrtoint (i1 addrspace(2)* getelementptr (i1, i1 addrspace(2)* null, i32 1) to i64) to i64
+; PLAIN-X: %t = bitcast i64 ptrtoint (ptr addrspace(2) getelementptr (i1, ptr addrspace(2) null, i32 1) to i64) to i64
; PLAIN-X: ret i64 %t
; PLAIN-X: }
; PLAIN-X: define i64 @fi() #0 {
-; PLAIN-X: %t = bitcast i64 ptrtoint (i1 addrspace(2)* getelementptr ({ i1, i1 addrspace(2)* }, { i1, i1 addrspace(2)* }* null, i64 0, i32 1) to i64) to i64
+; PLAIN-X: %t = bitcast i64 ptrtoint (ptr addrspace(2) getelementptr ({ i1, ptr addrspace(2) }, ptr null, i64 0, i32 1) to i64) to i64
; PLAIN-X: ret i64 %t
; PLAIN-X: }
define i64 @fa() #0 {
- %t = bitcast i64 mul (i64 3, i64 mul (i64 ptrtoint ({[7 x double], [7 x double]}* getelementptr ({[7 x double], [7 x double]}, {[7 x double], [7 x double]}* null, i64 11) to i64), i64 5)) to i64
+ %t = bitcast i64 mul (i64 3, i64 mul (i64 ptrtoint (ptr getelementptr ({[7 x double], [7 x double]}, ptr null, i64 11) to i64), i64 5)) to i64
ret i64 %t
}
define i64 @fb() #0 {
- %t = bitcast i64 ptrtoint ([13 x double] addrspace(4)* getelementptr ({i1, [13 x double]}, {i1, [13 x double]} addrspace(4)* null, i64 0, i32 1) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({i1, [13 x double]}, ptr addrspace(4) null, i64 0, i32 1) to i64) to i64
ret i64 %t
}
define i64 @fc() #0 {
- %t = bitcast i64 ptrtoint (double addrspace(4)* getelementptr ({double, double, double, double}, {double, double, double, double} addrspace(4)* null, i64 0, i32 2) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({double, double, double, double}, ptr addrspace(4) null, i64 0, i32 2) to i64) to i64
ret i64 %t
}
define i64 @fd() #0 {
- %t = bitcast i64 ptrtoint (double addrspace(4)* getelementptr ([13 x double], [13 x double] addrspace(4)* null, i64 0, i32 11) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ([13 x double], ptr addrspace(4) null, i64 0, i32 11) to i64) to i64
ret i64 %t
}
define i64 @fe() #0 {
- %t = bitcast i64 ptrtoint (double addrspace(4)* getelementptr ({double, float, double, double}, {double, float, double, double} addrspace(4)* null, i64 0, i32 2) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({double, float, double, double}, ptr addrspace(4) null, i64 0, i32 2) to i64) to i64
ret i64 %t
}
define i64 @ff() #0 {
- %t = bitcast i64 ptrtoint (<{ i16, i128 }> addrspace(4)* getelementptr ({i1, <{ i16, i128 }>}, {i1, <{ i16, i128 }>} addrspace(4)* null, i64 0, i32 1) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({i1, <{ i16, i128 }>}, ptr addrspace(4) null, i64 0, i32 1) to i64) to i64
ret i64 %t
}
define i64 @fg() #0 {
- %t = bitcast i64 ptrtoint ({double, double} addrspace(4)* getelementptr ({i1, {double, double}}, {i1, {double, double}} addrspace(4)* null, i64 0, i32 1) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({i1, {double, double}}, ptr addrspace(4) null, i64 0, i32 1) to i64) to i64
ret i64 %t
}
define i64 @fh() #0 {
- %t = bitcast i64 ptrtoint (double addrspace(4)* getelementptr (double, double addrspace(4)* null, i32 1) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64) to i64
ret i64 %t
}
define i64 @fi() #0 {
- %t = bitcast i64 ptrtoint (double addrspace(4)* getelementptr ({i1, double}, {i1, double}addrspace(4)* null, i64 0, i32 1) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({i1, double}, ptr addrspace(4) null, i64 0, i32 1) to i64) to i64
ret i64 %t
}
-; PLAIN: define i64* @fM() #0 {
-; PLAIN: %t = bitcast i64* getelementptr (i64, i64* null, i32 1) to i64*
-; PLAIN: ret i64* %t
+; PLAIN: define ptr @fM() #0 {
+; PLAIN: %t = bitcast ptr getelementptr (i64, ptr null, i32 1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; PLAIN: define i64* @fN() #0 {
-; PLAIN: %t = bitcast i64* getelementptr ({ i64, i64 }, { i64, i64 }* null, i32 0, i32 1) to i64*
-; PLAIN: ret i64* %t
+; PLAIN: define ptr @fN() #0 {
+; PLAIN: %t = bitcast ptr getelementptr ({ i64, i64 }, ptr null, i32 0, i32 1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; PLAIN: define i64* @fO() #0 {
-; PLAIN: %t = bitcast i64* getelementptr ([2 x i64], [2 x i64]* null, i32 0, i32 1) to i64*
-; PLAIN: ret i64* %t
+; PLAIN: define ptr @fO() #0 {
+; PLAIN: %t = bitcast ptr getelementptr ([2 x i64], ptr null, i32 0, i32 1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-define i64* @fM() #0 {
- %t = bitcast i64* getelementptr (i64, i64* null, i32 1) to i64*
- ret i64* %t
+define ptr @fM() #0 {
+ %t = bitcast ptr getelementptr (i64, ptr null, i32 1) to ptr
+ ret ptr %t
}
-define i64* @fN() #0 {
- %t = bitcast i64* getelementptr ({ i64, i64 }, { i64, i64 }* null, i32 0, i32 1) to i64*
- ret i64* %t
+define ptr @fN() #0 {
+ %t = bitcast ptr getelementptr ({ i64, i64 }, ptr null, i32 0, i32 1) to ptr
+ ret ptr %t
}
-define i64* @fO() #0 {
- %t = bitcast i64* getelementptr ([2 x i64], [2 x i64]* null, i32 0, i32 1) to i64*
- ret i64* %t
+define ptr @fO() #0 {
+ %t = bitcast ptr getelementptr ([2 x i64], ptr null, i32 0, i32 1) to ptr
+ ret ptr %t
}
-; PLAIN: define i32 addrspace(1)* @fZ() #0 {
-; PLAIN: %t = bitcast i32 addrspace(1)* getelementptr inbounds (i32, i32 addrspace(1)* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }] addrspace(1)* @ext2, i64 0, i64 1, i32 0), i64 1) to i32 addrspace(1)*
-; PLAIN: ret i32 addrspace(1)* %t
+; PLAIN: define ptr addrspace(1) @fZ() #0 {
+; PLAIN: %t = bitcast ptr addrspace(1) getelementptr inbounds (i32, ptr addrspace(1) getelementptr inbounds ([3 x { i32, i32 }], ptr addrspace(1) @ext2, i64 0, i64 1, i32 0), i64 1) to ptr addrspace(1)
+; PLAIN: ret ptr addrspace(1) %t
; PLAIN: }
@ext2 = external addrspace(1) global [3 x { i32, i32 }]
-define i32 addrspace(1)* @fZ() #0 {
- %t = bitcast i32 addrspace(1)* getelementptr inbounds (i32, i32 addrspace(1)* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }] addrspace(1)* @ext2, i64 0, i64 1, i32 0), i64 1) to i32 addrspace(1)*
- ret i32 addrspace(1)* %t
+define ptr addrspace(1) @fZ() #0 {
+ %t = bitcast ptr addrspace(1) getelementptr inbounds (i32, ptr addrspace(1) getelementptr inbounds ([3 x { i32, i32 }], ptr addrspace(1) @ext2, i64 0, i64 1, i32 0), i64 1) to ptr addrspace(1)
+ ret ptr addrspace(1) %t
}
attributes #0 = { nounwind }
diff --git a/llvm/test/Other/constant-fold-gep.ll b/llvm/test/Other/constant-fold-gep.ll
index 616fadb95ff7a..4bc9d29553df3 100644
--- a/llvm/test/Other/constant-fold-gep.ll
+++ b/llvm/test/Other/constant-fold-gep.ll
@@ -18,45 +18,45 @@
; it can't fold gep arithmetic, in general. However, the constant folder run
; from instcombine and global opt can use targetdata.
-; PLAIN: @G8 = global i8* getelementptr (i8, i8* inttoptr (i32 1 to i8*), i32 -1)
-; PLAIN: @G1 = global i1* getelementptr (i1, i1* inttoptr (i32 1 to i1*), i32 -1)
-; PLAIN: @F8 = global i8* getelementptr (i8, i8* inttoptr (i32 1 to i8*), i32 -2)
-; PLAIN: @F1 = global i1* getelementptr (i1, i1* inttoptr (i32 1 to i1*), i32 -2)
-; PLAIN: @H8 = global i8* getelementptr (i8, i8* null, i32 -1)
-; PLAIN: @H1 = global i1* getelementptr (i1, i1* null, i32 -1)
-; OPT: @G8 = local_unnamed_addr global i8* null
-; OPT: @G1 = local_unnamed_addr global i1* null
-; OPT: @F8 = local_unnamed_addr global i8* inttoptr (i64 -1 to i8*)
-; OPT: @F1 = local_unnamed_addr global i1* inttoptr (i64 -1 to i1*)
-; OPT: @H8 = local_unnamed_addr global i8* inttoptr (i64 -1 to i8*)
-; OPT: @H1 = local_unnamed_addr global i1* inttoptr (i64 -1 to i1*)
-; TO: @G8 = local_unnamed_addr global i8* null
-; TO: @G1 = local_unnamed_addr global i1* null
-; TO: @F8 = local_unnamed_addr global i8* inttoptr (i64 -1 to i8*)
-; TO: @F1 = local_unnamed_addr global i1* inttoptr (i64 -1 to i1*)
-; TO: @H8 = local_unnamed_addr global i8* inttoptr (i64 -1 to i8*)
-; TO: @H1 = local_unnamed_addr global i1* inttoptr (i64 -1 to i1*)
-
- at G8 = global i8* getelementptr (i8, i8* inttoptr (i32 1 to i8*), i32 -1)
- at G1 = global i1* getelementptr (i1, i1* inttoptr (i32 1 to i1*), i32 -1)
- at F8 = global i8* getelementptr (i8, i8* inttoptr (i32 1 to i8*), i32 -2)
- at F1 = global i1* getelementptr (i1, i1* inttoptr (i32 1 to i1*), i32 -2)
- at H8 = global i8* getelementptr (i8, i8* inttoptr (i32 0 to i8*), i32 -1)
- at H1 = global i1* getelementptr (i1, i1* inttoptr (i32 0 to i1*), i32 -1)
+; PLAIN: @G8 = global ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -1)
+; PLAIN: @G1 = global ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -1)
+; PLAIN: @F8 = global ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -2)
+; PLAIN: @F1 = global ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -2)
+; PLAIN: @H8 = global ptr getelementptr (i8, ptr null, i32 -1)
+; PLAIN: @H1 = global ptr getelementptr (i1, ptr null, i32 -1)
+; OPT: @G8 = local_unnamed_addr global ptr null
+; OPT: @G1 = local_unnamed_addr global ptr null
+; OPT: @F8 = local_unnamed_addr global ptr inttoptr (i64 -1 to ptr)
+; OPT: @F1 = local_unnamed_addr global ptr inttoptr (i64 -1 to ptr)
+; OPT: @H8 = local_unnamed_addr global ptr inttoptr (i64 -1 to ptr)
+; OPT: @H1 = local_unnamed_addr global ptr inttoptr (i64 -1 to ptr)
+; TO: @G8 = local_unnamed_addr global ptr null
+; TO: @G1 = local_unnamed_addr global ptr null
+; TO: @F8 = local_unnamed_addr global ptr inttoptr (i64 -1 to ptr)
+; TO: @F1 = local_unnamed_addr global ptr inttoptr (i64 -1 to ptr)
+; TO: @H8 = local_unnamed_addr global ptr inttoptr (i64 -1 to ptr)
+; TO: @H1 = local_unnamed_addr global ptr inttoptr (i64 -1 to ptr)
+
+ at G8 = global ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -1)
+ at G1 = global ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -1)
+ at F8 = global ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -2)
+ at F1 = global ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -2)
+ at H8 = global ptr getelementptr (i8, ptr inttoptr (i32 0 to ptr), i32 -1)
+ at H1 = global ptr getelementptr (i1, ptr inttoptr (i32 0 to ptr), i32 -1)
; The target-independent folder should be able to do some clever
; simplifications on sizeof, alignof, and offsetof expressions. The
; target-dependent folder should fold these down to constants.
-; PLAIN: @a = constant i64 mul (i64 ptrtoint ({ [7 x double], [7 x double] }* getelementptr ({ [7 x double], [7 x double] }, { [7 x double], [7 x double] }* null, i64 11) to i64), i64 15)
-; PLAIN: @b = constant i64 ptrtoint ([13 x double]* getelementptr ({ i1, [13 x double] }, { i1, [13 x double] }* null, i64 0, i32 1) to i64)
-; PLAIN: @c = constant i64 ptrtoint (double* getelementptr ({ double, double, double, double }, { double, double, double, double }* null, i64 0, i32 2) to i64)
-; PLAIN: @d = constant i64 ptrtoint (double* getelementptr ([13 x double], [13 x double]* null, i64 0, i32 11) to i64)
-; PLAIN: @e = constant i64 ptrtoint (double* getelementptr ({ double, float, double, double }, { double, float, double, double }* null, i64 0, i32 2) to i64)
-; PLAIN: @f = constant i64 ptrtoint (<{ i16, i128 }>* getelementptr ({ i1, <{ i16, i128 }> }, { i1, <{ i16, i128 }> }* null, i64 0, i32 1) to i64)
-; PLAIN: @g = constant i64 ptrtoint ({ double, double }* getelementptr ({ i1, { double, double } }, { i1, { double, double } }* null, i64 0, i32 1) to i64)
-; PLAIN: @h = constant i64 ptrtoint (double** getelementptr (double*, double** null, i64 1) to i64)
-; PLAIN: @i = constant i64 ptrtoint (double** getelementptr ({ i1, double* }, { i1, double* }* null, i64 0, i32 1) to i64)
+; PLAIN: @a = constant i64 mul (i64 ptrtoint (ptr getelementptr ({ [7 x double], [7 x double] }, ptr null, i64 11) to i64), i64 15)
+; PLAIN: @b = constant i64 ptrtoint (ptr getelementptr ({ i1, [13 x double] }, ptr null, i64 0, i32 1) to i64)
+; PLAIN: @c = constant i64 ptrtoint (ptr getelementptr ({ double, double, double, double }, ptr null, i64 0, i32 2) to i64)
+; PLAIN: @d = constant i64 ptrtoint (ptr getelementptr ([13 x double], ptr null, i64 0, i32 11) to i64)
+; PLAIN: @e = constant i64 ptrtoint (ptr getelementptr ({ double, float, double, double }, ptr null, i64 0, i32 2) to i64)
+; PLAIN: @f = constant i64 ptrtoint (ptr getelementptr ({ i1, <{ i16, i128 }> }, ptr null, i64 0, i32 1) to i64)
+; PLAIN: @g = constant i64 ptrtoint (ptr getelementptr ({ i1, { double, double } }, ptr null, i64 0, i32 1) to i64)
+; PLAIN: @h = constant i64 ptrtoint (ptr getelementptr (ptr, ptr null, i64 1) to i64)
+; PLAIN: @i = constant i64 ptrtoint (ptr getelementptr ({ i1, ptr }, ptr null, i64 0, i32 1) to i64)
; OPT: @a = local_unnamed_addr constant i64 18480
; OPT: @b = local_unnamed_addr constant i64 8
; OPT: @c = local_unnamed_addr constant i64 16
@@ -76,184 +76,184 @@
; TO: @h = local_unnamed_addr constant i64 8
; TO: @i = local_unnamed_addr constant i64 8
- at a = constant i64 mul (i64 3, i64 mul (i64 ptrtoint ({[7 x double], [7 x double]}* getelementptr ({[7 x double], [7 x double]}, {[7 x double], [7 x double]}* null, i64 11) to i64), i64 5))
- at b = constant i64 ptrtoint ([13 x double]* getelementptr ({i1, [13 x double]}, {i1, [13 x double]}* null, i64 0, i32 1) to i64)
- at c = constant i64 ptrtoint (double* getelementptr ({double, double, double, double}, {double, double, double, double}* null, i64 0, i32 2) to i64)
- at d = constant i64 ptrtoint (double* getelementptr ([13 x double], [13 x double]* null, i64 0, i32 11) to i64)
- at e = constant i64 ptrtoint (double* getelementptr ({double, float, double, double}, {double, float, double, double}* null, i64 0, i32 2) to i64)
- at f = constant i64 ptrtoint (<{ i16, i128 }>* getelementptr ({i1, <{ i16, i128 }>}, {i1, <{ i16, i128 }>}* null, i64 0, i32 1) to i64)
- at g = constant i64 ptrtoint ({double, double}* getelementptr ({i1, {double, double}}, {i1, {double, double}}* null, i64 0, i32 1) to i64)
- at h = constant i64 ptrtoint (double** getelementptr (double*, double** null, i64 1) to i64)
- at i = constant i64 ptrtoint (double** getelementptr ({i1, double*}, {i1, double*}* null, i64 0, i32 1) to i64)
+ at a = constant i64 mul (i64 3, i64 mul (i64 ptrtoint (ptr getelementptr ({[7 x double], [7 x double]}, ptr null, i64 11) to i64), i64 5))
+ at b = constant i64 ptrtoint (ptr getelementptr ({i1, [13 x double]}, ptr null, i64 0, i32 1) to i64)
+ at c = constant i64 ptrtoint (ptr getelementptr ({double, double, double, double}, ptr null, i64 0, i32 2) to i64)
+ at d = constant i64 ptrtoint (ptr getelementptr ([13 x double], ptr null, i64 0, i32 11) to i64)
+ at e = constant i64 ptrtoint (ptr getelementptr ({double, float, double, double}, ptr null, i64 0, i32 2) to i64)
+ at f = constant i64 ptrtoint (ptr getelementptr ({i1, <{ i16, i128 }>}, ptr null, i64 0, i32 1) to i64)
+ at g = constant i64 ptrtoint (ptr getelementptr ({i1, {double, double}}, ptr null, i64 0, i32 1) to i64)
+ at h = constant i64 ptrtoint (ptr getelementptr (ptr, ptr null, i64 1) to i64)
+ at i = constant i64 ptrtoint (ptr getelementptr ({i1, ptr}, ptr null, i64 0, i32 1) to i64)
; The target-dependent folder should cast GEP indices to integer-sized pointers.
-; PLAIN: @M = constant i64* getelementptr (i64, i64* null, i32 1)
-; PLAIN: @N = constant i64* getelementptr ({ i64, i64 }, { i64, i64 }* null, i32 0, i32 1)
-; PLAIN: @O = constant i64* getelementptr ([2 x i64], [2 x i64]* null, i32 0, i32 1)
-; OPT: @M = local_unnamed_addr constant i64* inttoptr (i64 8 to i64*)
-; OPT: @N = local_unnamed_addr constant i64* inttoptr (i64 8 to i64*)
-; OPT: @O = local_unnamed_addr constant i64* inttoptr (i64 8 to i64*)
-; TO: @M = local_unnamed_addr constant i64* inttoptr (i64 8 to i64*)
-; TO: @N = local_unnamed_addr constant i64* inttoptr (i64 8 to i64*)
-; TO: @O = local_unnamed_addr constant i64* inttoptr (i64 8 to i64*)
+; PLAIN: @M = constant ptr getelementptr (i64, ptr null, i32 1)
+; PLAIN: @N = constant ptr getelementptr ({ i64, i64 }, ptr null, i32 0, i32 1)
+; PLAIN: @O = constant ptr getelementptr ([2 x i64], ptr null, i32 0, i32 1)
+; OPT: @M = local_unnamed_addr constant ptr inttoptr (i64 8 to ptr)
+; OPT: @N = local_unnamed_addr constant ptr inttoptr (i64 8 to ptr)
+; OPT: @O = local_unnamed_addr constant ptr inttoptr (i64 8 to ptr)
+; TO: @M = local_unnamed_addr constant ptr inttoptr (i64 8 to ptr)
+; TO: @N = local_unnamed_addr constant ptr inttoptr (i64 8 to ptr)
+; TO: @O = local_unnamed_addr constant ptr inttoptr (i64 8 to ptr)
- at M = constant i64* getelementptr (i64, i64* null, i32 1)
- at N = constant i64* getelementptr ({ i64, i64 }, { i64, i64 }* null, i32 0, i32 1)
- at O = constant i64* getelementptr ([2 x i64], [2 x i64]* null, i32 0, i32 1)
+ at M = constant ptr getelementptr (i64, ptr null, i32 1)
+ at N = constant ptr getelementptr ({ i64, i64 }, ptr null, i32 0, i32 1)
+ at O = constant ptr getelementptr ([2 x i64], ptr null, i32 0, i32 1)
; Fold GEP of a GEP. Very simple cases are folded without targetdata.
-; PLAIN: @Y = global [3 x { i32, i32 }]* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 2)
-; PLAIN: @Z = global i32* getelementptr inbounds (i32, i32* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 0), i64 1)
-; OPT: @Y = local_unnamed_addr global [3 x { i32, i32 }]* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 2)
-; OPT: @Z = local_unnamed_addr global i32* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 1)
-; TO: @Y = local_unnamed_addr global [3 x { i32, i32 }]* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 2)
-; TO: @Z = local_unnamed_addr global i32* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 1)
+; PLAIN: @Y = global ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 2)
+; PLAIN: @Z = global ptr getelementptr inbounds (i32, ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 0, i64 1, i32 0), i64 1)
+; OPT: @Y = local_unnamed_addr global ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 2)
+; OPT: @Z = local_unnamed_addr global ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 0, i64 1, i32 1)
+; TO: @Y = local_unnamed_addr global ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 2)
+; TO: @Z = local_unnamed_addr global ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 0, i64 1, i32 1)
@ext = external global [3 x { i32, i32 }]
- at Y = global [3 x { i32, i32 }]* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 1), i64 1)
- at Z = global i32* getelementptr inbounds (i32, i32* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 0), i64 1)
+ at Y = global ptr getelementptr inbounds ([3 x { i32, i32 }], ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 1), i64 1)
+ at Z = global ptr getelementptr inbounds (i32, ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 0, i64 1, i32 0), i64 1)
; Duplicate all of the above as function return values rather than
; global initializers.
-; PLAIN: define i8* @goo8() #0 {
-; PLAIN: %t = bitcast i8* getelementptr (i8, i8* inttoptr (i32 1 to i8*), i32 -1) to i8*
-; PLAIN: ret i8* %t
+; PLAIN: define ptr @goo8() #0 {
+; PLAIN: %t = bitcast ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; PLAIN: define i1* @goo1() #0 {
-; PLAIN: %t = bitcast i1* getelementptr (i1, i1* inttoptr (i32 1 to i1*), i32 -1) to i1*
-; PLAIN: ret i1* %t
+; PLAIN: define ptr @goo1() #0 {
+; PLAIN: %t = bitcast ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; PLAIN: define i8* @foo8() #0 {
-; PLAIN: %t = bitcast i8* getelementptr (i8, i8* inttoptr (i32 1 to i8*), i32 -2) to i8*
-; PLAIN: ret i8* %t
+; PLAIN: define ptr @foo8() #0 {
+; PLAIN: %t = bitcast ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -2) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; PLAIN: define i1* @foo1() #0 {
-; PLAIN: %t = bitcast i1* getelementptr (i1, i1* inttoptr (i32 1 to i1*), i32 -2) to i1*
-; PLAIN: ret i1* %t
+; PLAIN: define ptr @foo1() #0 {
+; PLAIN: %t = bitcast ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -2) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; PLAIN: define i8* @hoo8() #0 {
-; PLAIN: %t = bitcast i8* getelementptr (i8, i8* null, i32 -1) to i8*
-; PLAIN: ret i8* %t
+; PLAIN: define ptr @hoo8() #0 {
+; PLAIN: %t = bitcast ptr getelementptr (i8, ptr null, i32 -1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; PLAIN: define i1* @hoo1() #0 {
-; PLAIN: %t = bitcast i1* getelementptr (i1, i1* null, i32 -1) to i1*
-; PLAIN: ret i1* %t
+; PLAIN: define ptr @hoo1() #0 {
+; PLAIN: %t = bitcast ptr getelementptr (i1, ptr null, i32 -1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; OPT: define i8* @goo8() local_unnamed_addr #0 {
-; OPT: ret i8* null
+; OPT: define ptr @goo8() local_unnamed_addr #0 {
+; OPT: ret ptr null
; OPT: }
-; OPT: define i1* @goo1() local_unnamed_addr #0 {
-; OPT: ret i1* null
+; OPT: define ptr @goo1() local_unnamed_addr #0 {
+; OPT: ret ptr null
; OPT: }
-; OPT: define i8* @foo8() local_unnamed_addr #0 {
-; OPT: ret i8* inttoptr (i64 -1 to i8*)
+; OPT: define ptr @foo8() local_unnamed_addr #0 {
+; OPT: ret ptr inttoptr (i64 -1 to ptr)
; OPT: }
-; OPT: define i1* @foo1() local_unnamed_addr #0 {
-; OPT: ret i1* inttoptr (i64 -1 to i1*)
+; OPT: define ptr @foo1() local_unnamed_addr #0 {
+; OPT: ret ptr inttoptr (i64 -1 to ptr)
; OPT: }
-; OPT: define i8* @hoo8() local_unnamed_addr #0 {
-; OPT: ret i8* inttoptr (i64 -1 to i8*)
+; OPT: define ptr @hoo8() local_unnamed_addr #0 {
+; OPT: ret ptr inttoptr (i64 -1 to ptr)
; OPT: }
-; OPT: define i1* @hoo1() local_unnamed_addr #0 {
-; OPT: ret i1* inttoptr (i64 -1 to i1*)
+; OPT: define ptr @hoo1() local_unnamed_addr #0 {
+; OPT: ret ptr inttoptr (i64 -1 to ptr)
; OPT: }
-; TO: define i8* @goo8() local_unnamed_addr #0 {
-; TO: ret i8* null
+; TO: define ptr @goo8() local_unnamed_addr #0 {
+; TO: ret ptr null
; TO: }
-; TO: define i1* @goo1() local_unnamed_addr #0 {
-; TO: ret i1* null
+; TO: define ptr @goo1() local_unnamed_addr #0 {
+; TO: ret ptr null
; TO: }
-; TO: define i8* @foo8() local_unnamed_addr #0 {
-; TO: ret i8* inttoptr (i64 -1 to i8*)
+; TO: define ptr @foo8() local_unnamed_addr #0 {
+; TO: ret ptr inttoptr (i64 -1 to ptr)
; TO: }
-; TO: define i1* @foo1() local_unnamed_addr #0 {
-; TO: ret i1* inttoptr (i64 -1 to i1*)
+; TO: define ptr @foo1() local_unnamed_addr #0 {
+; TO: ret ptr inttoptr (i64 -1 to ptr)
; TO: }
-; TO: define i8* @hoo8() local_unnamed_addr #0 {
-; TO: ret i8* inttoptr (i64 -1 to i8*)
+; TO: define ptr @hoo8() local_unnamed_addr #0 {
+; TO: ret ptr inttoptr (i64 -1 to ptr)
; TO: }
-; TO: define i1* @hoo1() local_unnamed_addr #0 {
-; TO: ret i1* inttoptr (i64 -1 to i1*)
+; TO: define ptr @hoo1() local_unnamed_addr #0 {
+; TO: ret ptr inttoptr (i64 -1 to ptr)
; TO: }
; SCEV: Classifying expressions for: @goo8
-; SCEV: %t = bitcast i8* getelementptr (i8, i8* inttoptr (i32 1 to i8*), i32 -1) to i8*
-; SCEV: --> (-1 + inttoptr (i32 1 to i8*))
+; SCEV: %t = bitcast ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -1) to ptr
+; SCEV: --> (-1 + inttoptr (i32 1 to ptr))
; SCEV: Classifying expressions for: @goo1
-; SCEV: %t = bitcast i1* getelementptr (i1, i1* inttoptr (i32 1 to i1*), i32 -1) to i1*
-; SCEV: --> (-1 + inttoptr (i32 1 to i1*))
+; SCEV: %t = bitcast ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -1) to ptr
+; SCEV: --> (-1 + inttoptr (i32 1 to ptr))
; SCEV: Classifying expressions for: @foo8
-; SCEV: %t = bitcast i8* getelementptr (i8, i8* inttoptr (i32 1 to i8*), i32 -2) to i8*
-; SCEV: --> (-2 + inttoptr (i32 1 to i8*))
+; SCEV: %t = bitcast ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -2) to ptr
+; SCEV: --> (-2 + inttoptr (i32 1 to ptr))
; SCEV: Classifying expressions for: @foo1
-; SCEV: %t = bitcast i1* getelementptr (i1, i1* inttoptr (i32 1 to i1*), i32 -2) to i1*
-; SCEV: --> (-2 + inttoptr (i32 1 to i1*))
+; SCEV: %t = bitcast ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -2) to ptr
+; SCEV: --> (-2 + inttoptr (i32 1 to ptr))
; SCEV: Classifying expressions for: @hoo8
; SCEV: --> (-1 + null)<nuw><nsw> U: [-1,0) S: [-1,0)
; SCEV: Classifying expressions for: @hoo1
; SCEV: --> (-1 + null)<nuw><nsw> U: [-1,0) S: [-1,0)
-define i8* @goo8() nounwind {
- %t = bitcast i8* getelementptr (i8, i8* inttoptr (i32 1 to i8*), i32 -1) to i8*
- ret i8* %t
+define ptr @goo8() nounwind {
+ %t = bitcast ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -1) to ptr
+ ret ptr %t
}
-define i1* @goo1() nounwind {
- %t = bitcast i1* getelementptr (i1, i1* inttoptr (i32 1 to i1*), i32 -1) to i1*
- ret i1* %t
+define ptr @goo1() nounwind {
+ %t = bitcast ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -1) to ptr
+ ret ptr %t
}
-define i8* @foo8() nounwind {
- %t = bitcast i8* getelementptr (i8, i8* inttoptr (i32 1 to i8*), i32 -2) to i8*
- ret i8* %t
+define ptr @foo8() nounwind {
+ %t = bitcast ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -2) to ptr
+ ret ptr %t
}
-define i1* @foo1() nounwind {
- %t = bitcast i1* getelementptr (i1, i1* inttoptr (i32 1 to i1*), i32 -2) to i1*
- ret i1* %t
+define ptr @foo1() nounwind {
+ %t = bitcast ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -2) to ptr
+ ret ptr %t
}
-define i8* @hoo8() nounwind {
- %t = bitcast i8* getelementptr (i8, i8* inttoptr (i32 0 to i8*), i32 -1) to i8*
- ret i8* %t
+define ptr @hoo8() nounwind {
+ %t = bitcast ptr getelementptr (i8, ptr inttoptr (i32 0 to ptr), i32 -1) to ptr
+ ret ptr %t
}
-define i1* @hoo1() nounwind {
- %t = bitcast i1* getelementptr (i1, i1* inttoptr (i32 0 to i1*), i32 -1) to i1*
- ret i1* %t
+define ptr @hoo1() nounwind {
+ %t = bitcast ptr getelementptr (i1, ptr inttoptr (i32 0 to ptr), i32 -1) to ptr
+ ret ptr %t
}
; PLAIN: define i64 @fa() #0 {
-; PLAIN: %t = bitcast i64 mul (i64 ptrtoint ({ [7 x double], [7 x double] }* getelementptr ({ [7 x double], [7 x double] }, { [7 x double], [7 x double] }* null, i64 11) to i64), i64 15) to i64
+; PLAIN: %t = bitcast i64 mul (i64 ptrtoint (ptr getelementptr ({ [7 x double], [7 x double] }, ptr null, i64 11) to i64), i64 15) to i64
; PLAIN: ret i64 %t
; PLAIN: }
; PLAIN: define i64 @fb() #0 {
-; PLAIN: %t = bitcast i64 ptrtoint ([13 x double]* getelementptr ({ i1, [13 x double] }, { i1, [13 x double] }* null, i64 0, i32 1) to i64) to i64
+; PLAIN: %t = bitcast i64 ptrtoint (ptr getelementptr ({ i1, [13 x double] }, ptr null, i64 0, i32 1) to i64) to i64
; PLAIN: ret i64 %t
; PLAIN: }
; PLAIN: define i64 @fc() #0 {
-; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr ({ double, double, double, double }, { double, double, double, double }* null, i64 0, i32 2) to i64) to i64
+; PLAIN: %t = bitcast i64 ptrtoint (ptr getelementptr ({ double, double, double, double }, ptr null, i64 0, i32 2) to i64) to i64
; PLAIN: ret i64 %t
; PLAIN: }
; PLAIN: define i64 @fd() #0 {
-; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr ([13 x double], [13 x double]* null, i64 0, i32 11) to i64) to i64
+; PLAIN: %t = bitcast i64 ptrtoint (ptr getelementptr ([13 x double], ptr null, i64 0, i32 11) to i64) to i64
; PLAIN: ret i64 %t
; PLAIN: }
; PLAIN: define i64 @fe() #0 {
-; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr ({ double, float, double, double }, { double, float, double, double }* null, i64 0, i32 2) to i64) to i64
+; PLAIN: %t = bitcast i64 ptrtoint (ptr getelementptr ({ double, float, double, double }, ptr null, i64 0, i32 2) to i64) to i64
; PLAIN: ret i64 %t
; PLAIN: }
; PLAIN: define i64 @ff() #0 {
-; PLAIN: %t = bitcast i64 ptrtoint (<{ i16, i128 }>* getelementptr ({ i1, <{ i16, i128 }> }, { i1, <{ i16, i128 }> }* null, i64 0, i32 1) to i64) to i64
+; PLAIN: %t = bitcast i64 ptrtoint (ptr getelementptr ({ i1, <{ i16, i128 }> }, ptr null, i64 0, i32 1) to i64) to i64
; PLAIN: ret i64 %t
; PLAIN: }
; PLAIN: define i64 @fg() #0 {
-; PLAIN: %t = bitcast i64 ptrtoint ({ double, double }* getelementptr ({ i1, { double, double } }, { i1, { double, double } }* null, i64 0, i32 1) to i64) to i64
+; PLAIN: %t = bitcast i64 ptrtoint (ptr getelementptr ({ i1, { double, double } }, ptr null, i64 0, i32 1) to i64) to i64
; PLAIN: ret i64 %t
; PLAIN: }
; PLAIN: define i64 @fh() #0 {
-; PLAIN: %t = bitcast i64 ptrtoint (double** getelementptr (double*, double** null, i32 1) to i64) to i64
+; PLAIN: %t = bitcast i64 ptrtoint (ptr getelementptr (ptr, ptr null, i32 1) to i64) to i64
; PLAIN: ret i64 %t
; PLAIN: }
; PLAIN: define i64 @fi() #0 {
-; PLAIN: %t = bitcast i64 ptrtoint (double** getelementptr ({ i1, double* }, { i1, double* }* null, i64 0, i32 1) to i64) to i64
+; PLAIN: %t = bitcast i64 ptrtoint (ptr getelementptr ({ i1, ptr }, ptr null, i64 0, i32 1) to i64) to i64
; PLAIN: ret i64 %t
; PLAIN: }
; OPT: define i64 @fa() local_unnamed_addr #0 {
@@ -311,140 +311,140 @@ define i1* @hoo1() nounwind {
; TO: ret i64 8
; TO: }
; SCEV-LABEL: Classifying expressions for: @fa
-; SCEV: %t = bitcast i64 mul (i64 ptrtoint ({ [7 x double], [7 x double] }* getelementptr ({ [7 x double], [7 x double] }, { [7 x double], [7 x double] }* null, i64 11) to i64), i64 15) to i64
+; SCEV: %t = bitcast i64 mul (i64 ptrtoint (ptr getelementptr ({ [7 x double], [7 x double] }, ptr null, i64 11) to i64), i64 15) to i64
; SCEV: --> 18480
; SCEV-LABEL: Classifying expressions for: @fb
-; SCEV: %t = bitcast i64 ptrtoint ([13 x double]* getelementptr ({ i1, [13 x double] }, { i1, [13 x double] }* null, i64 0, i32 1) to i64) to i64
+; SCEV: %t = bitcast i64 ptrtoint (ptr getelementptr ({ i1, [13 x double] }, ptr null, i64 0, i32 1) to i64) to i64
; SCEV: --> 8
; SCEV-LABEL: Classifying expressions for: @fc
-; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr ({ double, double, double, double }, { double, double, double, double }* null, i64 0, i32 2) to i64) to i64
+; SCEV: %t = bitcast i64 ptrtoint (ptr getelementptr ({ double, double, double, double }, ptr null, i64 0, i32 2) to i64) to i64
; SCEV: --> 16
; SCEV-LABEL: Classifying expressions for: @fd
-; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr ([13 x double], [13 x double]* null, i64 0, i32 11) to i64) to i64
+; SCEV: %t = bitcast i64 ptrtoint (ptr getelementptr ([13 x double], ptr null, i64 0, i32 11) to i64) to i64
; SCEV: --> 88
; SCEV-LABEL: Classifying expressions for: @fe
-; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr ({ double, float, double, double }, { double, float, double, double }* null, i64 0, i32 2) to i64) to i64
+; SCEV: %t = bitcast i64 ptrtoint (ptr getelementptr ({ double, float, double, double }, ptr null, i64 0, i32 2) to i64) to i64
; SCEV: --> 16
; SCEV-LABEL: Classifying expressions for: @ff
-; SCEV: %t = bitcast i64 ptrtoint (<{ i16, i128 }>* getelementptr ({ i1, <{ i16, i128 }> }, { i1, <{ i16, i128 }> }* null, i64 0, i32 1) to i64) to i64
+; SCEV: %t = bitcast i64 ptrtoint (ptr getelementptr ({ i1, <{ i16, i128 }> }, ptr null, i64 0, i32 1) to i64) to i64
; SCEV: --> 1
; SCEV-LABEL: Classifying expressions for: @fg
-; SCEV: %t = bitcast i64 ptrtoint ({ double, double }* getelementptr ({ i1, { double, double } }, { i1, { double, double } }* null, i64 0, i32 1) to i64) to i64
+; SCEV: %t = bitcast i64 ptrtoint (ptr getelementptr ({ i1, { double, double } }, ptr null, i64 0, i32 1) to i64) to i64
; SCEV: --> 8
; SCEV-LABEL: Classifying expressions for: @fh
-; SCEV: %t = bitcast i64 ptrtoint (double** getelementptr (double*, double** null, i32 1) to i64) to i64
+; SCEV: %t = bitcast i64 ptrtoint (ptr getelementptr (ptr, ptr null, i32 1) to i64) to i64
; SCEV: --> 8
; SCEV-LABEL: Classifying expressions for: @fi
-; SCEV: %t = bitcast i64 ptrtoint (double** getelementptr ({ i1, double* }, { i1, double* }* null, i64 0, i32 1) to i64) to i64
+; SCEV: %t = bitcast i64 ptrtoint (ptr getelementptr ({ i1, ptr }, ptr null, i64 0, i32 1) to i64) to i64
; SCEV: --> 8
define i64 @fa() nounwind {
- %t = bitcast i64 mul (i64 3, i64 mul (i64 ptrtoint ({[7 x double], [7 x double]}* getelementptr ({[7 x double], [7 x double]}, {[7 x double], [7 x double]}* null, i64 11) to i64), i64 5)) to i64
+ %t = bitcast i64 mul (i64 3, i64 mul (i64 ptrtoint (ptr getelementptr ({[7 x double], [7 x double]}, ptr null, i64 11) to i64), i64 5)) to i64
ret i64 %t
}
define i64 @fb() nounwind {
- %t = bitcast i64 ptrtoint ([13 x double]* getelementptr ({i1, [13 x double]}, {i1, [13 x double]}* null, i64 0, i32 1) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr getelementptr ({i1, [13 x double]}, ptr null, i64 0, i32 1) to i64) to i64
ret i64 %t
}
define i64 @fc() nounwind {
- %t = bitcast i64 ptrtoint (double* getelementptr ({double, double, double, double}, {double, double, double, double}* null, i64 0, i32 2) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr getelementptr ({double, double, double, double}, ptr null, i64 0, i32 2) to i64) to i64
ret i64 %t
}
define i64 @fd() nounwind {
- %t = bitcast i64 ptrtoint (double* getelementptr ([13 x double], [13 x double]* null, i64 0, i32 11) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr getelementptr ([13 x double], ptr null, i64 0, i32 11) to i64) to i64
ret i64 %t
}
define i64 @fe() nounwind {
- %t = bitcast i64 ptrtoint (double* getelementptr ({double, float, double, double}, {double, float, double, double}* null, i64 0, i32 2) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr getelementptr ({double, float, double, double}, ptr null, i64 0, i32 2) to i64) to i64
ret i64 %t
}
define i64 @ff() nounwind {
- %t = bitcast i64 ptrtoint (<{ i16, i128 }>* getelementptr ({i1, <{ i16, i128 }>}, {i1, <{ i16, i128 }>}* null, i64 0, i32 1) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr getelementptr ({i1, <{ i16, i128 }>}, ptr null, i64 0, i32 1) to i64) to i64
ret i64 %t
}
define i64 @fg() nounwind {
- %t = bitcast i64 ptrtoint ({double, double}* getelementptr ({i1, {double, double}}, {i1, {double, double}}* null, i64 0, i32 1) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr getelementptr ({i1, {double, double}}, ptr null, i64 0, i32 1) to i64) to i64
ret i64 %t
}
define i64 @fh() nounwind {
- %t = bitcast i64 ptrtoint (double** getelementptr (double*, double** null, i32 1) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr getelementptr (ptr, ptr null, i32 1) to i64) to i64
ret i64 %t
}
define i64 @fi() nounwind {
- %t = bitcast i64 ptrtoint (double** getelementptr ({i1, double*}, {i1, double*}* null, i64 0, i32 1) to i64) to i64
+ %t = bitcast i64 ptrtoint (ptr getelementptr ({i1, ptr}, ptr null, i64 0, i32 1) to i64) to i64
ret i64 %t
}
-; PLAIN: define i64* @fM() #0 {
-; PLAIN: %t = bitcast i64* getelementptr (i64, i64* null, i32 1) to i64*
-; PLAIN: ret i64* %t
+; PLAIN: define ptr @fM() #0 {
+; PLAIN: %t = bitcast ptr getelementptr (i64, ptr null, i32 1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; PLAIN: define i64* @fN() #0 {
-; PLAIN: %t = bitcast i64* getelementptr ({ i64, i64 }, { i64, i64 }* null, i32 0, i32 1) to i64*
-; PLAIN: ret i64* %t
+; PLAIN: define ptr @fN() #0 {
+; PLAIN: %t = bitcast ptr getelementptr ({ i64, i64 }, ptr null, i32 0, i32 1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; PLAIN: define i64* @fO() #0 {
-; PLAIN: %t = bitcast i64* getelementptr ([2 x i64], [2 x i64]* null, i32 0, i32 1) to i64*
-; PLAIN: ret i64* %t
+; PLAIN: define ptr @fO() #0 {
+; PLAIN: %t = bitcast ptr getelementptr ([2 x i64], ptr null, i32 0, i32 1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; OPT: define i64* @fM() local_unnamed_addr #0 {
-; OPT: ret i64* inttoptr (i64 8 to i64*)
+; OPT: define ptr @fM() local_unnamed_addr #0 {
+; OPT: ret ptr inttoptr (i64 8 to ptr)
; OPT: }
-; OPT: define i64* @fN() local_unnamed_addr #0 {
-; OPT: ret i64* inttoptr (i64 8 to i64*)
+; OPT: define ptr @fN() local_unnamed_addr #0 {
+; OPT: ret ptr inttoptr (i64 8 to ptr)
; OPT: }
-; OPT: define i64* @fO() local_unnamed_addr #0 {
-; OPT: ret i64* inttoptr (i64 8 to i64*)
+; OPT: define ptr @fO() local_unnamed_addr #0 {
+; OPT: ret ptr inttoptr (i64 8 to ptr)
; OPT: }
-; TO: define i64* @fM() local_unnamed_addr #0 {
-; TO: ret i64* inttoptr (i64 8 to i64*)
+; TO: define ptr @fM() local_unnamed_addr #0 {
+; TO: ret ptr inttoptr (i64 8 to ptr)
; TO: }
-; TO: define i64* @fN() local_unnamed_addr #0 {
-; TO: ret i64* inttoptr (i64 8 to i64*)
+; TO: define ptr @fN() local_unnamed_addr #0 {
+; TO: ret ptr inttoptr (i64 8 to ptr)
; TO: }
-; TO: define i64* @fO() local_unnamed_addr #0 {
-; TO: ret i64* inttoptr (i64 8 to i64*)
+; TO: define ptr @fO() local_unnamed_addr #0 {
+; TO: ret ptr inttoptr (i64 8 to ptr)
; TO: }
; SCEV: Classifying expressions for: @fM
-; SCEV: %t = bitcast i64* getelementptr (i64, i64* null, i32 1) to i64*
+; SCEV: %t = bitcast ptr getelementptr (i64, ptr null, i32 1) to ptr
; SCEV: --> (8 + null)<nuw><nsw> U: [8,9) S: [8,9)
; SCEV: Classifying expressions for: @fN
-; SCEV: %t = bitcast i64* getelementptr ({ i64, i64 }, { i64, i64 }* null, i32 0, i32 1) to i64*
+; SCEV: %t = bitcast ptr getelementptr ({ i64, i64 }, ptr null, i32 0, i32 1) to ptr
; SCEV: --> (8 + null)<nuw><nsw> U: [8,9) S: [8,9)
; SCEV: Classifying expressions for: @fO
-; SCEV: %t = bitcast i64* getelementptr ([2 x i64], [2 x i64]* null, i32 0, i32 1) to i64*
+; SCEV: %t = bitcast ptr getelementptr ([2 x i64], ptr null, i32 0, i32 1) to ptr
; SCEV: --> (8 + null)<nuw><nsw> U: [8,9) S: [8,9)
-define i64* @fM() nounwind {
- %t = bitcast i64* getelementptr (i64, i64* null, i32 1) to i64*
- ret i64* %t
+define ptr @fM() nounwind {
+ %t = bitcast ptr getelementptr (i64, ptr null, i32 1) to ptr
+ ret ptr %t
}
-define i64* @fN() nounwind {
- %t = bitcast i64* getelementptr ({ i64, i64 }, { i64, i64 }* null, i32 0, i32 1) to i64*
- ret i64* %t
+define ptr @fN() nounwind {
+ %t = bitcast ptr getelementptr ({ i64, i64 }, ptr null, i32 0, i32 1) to ptr
+ ret ptr %t
}
-define i64* @fO() nounwind {
- %t = bitcast i64* getelementptr ([2 x i64], [2 x i64]* null, i32 0, i32 1) to i64*
- ret i64* %t
+define ptr @fO() nounwind {
+ %t = bitcast ptr getelementptr ([2 x i64], ptr null, i32 0, i32 1) to ptr
+ ret ptr %t
}
-; PLAIN: define i32* @fZ() #0 {
-; PLAIN: %t = bitcast i32* getelementptr inbounds (i32, i32* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 0), i64 1) to i32*
-; PLAIN: ret i32* %t
+; PLAIN: define ptr @fZ() #0 {
+; PLAIN: %t = bitcast ptr getelementptr inbounds (i32, ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 0, i64 1, i32 0), i64 1) to ptr
+; PLAIN: ret ptr %t
; PLAIN: }
-; OPT: define i32* @fZ() local_unnamed_addr #0 {
-; OPT: ret i32* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 1)
+; OPT: define ptr @fZ() local_unnamed_addr #0 {
+; OPT: ret ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 0, i64 1, i32 1)
; OPT: }
-; TO: define i32* @fZ() local_unnamed_addr #0 {
-; TO: ret i32* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 1)
+; TO: define ptr @fZ() local_unnamed_addr #0 {
+; TO: ret ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 0, i64 1, i32 1)
; TO: }
; SCEV: Classifying expressions for: @fZ
-; SCEV: %t = bitcast i32* getelementptr inbounds (i32, i32* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 0), i64 1) to i32*
+; SCEV: %t = bitcast ptr getelementptr inbounds (i32, ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 0, i64 1, i32 0), i64 1) to ptr
; SCEV: --> (12 + @ext)
-define i32* @fZ() nounwind {
- %t = bitcast i32* getelementptr inbounds (i32, i32* getelementptr inbounds ([3 x { i32, i32 }], [3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 0), i64 1) to i32*
- ret i32* %t
+define ptr @fZ() nounwind {
+ %t = bitcast ptr getelementptr inbounds (i32, ptr getelementptr inbounds ([3 x { i32, i32 }], ptr @ext, i64 0, i64 1, i32 0), i64 1) to ptr
+ ret ptr %t
}
; PR15262 - Check GEP folding with casts between address spaces.
@@ -452,19 +452,19 @@ define i32* @fZ() nounwind {
@p0 = global [4 x i8] zeroinitializer, align 1
@p12 = addrspace(12) global [4 x i8] zeroinitializer, align 1
-define i8* @
diff erent_addrspace() nounwind noinline {
+define ptr @
diff erent_addrspace() nounwind noinline {
; OPT:
diff erent_addrspace
- %p = getelementptr inbounds i8, i8* addrspacecast ([4 x i8] addrspace(12)* @p12 to i8*),
+ %p = getelementptr inbounds i8, ptr addrspacecast (ptr addrspace(12) @p12 to ptr),
i32 2
- ret i8* %p
-; OPT: ret i8* getelementptr ([4 x i8], [4 x i8]* addrspacecast ([4 x i8] addrspace(12)* @p12 to [4 x i8]*), i64 0, i64 2)
+ ret ptr %p
+; OPT: ret ptr getelementptr (i8, ptr addrspacecast (ptr addrspace(12) @p12 to ptr), i64 2)
}
-define i8* @same_addrspace() nounwind noinline {
+define ptr @same_addrspace() nounwind noinline {
; OPT: same_addrspace
- %p = getelementptr inbounds i8, i8* bitcast ([4 x i8] * @p0 to i8*), i32 2
- ret i8* %p
-; OPT: ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @p0, i64 0, i64 2)
+ %p = getelementptr inbounds i8, ptr @p0, i32 2
+ ret ptr %p
+; OPT: ret ptr getelementptr inbounds ([4 x i8], ptr @p0, i64 0, i64 2)
}
@gv1 = internal global i32 1
@@ -473,13 +473,13 @@ define i8* @same_addrspace() nounwind noinline {
; Handled by TI-independent constant folder
define i1 @gv_gep_vs_gv() {
- ret i1 icmp eq (i32* getelementptr inbounds ([1 x i32], [1 x i32]* @gv2, i32 0, i32 0), i32* @gv1)
+ ret i1 icmp eq (ptr @gv2, ptr @gv1)
}
; PLAIN: gv_gep_vs_gv
; PLAIN: ret i1 false
define i1 @gv_gep_vs_gv_gep() {
- ret i1 icmp eq (i32* getelementptr inbounds ([1 x i32], [1 x i32]* @gv2, i32 0, i32 0), i32* getelementptr inbounds ([1 x i32], [1 x i32]* @gv3, i32 0, i32 0))
+ ret i1 icmp eq (ptr @gv2, ptr @gv3)
}
; PLAIN: gv_gep_vs_gv_gep
; PLAIN: ret i1 false
diff --git a/llvm/test/Other/devirtualization-undef.ll b/llvm/test/Other/devirtualization-undef.ll
index 9099c575ac191..bfa4998204685 100644
--- a/llvm/test/Other/devirtualization-undef.ll
+++ b/llvm/test/Other/devirtualization-undef.ll
@@ -3,7 +3,7 @@
; CHECK: unreachable
declare void @llvm.assume(i1 noundef)
-declare i1 @bar(i8* nonnull dereferenceable(1))
+declare i1 @bar(ptr nonnull dereferenceable(1))
define void @foo() {
%a = call i1 null()
diff --git a/llvm/test/Other/force-opaque-ptrs.ll b/llvm/test/Other/force-opaque-ptrs.ll
index 895bbdb067568..25746bcb0938b 100644
--- a/llvm/test/Other/force-opaque-ptrs.ll
+++ b/llvm/test/Other/force-opaque-ptrs.ll
@@ -5,32 +5,32 @@
; RUN: opt --opaque-pointers < %s -S | FileCheck %s
; RUN: verify-uselistorder --opaque-pointers < %s
-%ty = type i32*
+%ty = type ptr
; CHECK: @g = external global i16
@g = external global i16
; CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1, ptr null, ptr null }]
- at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* null, i8* null }]
+ at llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1, ptr null, ptr null }]
; CHECK: @ga = alias i18, ptr @g2
@g2 = global i18 0
- at ga = alias i18, i18* @g2
+ at ga = alias i18, ptr @g2
; CHECK: @ga2 = alias i19, ptr @g2
- at ga2 = alias i19, i19* bitcast (i18* @g2 to i19*)
+ at ga2 = alias i19, ptr @g2
; CHECK: @gi = ifunc i20 (), ptr @resolver
- at gi = ifunc i20 (), i20 ()* ()* bitcast (i32* ()* @resolver to i20 ()* ()*)
+ at gi = ifunc i20 (), ptr @resolver
-define i32* @resolver() {
- %load = load i32, i32* @g.fwd
- %ptr = inttoptr i32 %load to i32*
- ret i32* %ptr
+define ptr @resolver() {
+ %load = load i32, ptr @g.fwd
+ %ptr = inttoptr i32 %load to ptr
+ ret ptr %ptr
}
-define void @f(i32* %p) {
+define void @f(ptr %p) {
; CHECK-LABEL: define {{[^@]+}}@f
; CHECK-SAME: (ptr [[P:%.*]]) {
; CHECK-NEXT: [[A:%.*]] = alloca i17, align 4
@@ -40,14 +40,14 @@ define void @f(i32* %p) {
;
%a = alloca i17
call void @fn.fwd(i32 0)
- store i32 0, i32* @g.fwd
+ store i32 0, ptr @g.fwd
ret void
}
@g.fwd = global i32 0
declare void @fn.fwd(i32)
-define void @f2(i32** %p) {
+define void @f2(ptr %p) {
; CHECK-LABEL: define {{[^@]+}}@f2
; CHECK-SAME: (ptr [[P:%.*]]) {
; CHECK-NEXT: unreachable
@@ -55,7 +55,7 @@ define void @f2(i32** %p) {
unreachable
}
-define void @f3(i32 addrspace(1)* addrspace(2)* %p) {
+define void @f3(ptr addrspace(2) %p) {
; CHECK-LABEL: define {{[^@]+}}@f3
; CHECK-SAME: (ptr addrspace(2) [[P:%.*]]) {
; CHECK-NEXT: unreachable
@@ -63,7 +63,7 @@ define void @f3(i32 addrspace(1)* addrspace(2)* %p) {
unreachable
}
-define void @f4(%ty* %p) {
+define void @f4(ptr %p) {
; CHECK-LABEL: define {{[^@]+}}@f4
; CHECK-SAME: (ptr [[P:%.*]]) {
; CHECK-NEXT: unreachable
@@ -79,20 +79,20 @@ define void @remangle_intrinsic() {
; CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.masked.expandload.v2i64(ptr null, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
; CHECK-NEXT: ret void
;
- %a = alloca i8*
- call i8* @llvm.stacksave()
- call void @llvm.stackprotector(i8* null, i8** %a)
- call <2 x i64> @llvm.masked.expandload.v2i64(i64* null, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
+ %a = alloca ptr
+ call ptr @llvm.stacksave()
+ call void @llvm.stackprotector(ptr null, ptr %a)
+ call <2 x i64> @llvm.masked.expandload.v2i64(ptr null, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
ret void
}
-define i32* @constexpr_gep() {
+define ptr @constexpr_gep() {
; CHECK-LABEL: define {{[^@]+}}@constexpr_gep() {
; CHECK-NEXT: ret ptr getelementptr (i32, ptr getelementptr (i8, ptr null, i64 4), i64 1)
;
- ret i32* getelementptr(i32, i32* bitcast (i8* getelementptr (i8, i8* null, i64 4) to i32*), i64 1)
+ ret ptr getelementptr(i32, ptr getelementptr (i8, ptr null, i64 4), i64 1)
}
-declare i8* @llvm.stacksave()
-declare void @llvm.stackprotector(i8*, i8**)
-declare <2 x i64> @llvm.masked.expandload.v2i64(i64*, <2 x i1>, <2 x i64>)
+declare ptr @llvm.stacksave()
+declare void @llvm.stackprotector(ptr, ptr)
+declare <2 x i64> @llvm.masked.expandload.v2i64(ptr, <2 x i1>, <2 x i64>)
diff --git a/llvm/test/Other/invariant.group.ll b/llvm/test/Other/invariant.group.ll
index 08edb4bbe5df6..d8dde8864b1ea 100644
--- a/llvm/test/Other/invariant.group.ll
+++ b/llvm/test/Other/invariant.group.ll
@@ -10,21 +10,21 @@
define i8 @optimizable() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr, !invariant.group !0
-; CHECK: call i8* @llvm.launder.invariant.group.p0i8
- %ptr2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
+ store i8 42, ptr %ptr, !invariant.group !0
+; CHECK: call ptr @llvm.launder.invariant.group.p0
+ %ptr2 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
; FIXME: This one could be CSE
-; CHECK: call i8* @llvm.launder.invariant.group
- %ptr3 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
-; CHECK: call void @clobber(i8* {{.*}}%ptr)
- call void @clobber(i8* %ptr)
+; CHECK: call ptr @llvm.launder.invariant.group
+ %ptr3 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
+; CHECK: call void @clobber(ptr {{.*}}%ptr)
+ call void @clobber(ptr %ptr)
-; CHECK: call void @use(i8* {{.*}}%ptr2)
- call void @use(i8* %ptr2)
-; CHECK: call void @use(i8* {{.*}}%ptr3)
- call void @use(i8* %ptr3)
-; CHECK: load i8, i8* %ptr3, {{.*}}!invariant.group
- %v = load i8, i8* %ptr3, !invariant.group !0
+; CHECK: call void @use(ptr {{.*}}%ptr2)
+ call void @use(ptr %ptr2)
+; CHECK: call void @use(ptr {{.*}}%ptr3)
+ call void @use(ptr %ptr3)
+; CHECK: load i8, ptr %ptr3, {{.*}}!invariant.group
+ %v = load i8, ptr %ptr3, !invariant.group !0
ret i8 %v
}
@@ -33,20 +33,20 @@ entry:
define i8 @unoptimizable() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr, !invariant.group !0
-; CHECK: call i8* @llvm.launder.invariant.group.p0i8
- %ptr2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
- call void @clobber(i8* %ptr)
-; CHECK: call i8* @llvm.launder.invariant.group.p0i8
- %ptr3 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
-; CHECK: call void @clobber(i8* {{.*}}%ptr)
- call void @clobber(i8* %ptr)
-; CHECK: call void @use(i8* {{.*}}%ptr2)
- call void @use(i8* %ptr2)
-; CHECK: call void @use(i8* {{.*}}%ptr3)
- call void @use(i8* %ptr3)
-; CHECK: load i8, i8* %ptr3, {{.*}}!invariant.group
- %v = load i8, i8* %ptr3, !invariant.group !0
+ store i8 42, ptr %ptr, !invariant.group !0
+; CHECK: call ptr @llvm.launder.invariant.group.p0
+ %ptr2 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
+ call void @clobber(ptr %ptr)
+; CHECK: call ptr @llvm.launder.invariant.group.p0
+ %ptr3 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
+; CHECK: call void @clobber(ptr {{.*}}%ptr)
+ call void @clobber(ptr %ptr)
+; CHECK: call void @use(ptr {{.*}}%ptr2)
+ call void @use(ptr %ptr2)
+; CHECK: call void @use(ptr {{.*}}%ptr3)
+ call void @use(ptr %ptr3)
+; CHECK: load i8, ptr %ptr3, {{.*}}!invariant.group
+ %v = load i8, ptr %ptr3, !invariant.group !0
ret i8 %v
}
@@ -54,50 +54,50 @@ entry:
; CHECK-LABEL: define i8 @unoptimizable2()
define i8 @unoptimizable2() {
%ptr = alloca i8
- store i8 42, i8* %ptr, !invariant.group !0
-; CHECK: call i8* @llvm.launder.invariant.group
- %ptr2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
- store i8 43, i8* %ptr
-; CHECK: call i8* @llvm.launder.invariant.group
- %ptr3 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
-; CHECK: call void @clobber(i8* {{.*}}%ptr)
- call void @clobber(i8* %ptr)
-; CHECK: call void @use(i8* {{.*}}%ptr2)
- call void @use(i8* %ptr2)
-; CHECK: call void @use(i8* {{.*}}%ptr3)
- call void @use(i8* %ptr3)
-; CHECK: load i8, i8* %ptr3, {{.*}}!invariant.group
- %v = load i8, i8* %ptr3, !invariant.group !0
+ store i8 42, ptr %ptr, !invariant.group !0
+; CHECK: call ptr @llvm.launder.invariant.group
+ %ptr2 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
+ store i8 43, ptr %ptr
+; CHECK: call ptr @llvm.launder.invariant.group
+ %ptr3 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
+; CHECK: call void @clobber(ptr {{.*}}%ptr)
+ call void @clobber(ptr %ptr)
+; CHECK: call void @use(ptr {{.*}}%ptr2)
+ call void @use(ptr %ptr2)
+; CHECK: call void @use(ptr {{.*}}%ptr3)
+ call void @use(ptr %ptr3)
+; CHECK: load i8, ptr %ptr3, {{.*}}!invariant.group
+ %v = load i8, ptr %ptr3, !invariant.group !0
ret i8 %v
}
; This test check if optimizer is not proving equality based on mustalias
-; CHECK-LABEL: define void @dontProveEquality(i8* %a)
-define void @dontProveEquality(i8* %a) {
- %b = call i8* @llvm.launder.invariant.group.p0i8(i8* %a)
- %r = icmp eq i8* %b, %a
+; CHECK-LABEL: define void @dontProveEquality(ptr %a)
+define void @dontProveEquality(ptr %a) {
+ %b = call ptr @llvm.launder.invariant.group.p0(ptr %a)
+ %r = icmp eq ptr %b, %a
; CHECK: call void @useBool(i1 %r)
call void @useBool(i1 %r)
- %b2 = call i8* @llvm.strip.invariant.group.p0i8(i8* %a)
- %r2 = icmp eq i8* %b2, %a
+ %b2 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
+ %r2 = icmp eq ptr %b2, %a
; CHECK: call void @useBool(i1 %r2)
call void @useBool(i1 %r2)
ret void
}
-declare void @use(i8* readonly)
+declare void @use(ptr readonly)
declare void @useBool(i1)
-declare void @clobber(i8*)
+declare void @clobber(ptr)
; CHECK: Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite){{$}}
-; CHECK-NEXT: declare i8* @llvm.launder.invariant.group.p0i8(i8*)
-declare i8* @llvm.launder.invariant.group.p0i8(i8*)
+; CHECK-NEXT: declare ptr @llvm.launder.invariant.group.p0(ptr)
+declare ptr @llvm.launder.invariant.group.p0(ptr)
; CHECK: Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none){{$}}
-; CHECK-NEXT: declare i8* @llvm.strip.invariant.group.p0i8(i8*)
-declare i8* @llvm.strip.invariant.group.p0i8(i8*)
+; CHECK-NEXT: declare ptr @llvm.strip.invariant.group.p0(ptr)
+declare ptr @llvm.strip.invariant.group.p0(ptr)
!0 = !{}
diff --git a/llvm/test/Other/lint.ll b/llvm/test/Other/lint.ll
index c25e624fdeaf1..6b31b31a78c98 100644
--- a/llvm/test/Other/lint.ll
+++ b/llvm/test/Other/lint.ll
@@ -2,13 +2,13 @@
target datalayout = "e-p:64:64:64"
declare fastcc void @bar()
-declare void @llvm.stackrestore(i8*)
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
-declare void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
-declare void @llvm.memset.p0i8.i8.i64(i8* nocapture, i8, i64, i1) nounwind
-declare void @llvm.memset.inline.p0i8.i8.i64(i8* nocapture, i8, i64, i1) nounwind
-declare void @has_sret(i8* sret(i8) %p)
-declare void @has_noaliases(i32* noalias %p, i32* %q)
+declare void @llvm.stackrestore(ptr)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind
+declare void @llvm.memcpy.inline.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind
+declare void @llvm.memset.p0.i8.i64(ptr nocapture, i8, i64, i1) nounwind
+declare void @llvm.memset.inline.p0.i8.i64(ptr nocapture, i8, i64, i1) nounwind
+declare void @has_sret(ptr sret(i8) %p)
+declare void @has_noaliases(ptr noalias %p, ptr %q)
declare void @one_arg(i32)
@CG = constant i32 7
@@ -21,22 +21,22 @@ define i32 @foo() noreturn {
; CHECK: Caller and callee calling convention
diff er
call void @bar()
; CHECK: Null pointer dereference
- store i32 0, i32* null
+ store i32 0, ptr null
; CHECK: Null pointer dereference
- %t = load i32, i32* null
+ %t = load i32, ptr null
; CHECK: Undef pointer dereference
- store i32 0, i32* undef
+ store i32 0, ptr undef
; CHECK: Undef pointer dereference
- %u = load i32, i32* undef
+ %u = load i32, ptr undef
; CHECK: All-ones pointer dereference
- store i32 0, i32* inttoptr (i64 -1 to i32*)
+ store i32 0, ptr inttoptr (i64 -1 to ptr)
; CHECK: Address one pointer dereference
- store i32 0, i32* inttoptr (i64 1 to i32*)
+ store i32 0, ptr inttoptr (i64 1 to ptr)
; CHECK: Memory reference address is misaligned
- store i8 0, i8* %buf, align 2
+ store i8 0, ptr %buf, align 2
; CHECK: Memory reference address is misaligned
- %gep = getelementptr {i8, i8}, {i8, i8}* %buf2, i32 0, i32 1
- store i8 0, i8* %gep, align 2
+ %gep = getelementptr {i8, i8}, ptr %buf2, i32 0, i32 1
+ store i8 0, ptr %gep, align 2
; CHECK: Division by zero
%sd = sdiv i32 2, 0
; CHECK: Division by zero
@@ -61,49 +61,46 @@ define i32 @foo() noreturn {
%xs = sub i32 undef, undef
; CHECK: Write to read-only memory
- store i32 8, i32* @CG
+ store i32 8, ptr @CG
; CHECK: Write to text section
- store i32 8, i32* bitcast (i32()* @foo to i32*)
+ store i32 8, ptr @foo
; CHECK: Load from block address
- %lb = load i32, i32* bitcast (i8* blockaddress(@foo, %next) to i32*)
+ %lb = load i32, ptr blockaddress(@foo, %next)
; CHECK: Call to block address
- call void() bitcast (i8* blockaddress(@foo, %next) to void()*)()
+ call void() blockaddress(@foo, %next)()
; CHECK: Undefined behavior: Null pointer dereference
- call void @llvm.stackrestore(i8* null)
+ call void @llvm.stackrestore(ptr null)
; CHECK: Undefined behavior: Null pointer dereference
- call void @has_sret(i8* sret(i8) null)
+ call void @has_sret(ptr sret(i8) null)
; CHECK: Unusual: noalias argument aliases another argument
- call void @has_noaliases(i32* @CG, i32* @CG)
+ call void @has_noaliases(ptr @CG, ptr @CG)
; CHECK: Call argument count mismatches callee argument count
- call void (i32, i32) bitcast (void (i32)* @one_arg to void (i32, i32)*)(i32 0, i32 0)
+ call void (i32, i32) @one_arg(i32 0, i32 0)
; CHECK: Call argument count mismatches callee argument count
- call void () bitcast (void (i32)* @one_arg to void ()*)()
+ call void () @one_arg()
; CHECK: Call argument type mismatches callee parameter type
- call void (float) bitcast (void (i32)* @one_arg to void (float)*)(float 0.0)
+ call void (float) @one_arg(float 0.0)
; CHECK: Write to read-only memory
-call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (i32* @CG to i8*), i8* bitcast (i32* @CG2 to i8*), i64 1, i1 0)
+call void @llvm.memcpy.p0.p0.i64(ptr @CG, ptr @CG2, i64 1, i1 0)
; CHECK: Write to read-only memory
-call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* bitcast (i32* @CG to i8*), i8* bitcast (i32* @CG2 to i8*), i64 1, i1 0)
+call void @llvm.memcpy.inline.p0.p0.i64(ptr @CG, ptr @CG2, i64 1, i1 0)
; CHECK: Unusual: noalias argument aliases another argument
-call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (i32* @CG to i8*), i8* bitcast (i32* @CG to i8*), i64 1, i1 0)
+call void @llvm.memcpy.p0.p0.i64(ptr @CG, ptr @CG, i64 1, i1 0)
; CHECK: Write to read-only memory
-call void @llvm.memset.p0i8.i8.i64(i8* bitcast (i32* @CG to i8*), i8 1, i64 1, i1 0)
+call void @llvm.memset.p0.i8.i64(ptr @CG, i8 1, i64 1, i1 0)
; CHECK: Write to read-only memory
-call void @llvm.memset.inline.p0i8.i8.i64(i8* bitcast (i32* @CG to i8*), i8 1, i64 1, i1 0)
+call void @llvm.memset.inline.p0.i8.i64(ptr @CG, i8 1, i64 1, i1 0)
; CHECK: Undefined behavior: Buffer overflow
- %wider = bitcast i8* %buf to i16*
- store i16 0, i16* %wider
+ store i16 0, ptr %buf
; CHECK: Undefined behavior: Buffer overflow
- %inner = getelementptr {i8, i8}, {i8, i8}* %buf2, i32 0, i32 1
- %wider2 = bitcast i8* %inner to i16*
- store i16 0, i16* %wider2
+ %inner = getelementptr {i8, i8}, ptr %buf2, i32 0, i32 1
+ store i16 0, ptr %inner
; CHECK: Undefined behavior: Buffer overflow
- %before = getelementptr i8, i8* %buf, i32 -1
- %wider3 = bitcast i8* %before to i16*
- store i16 0, i16* %wider3
+ %before = getelementptr i8, ptr %buf, i32 -1
+ store i16 0, ptr %before
br label %next
@@ -116,8 +113,7 @@ next:
foo:
; CHECK-NOT: Undefined behavior: Buffer overflow
; CHECK-NOT: Memory reference address is misaligned
- %e = bitcast i8* @E to i64*
- store i64 0, i64* %e
+ store i64 0, ptr @E
%z = add i32 0, 0
; CHECK: unreachable immediately preceded by instruction without side effects
unreachable
@@ -129,63 +125,62 @@ define void @0() nounwind {
}
; CHECK: va_start called in a non-varargs function
-declare void @llvm.va_start(i8*)
-define void @not_vararg(i8* %p) nounwind {
- call void @llvm.va_start(i8* %p)
+declare void @llvm.va_start(ptr)
+define void @not_vararg(ptr %p) nounwind {
+ call void @llvm.va_start(ptr %p)
ret void
}
; CHECK: Undefined behavior: Branch to non-blockaddress
define void @use_indbr() {
- indirectbr i8* bitcast (i32()* @foo to i8*), [label %block]
+ indirectbr ptr @foo, [label %block]
block:
unreachable
}
; CHECK: Undefined behavior: Call with "tail" keyword references alloca
-declare void @tailcallee(i8*)
-define void @use_tail(i8* %valist) {
+declare void @tailcallee(ptr)
+define void @use_tail(ptr %valist) {
%t = alloca i8
- tail call void @tailcallee(i8* %t)
+ tail call void @tailcallee(ptr %t)
ret void
}
; CHECK: Unusual: Returning alloca value
-define i8* @return_local(i32 %n, i32 %m) {
+define ptr @return_local(i32 %n, i32 %m) {
%t = alloca i8, i32 %n
- %s = getelementptr i8, i8* %t, i32 %m
- ret i8* %s
+ %s = getelementptr i8, ptr %t, i32 %m
+ ret ptr %s
}
; CHECK: Unusual: Returning alloca value
-define i32* @return_obscured_local() {
+define ptr @return_obscured_local() {
entry:
- %retval = alloca i32*
+ %retval = alloca ptr
%x = alloca i32
- store i32* %x, i32** %retval
+ store ptr %x, ptr %retval
br label %next
next:
- %t0 = load i32*, i32** %retval
- %t1 = insertvalue { i32, i32, i32* } zeroinitializer, i32* %t0, 2
- %t2 = extractvalue { i32, i32, i32* } %t1, 2
+ %t0 = load ptr, ptr %retval
+ %t1 = insertvalue { i32, i32, ptr } zeroinitializer, ptr %t0, 2
+ %t2 = extractvalue { i32, i32, ptr } %t1, 2
br label %exit
exit:
- %t3 = phi i32* [ %t2, %next ]
- %t4 = bitcast i32* %t3 to i32*
- %t5 = ptrtoint i32* %t4 to i64
+ %t3 = phi ptr [ %t2, %next ]
+ %t5 = ptrtoint ptr %t3 to i64
%t6 = add i64 %t5, 0
- %t7 = inttoptr i64 %t6 to i32*
- ret i32* %t7
+ %t7 = inttoptr i64 %t6 to ptr
+ ret ptr %t7
}
; CHECK: Undefined behavior: Undef pointer dereference
-define i32* @self_reference() {
+define ptr @self_reference() {
entry:
unreachable
exit:
- %t3 = phi i32* [ %t4, %exit ]
- %t4 = bitcast i32* %t3 to i32*
- %x = load volatile i32, i32* %t3
+ %t3 = phi ptr [ %t4, %exit ]
+ %t4 = bitcast ptr %t3 to ptr
+ %x = load volatile i32, ptr %t3
br label %exit
}
@@ -194,16 +189,15 @@ exit:
declare i32 @nonstruct_callee() nounwind
define void @struct_caller() nounwind {
entry:
- call %struct bitcast (i32 ()* @foo to %struct ()*)()
+ call %struct @foo()
; CHECK: Undefined behavior: indirectbr with no destinations
- indirectbr i8* null, []
+ indirectbr ptr null, []
}
define i32 @memcpy_inline_same_address() noreturn {
%buf = alloca i64, align 1
- %ptr = bitcast i64* %buf to i8*
; CHECK: Unusual: noalias argument aliases another argument
- call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* %ptr, i8* %ptr, i64 1, i1 false)
+ call void @llvm.memcpy.inline.p0.p0.i64(ptr %buf, ptr %buf, i64 1, i1 false)
unreachable
}
diff --git a/llvm/test/Other/llvm-nm-without-aliases.ll b/llvm/test/Other/llvm-nm-without-aliases.ll
index 7962804f08ee7..0ff9d0e0f882f 100644
--- a/llvm/test/Other/llvm-nm-without-aliases.ll
+++ b/llvm/test/Other/llvm-nm-without-aliases.ll
@@ -12,13 +12,13 @@
; WITH: T bar
; WITH: T foo
- at a0foo = alias void (), void ()* @foo
+ at a0foo = alias void (), ptr @foo
define void @foo() {
ret void
}
- at a0bar = alias void (), void ()* @bar
+ at a0bar = alias void (), ptr @bar
define void @bar() {
ret void
diff --git a/llvm/test/Other/loop-pass-printer.ll b/llvm/test/Other/loop-pass-printer.ll
index 60bfdbbaea9ef..ef6dc1509dc47 100644
--- a/llvm/test/Other/loop-pass-printer.ll
+++ b/llvm/test/Other/loop-pass-printer.ll
@@ -42,18 +42,18 @@
define void @foo(){
%idx = alloca i32, align 4
- store i32 0, i32* %idx, align 4
+ store i32 0, ptr %idx, align 4
br label %loop
loop:
- %1 = load i32, i32* %idx, align 4
+ %1 = load i32, ptr %idx, align 4
%2 = icmp slt i32 %1, 10
br i1 %2, label %cont, label %done
cont:
- %3 = load i32, i32* %idx, align 4
+ %3 = load i32, ptr %idx, align 4
%4 = add nsw i32 %3, 1
- store i32 %4, i32* %idx, align 4
+ store i32 %4, ptr %idx, align 4
br label %loop
done:
diff --git a/llvm/test/Other/loop-pm-invalidation.ll b/llvm/test/Other/loop-pm-invalidation.ll
index ba01837af2223..e215fb5d847c2 100644
--- a/llvm/test/Other/loop-pm-invalidation.ll
+++ b/llvm/test/Other/loop-pm-invalidation.ll
@@ -44,7 +44,7 @@ entry:
ret void
}
-define void @one_loop(i1* %ptr) {
+define void @one_loop(ptr %ptr) {
; CHECK-LOOP-INV: Running pass: LoopSimplifyPass
; CHECK-LOOP-INV-NEXT: Running analysis: LoopAnalysis
; CHECK-LOOP-INV-NEXT: Running analysis: DominatorTreeAnalysis
@@ -93,14 +93,14 @@ entry:
br label %l0.header
l0.header:
- %flag0 = load volatile i1, i1* %ptr
+ %flag0 = load volatile i1, ptr %ptr
br i1 %flag0, label %l0.header, label %exit
exit:
ret void
}
-define void @nested_loops(i1* %ptr) {
+define void @nested_loops(ptr %ptr) {
; CHECK-LOOP-INV: Running pass: LoopSimplifyPass
; CHECK-LOOP-INV-NEXT: Running analysis: LoopAnalysis
; CHECK-LOOP-INV-NEXT: Running analysis: DominatorTreeAnalysis
@@ -158,11 +158,11 @@ l.0.header:
br label %l.0.0.header
l.0.0.header:
- %flag.0.0 = load volatile i1, i1* %ptr
+ %flag.0.0 = load volatile i1, ptr %ptr
br i1 %flag.0.0, label %l.0.0.header, label %l.0.latch
l.0.latch:
- %flag.0 = load volatile i1, i1* %ptr
+ %flag.0 = load volatile i1, ptr %ptr
br i1 %flag.0, label %l.0.header, label %exit
exit:
diff --git a/llvm/test/Other/machine-size-remarks.ll b/llvm/test/Other/machine-size-remarks.ll
index 2f4e71f7fe8f5..2a32e63a85ca2 100644
--- a/llvm/test/Other/machine-size-remarks.ll
+++ b/llvm/test/Other/machine-size-remarks.ll
@@ -52,7 +52,7 @@
define i32 @main() #0 {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
ret i32 0
}
diff --git a/llvm/test/Other/mixed-opaque-ptrs-2.ll b/llvm/test/Other/mixed-opaque-ptrs-2.ll
index d5fe38da514ad..525b9b161c02e 100644
--- a/llvm/test/Other/mixed-opaque-ptrs-2.ll
+++ b/llvm/test/Other/mixed-opaque-ptrs-2.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as -disable-output %s 2>&1
; FIXME: this should err out saying not to mix `ptr` and `foo*`
define void @f(ptr) {
- %a = alloca i32*
+ %a = alloca ptr
ret void
}
diff --git a/llvm/test/Other/new-pass-manager-verify-each.ll b/llvm/test/Other/new-pass-manager-verify-each.ll
index 1af48be8d1200..a0e4c0404ec84 100644
--- a/llvm/test/Other/new-pass-manager-verify-each.ll
+++ b/llvm/test/Other/new-pass-manager-verify-each.ll
@@ -23,13 +23,13 @@
; Added manually by opt at end
; CHECK: Running pass: VerifierPass
-define void @foo(i1 %x, i8* %p1, i8* %p2) {
+define void @foo(i1 %x, ptr %p1, ptr %p2) {
entry:
- store i8 42, i8* %p1
+ store i8 42, ptr %p1
br i1 %x, label %loop, label %exit
loop:
- %tmp1 = load i8, i8* %p2
+ %tmp1 = load i8, ptr %p2
br label %loop
exit:
diff --git a/llvm/test/Other/new-pass-manager.ll b/llvm/test/Other/new-pass-manager.ll
index 5be67a34a9174..8aa8ca0a6e56d 100644
--- a/llvm/test/Other/new-pass-manager.ll
+++ b/llvm/test/Other/new-pass-manager.ll
@@ -42,14 +42,14 @@
; CHECK-MODULE-PRINT: Running pass: VerifierPass
; CHECK-MODULE-PRINT: Running pass: PrintModulePass
; CHECK-MODULE-PRINT: ModuleID
-; CHECK-MODULE-PRINT: define void @foo(i1 %x, i8* %p1, i8* %p2)
+; CHECK-MODULE-PRINT: define void @foo(i1 %x, ptr %p1, ptr %p2)
; CHECK-MODULE-PRINT: Running pass: VerifierPass
; RUN: opt -disable-output -debug-pass-manager -disable-verify -verify-cfg-preserved=1 -passes='print,verify' %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-VERIFY
; CHECK-MODULE-VERIFY: Running pass: PrintModulePass
; CHECK-MODULE-VERIFY: ModuleID
-; CHECK-MODULE-VERIFY: define void @foo(i1 %x, i8* %p1, i8* %p2)
+; CHECK-MODULE-VERIFY: define void @foo(i1 %x, ptr %p1, ptr %p2)
; CHECK-MODULE-VERIFY: Running pass: VerifierPass
; RUN: opt -disable-output -debug-pass-manager -passes='function(print)' %s 2>&1 \
@@ -58,24 +58,24 @@
; CHECK-FUNCTION-PRINT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
; CHECK-FUNCTION-PRINT: Running pass: PrintFunctionPass
; CHECK-FUNCTION-PRINT-NOT: ModuleID
-; CHECK-FUNCTION-PRINT: define void @foo(i1 %x, i8* %p1, i8* %p2)
+; CHECK-FUNCTION-PRINT: define void @foo(i1 %x, ptr %p1, ptr %p2)
; CHECK-FUNCTION-PRINT: Running pass: VerifierPass
; RUN: opt -disable-output -debug-pass-manager -disable-verify -verify-cfg-preserved=1 -passes='function(print,verify)' %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-VERIFY
; CHECK-FUNCTION-VERIFY: Running pass: PrintFunctionPass
; CHECK-FUNCTION-VERIFY-NOT: ModuleID
-; CHECK-FUNCTION-VERIFY: define void @foo(i1 %x, i8* %p1, i8* %p2)
+; CHECK-FUNCTION-VERIFY: define void @foo(i1 %x, ptr %p1, ptr %p2)
; CHECK-FUNCTION-VERIFY: Running pass: VerifierPass
; RUN: opt -S -o - -passes='no-op-module,no-op-module' %s \
; RUN: | FileCheck %s --check-prefix=CHECK-NOOP
-; CHECK-NOOP: define void @foo(i1 %x, i8* %p1, i8* %p2) {
+; CHECK-NOOP: define void @foo(i1 %x, ptr %p1, ptr %p2) {
; CHECK-NOOP: entry:
-; CHECK-NOOP: store i8 42, i8* %p1
+; CHECK-NOOP: store i8 42, ptr %p1
; CHECK-NOOP: br i1 %x, label %loop, label %exit
; CHECK-NOOP: loop:
-; CHECK-NOOP: %tmp1 = load i8, i8* %p2
+; CHECK-NOOP: %tmp1 = load i8, ptr %p2
; CHECK-NOOP: br label %loop
; CHECK-NOOP: exit:
; CHECK-NOOP: ret void
@@ -360,13 +360,13 @@
; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
-define void @foo(i1 %x, i8* %p1, i8* %p2) {
+define void @foo(i1 %x, ptr %p1, ptr %p2) {
entry:
- store i8 42, i8* %p1
+ store i8 42, ptr %p1
br i1 %x, label %loop, label %exit
loop:
- %tmp1 = load i8, i8* %p2
+ %tmp1 = load i8, ptr %p2
br label %loop
exit:
diff --git a/llvm/test/Other/new-pm-pr42726-cgscc.ll b/llvm/test/Other/new-pm-pr42726-cgscc.ll
index aea548d85080c..bf1de42480cfd 100644
--- a/llvm/test/Other/new-pm-pr42726-cgscc.ll
+++ b/llvm/test/Other/new-pm-pr42726-cgscc.ll
@@ -2,14 +2,14 @@
; REQUIRES: asserts
declare void @bar()
-declare void @baz(i32*)
+declare void @baz(ptr)
; CHECK-LABEL: @foo1()
define void @foo1() {
entry:
%tag = alloca i32, align 4
- call void @baz(i32* %tag)
- %tmp = load i32, i32* %tag, align 4
+ call void @baz(ptr %tag)
+ %tmp = load i32, ptr %tag, align 4
switch i32 %tmp, label %sw.bb799 [
i32 10, label %sw.bb239
]
@@ -40,8 +40,8 @@ define void @foo3(i32 %ptr) {
define void @foo4() {
entry:
%tag = alloca i32, align 4
- call void @baz(i32* %tag)
- %tmp = load i32, i32* %tag, align 4
+ call void @baz(ptr %tag)
+ %tmp = load i32, ptr %tag, align 4
switch i32 %tmp, label %sw.bb442 [
i32 16, label %sw.bb352
]
diff --git a/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-inline-threshold.ll b/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-inline-threshold.ll
index f9d608a718415..9baedcb02ca06 100644
--- a/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-inline-threshold.ll
+++ b/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-inline-threshold.ll
@@ -83,11 +83,11 @@ if.end: ; preds = %while.body.split, %
br i1 %exitcond.not, label %while.end, label %while.body, !dbg !16, !llvm.loop !24
while.end: ; preds = %if.end
- %call3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %phi.call), !dbg !27
+ %call3 = tail call i32 (ptr, ...) @printf(ptr dereferenceable(1) @.str, i32 %phi.call), !dbg !27
ret i32 0, !dbg !28
}
-declare i32 @printf(i8* nocapture noundef readonly, ...)
+declare i32 @printf(ptr nocapture noundef readonly, ...)
attributes #0 = {"use-sample-profile"}
diff --git a/llvm/test/Other/new-pm-time-trace.ll b/llvm/test/Other/new-pm-time-trace.ll
index 07d0e2bd0ab35..28cd8363e2999 100644
--- a/llvm/test/Other/new-pm-time-trace.ll
+++ b/llvm/test/Other/new-pm-time-trace.ll
@@ -7,13 +7,13 @@
; CHECK: "name": "Total FunctionToLoopPassAdaptor
-define void @foo(i1 %x, i8* %p1, i8* %p2) {
+define void @foo(i1 %x, ptr %p1, ptr %p2) {
entry:
- store i8 42, i8* %p1
+ store i8 42, ptr %p1
br i1 %x, label %loop, label %exit
loop:
- %tmp1 = load i8, i8* %p2
+ %tmp1 = load i8, ptr %p2
br label %loop
exit:
diff --git a/llvm/test/Other/no-rerun-function-simplification-pipeline.ll b/llvm/test/Other/no-rerun-function-simplification-pipeline.ll
index f7b6402500451..0fa003b8ceadf 100644
--- a/llvm/test/Other/no-rerun-function-simplification-pipeline.ll
+++ b/llvm/test/Other/no-rerun-function-simplification-pipeline.ll
@@ -16,13 +16,13 @@
; CHECK: PassManager{{.*}}SCC{{.*}} on (f3)
; CHECK: Running pass: BDCEPass on f3
-define void @f1(void()* %p) alwaysinline {
+define void @f1(ptr %p) alwaysinline {
call void %p()
ret void
}
define void @f2() #0 {
- call void @f1(void()* @f2)
+ call void @f1(ptr @f2)
call void @f3()
ret void
}
diff --git a/llvm/test/Other/opt-bisect-new-pass-manager.ll b/llvm/test/Other/opt-bisect-new-pass-manager.ll
index ed6f973e761ab..b20fe1a012b29 100644
--- a/llvm/test/Other/opt-bisect-new-pass-manager.ll
+++ b/llvm/test/Other/opt-bisect-new-pass-manager.ll
@@ -148,8 +148,7 @@ bb.false:
define void @f4() {
entry:
%i = alloca i32, align 4
- %tmp = bitcast i32* %i to i8*
- call void @llvm.lifetime.start(i64 4, i8* %tmp)
+ call void @llvm.lifetime.start(i64 4, ptr %i)
br label %for.cond
for.cond:
@@ -162,4 +161,4 @@ for.end:
ret void
}
-declare void @llvm.lifetime.start(i64, i8* nocapture)
+declare void @llvm.lifetime.start(i64, ptr nocapture)
diff --git a/llvm/test/Other/opt-pipeline-vector-passes.ll b/llvm/test/Other/opt-pipeline-vector-passes.ll
index 7801cde24462e..83a9454c0d808 100644
--- a/llvm/test/Other/opt-pipeline-vector-passes.ll
+++ b/llvm/test/Other/opt-pipeline-vector-passes.ll
@@ -37,17 +37,17 @@
; O2_EXTRA: Running pass: EarlyCSEPass
; O2_EXTRA: Running pass: VectorCombinePass
-define i64 @f(i1 %cond, i32* %src, i32* %dst) {
+define i64 @f(i1 %cond, ptr %src, ptr %dst) {
entry:
br label %loop
loop:
%i = phi i64 [ 0, %entry ], [ %inc, %loop ]
- %src.i = getelementptr i32, i32* %src, i64 %i
- %src.v = load i32, i32* %src.i
+ %src.i = getelementptr i32, ptr %src, i64 %i
+ %src.v = load i32, ptr %src.i
%add = add i32 %src.v, 10
- %dst.i = getelementptr i32, i32* %dst, i64 %i
- store i32 %add, i32* %dst.i
+ %dst.i = getelementptr i32, ptr %dst, i64 %i
+ store i32 %add, ptr %dst.i
%inc = add nuw nsw i64 %i, 1
%ec = icmp ne i64 %inc, 1000
br i1 %ec, label %loop, label %exit
diff --git a/llvm/test/Other/optimization-remarks-inline.ll b/llvm/test/Other/optimization-remarks-inline.ll
index 129f4141c18a4..b531ef1298c30 100644
--- a/llvm/test/Other/optimization-remarks-inline.ll
+++ b/llvm/test/Other/optimization-remarks-inline.ll
@@ -16,10 +16,10 @@ define i32 @foo(i32 %x, i32 %y) #0 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %0 = load i32, i32* %x.addr, align 4
- %1 = load i32, i32* %y.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4
+ %1 = load i32, ptr %y.addr, align 4
%add = add nsw i32 %0, %1
ret i32 %add
}
@@ -27,9 +27,9 @@ entry:
define i32 @bar(i32 %j) #0 {
entry:
%j.addr = alloca i32, align 4
- store i32 %j, i32* %j.addr, align 4
- %0 = load i32, i32* %j.addr, align 4
- %1 = load i32, i32* %j.addr, align 4
+ store i32 %j, ptr %j.addr, align 4
+ %0 = load i32, ptr %j.addr, align 4
+ %1 = load i32, ptr %j.addr, align 4
%sub = sub nsw i32 %1, 2
%call = call i32 @foo(i32 %0, i32 %sub)
; CHECK: 'foo' inlined into 'bar'
diff --git a/llvm/test/Other/optimization-remarks-invalidation.ll b/llvm/test/Other/optimization-remarks-invalidation.ll
index 49b36e3c85a7a..71cd6552afaa6 100644
--- a/llvm/test/Other/optimization-remarks-invalidation.ll
+++ b/llvm/test/Other/optimization-remarks-invalidation.ll
@@ -29,7 +29,7 @@
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 void @hoist(i32* %array, i32* noalias %p) {
+define void @hoist(ptr %array, ptr noalias %p) {
; CHECK-PM-PRESERVE: Running analysis: OptimizationRemarkEmitterAnalysis
; CHECK-PM-PRESERVE: Running pass: InstCombinePass
; CHECK-PM-PRESERVE-NOT: Invalidating analysis: OptimizationRemarkEmitterAnalysis
@@ -51,12 +51,12 @@ Entry:
Loop:
%j = phi i32 [ 0, %Entry ], [ %Next, %Loop ]
- %addr = getelementptr i32, i32* %array, i32 %j
- %a = load i32, i32* %addr
+ %addr = getelementptr i32, ptr %array, i32 %j
+ %a = load i32, ptr %addr
; CHECK: remark: /tmp/kk.c:2:20: hoisting load
- %b = load i32, i32* %p, !dbg !8
+ %b = load i32, ptr %p, !dbg !8
%a2 = add i32 %a, %b
- store i32 %a2, i32* %addr
+ store i32 %a2, ptr %addr
%Next = add i32 %j, 1
%cond = icmp eq i32 %Next, 0
br i1 %cond, label %Out, label %Loop
diff --git a/llvm/test/Other/optimization-remarks-lazy-bfi.ll b/llvm/test/Other/optimization-remarks-lazy-bfi.ll
index b261f9be9e39b..c5099bb2179e4 100644
--- a/llvm/test/Other/optimization-remarks-lazy-bfi.ll
+++ b/llvm/test/Other/optimization-remarks-lazy-bfi.ll
@@ -19,7 +19,7 @@
; 1 void forced (char *A, char *B, char *C, int N) {
; 2 #pragma clang loop distribute(enable)
; 3 for(int i = 0; i < N; i++) {
-; 4 A[i] = B[i] * C[i];
+; 4 A[i] = Bptr C[i];
; 5 }
; 6 }
@@ -27,7 +27,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
-define void @forced(i8* %A, i8* %B, i8* %C, i32 %N) !dbg !7 !prof !22 {
+define void @forced(ptr %A, ptr %B, ptr %C, i32 %N) !dbg !7 !prof !22 {
entry:
%cmp12 = icmp sgt i32 %N, 0, !dbg !9
br i1 %cmp12, label %ph, label %for.cond.cleanup, !dbg !10, !prof !23
@@ -37,13 +37,13 @@ ph:
for.body:
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %ph ]
- %arrayidx = getelementptr inbounds i8, i8* %B, i64 %indvars.iv, !dbg !12
- %0 = load i8, i8* %arrayidx, align 1, !dbg !12, !tbaa !13
- %arrayidx2 = getelementptr inbounds i8, i8* %C, i64 %indvars.iv, !dbg !16
- %1 = load i8, i8* %arrayidx2, align 1, !dbg !16, !tbaa !13
+ %arrayidx = getelementptr inbounds i8, ptr %B, i64 %indvars.iv, !dbg !12
+ %0 = load i8, ptr %arrayidx, align 1, !dbg !12, !tbaa !13
+ %arrayidx2 = getelementptr inbounds i8, ptr %C, i64 %indvars.iv, !dbg !16
+ %1 = load i8, ptr %arrayidx2, align 1, !dbg !16, !tbaa !13
%mul = mul i8 %1, %0, !dbg !17
- %arrayidx6 = getelementptr inbounds i8, i8* %A, i64 %indvars.iv, !dbg !18
- store i8 %mul, i8* %arrayidx6, align 1, !dbg !19, !tbaa !13
+ %arrayidx6 = getelementptr inbounds i8, ptr %A, i64 %indvars.iv, !dbg !18
+ store i8 %mul, ptr %arrayidx6, align 1, !dbg !19, !tbaa !13
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !10
%lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !10
%exitcond = icmp eq i32 %lftr.wideiv, %N, !dbg !10
diff --git a/llvm/test/Other/optimize-inrange-gep.ll b/llvm/test/Other/optimize-inrange-gep.ll
index 9e86889be9c7f..cc2bd15b5b22c 100644
--- a/llvm/test/Other/optimize-inrange-gep.ll
+++ b/llvm/test/Other/optimize-inrange-gep.ll
@@ -9,10 +9,10 @@ target datalayout = "e-p:64:64"
; Make sure that optimizations do not optimize inrange GEP.
- at vtable = constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* null, i8* null] }
+ at vtable = constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr null, ptr null] }
-define void @foo(i8*** %p) {
- ;CHECK: store i8** getelementptr {{.*}} ({ [3 x i8*] }, { [3 x i8*] }* @vtable, i{{.*}} 0, inrange i32 0, i{{.*}} 3), i8*** %p
- store i8** getelementptr ({ [3 x i8*] }, { [3 x i8*] }* @vtable, i32 0, inrange i32 0, i32 3), i8*** %p
+define void @foo(ptr %p) {
+ ;CHECK: store ptr getelementptr {{.*}} ({ [3 x ptr] }, ptr @vtable, i{{.*}} 0, inrange i32 0, i{{.*}} 3), ptr %p
+ store ptr getelementptr ({ [3 x ptr] }, ptr @vtable, i32 0, inrange i32 0, i32 3), ptr %p
ret void
}
diff --git a/llvm/test/Other/pr32085.ll b/llvm/test/Other/pr32085.ll
index 4bbc6863246e6..6c4f0c085ecfe 100644
--- a/llvm/test/Other/pr32085.ll
+++ b/llvm/test/Other/pr32085.ll
@@ -16,7 +16,7 @@ define i32 @t1(i32, i32) {
br i1 %3, label %.exit, label %.preheader
.preheader:
- %invariant = load i32, i32* @g
+ %invariant = load i32, ptr @g
br label %.b1
.b1:
diff --git a/llvm/test/Other/print-on-crash.ll b/llvm/test/Other/print-on-crash.ll
index 89dc40b6fb6e1..d590566430d8b 100644
--- a/llvm/test/Other/print-on-crash.ll
+++ b/llvm/test/Other/print-on-crash.ll
@@ -25,6 +25,6 @@
define i32 @main() {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
ret i32 0
}
diff --git a/llvm/test/Other/scalable-vectors-core-ir.ll b/llvm/test/Other/scalable-vectors-core-ir.ll
index 1b8e4a651a5fc..d95c5a1adba90 100644
--- a/llvm/test/Other/scalable-vectors-core-ir.ll
+++ b/llvm/test/Other/scalable-vectors-core-ir.ll
@@ -222,28 +222,26 @@ define void @alloca() {
ret void
}
-define <vscale x 2 x double> @load(<vscale x 2 x double>* %ptr) {
+define <vscale x 2 x double> @load(ptr %ptr) {
; CHECK-LABEL: @load
-; CHECK: %r = load <vscale x 2 x double>, <vscale x 2 x double>* %ptr
+; CHECK: %r = load <vscale x 2 x double>, ptr %ptr
; CHECK-NEXT: ret <vscale x 2 x double> %r
- %r = load <vscale x 2 x double>, <vscale x 2 x double>* %ptr
+ %r = load <vscale x 2 x double>, ptr %ptr
ret <vscale x 2 x double> %r
}
-define void @store(<vscale x 4 x i32> %data, <vscale x 4 x i32>* %ptr) {
+define void @store(<vscale x 4 x i32> %data, ptr %ptr) {
; CHECK-LABEL: @store
-; CHECK: store <vscale x 4 x i32> %data, <vscale x 4 x i32>* %ptr
+; CHECK: store <vscale x 4 x i32> %data, ptr %ptr
; CHECK-NEXT: ret void
- store <vscale x 4 x i32> %data, <vscale x 4 x i32>* %ptr
+ store <vscale x 4 x i32> %data, ptr %ptr
ret void
}
-define <vscale x 4 x float>* @getelementptr(<vscale x 4 x float>* %base) {
+define ptr @getelementptr(ptr %base) {
; CHECK-LABEL: @getelementptr
-; CHECK: %r = getelementptr <vscale x 4 x float>, <vscale x 4 x float>* %base, i64 0
-; CHECK-NEXT: ret <vscale x 4 x float>* %r
- %r = getelementptr <vscale x 4 x float>, <vscale x 4 x float>* %base, i64 0
- ret <vscale x 4 x float>* %r
+; CHECK-NEXT: ret ptr %base
+ ret ptr %base
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -322,20 +320,20 @@ define <vscale x 4 x float> @sitofpto(<vscale x 4 x i32> %val) {
ret <vscale x 4 x float> %r
}
-define <vscale x 2 x i64> @ptrtointto(<vscale x 2 x i32*> %val) {
+define <vscale x 2 x i64> @ptrtointto(<vscale x 2 x ptr> %val) {
; CHECK-LABEL: @ptrtointto
-; CHECK: %r = ptrtoint <vscale x 2 x i32*> %val to <vscale x 2 x i64>
+; CHECK: %r = ptrtoint <vscale x 2 x ptr> %val to <vscale x 2 x i64>
; CHECK-NEXT: ret <vscale x 2 x i64> %r
- %r = ptrtoint <vscale x 2 x i32*> %val to <vscale x 2 x i64>
+ %r = ptrtoint <vscale x 2 x ptr> %val to <vscale x 2 x i64>
ret <vscale x 2 x i64> %r
}
-define <vscale x 2 x i32*> @inttoptrto(<vscale x 2 x i64> %val) {
+define <vscale x 2 x ptr> @inttoptrto(<vscale x 2 x i64> %val) {
; CHECK-LABEL: @inttoptrto
-; CHECK: %r = inttoptr <vscale x 2 x i64> %val to <vscale x 2 x i32*>
-; CHECK-NEXT: ret <vscale x 2 x i32*> %r
- %r = inttoptr <vscale x 2 x i64> %val to <vscale x 2 x i32*>
- ret <vscale x 2 x i32*> %r
+; CHECK: %r = inttoptr <vscale x 2 x i64> %val to <vscale x 2 x ptr>
+; CHECK-NEXT: ret <vscale x 2 x ptr> %r
+ %r = inttoptr <vscale x 2 x i64> %val to <vscale x 2 x ptr>
+ ret <vscale x 2 x ptr> %r
}
define <vscale x 2 x i64> @bitcastto(<vscale x 2 x double> %a) {
diff --git a/llvm/test/Other/unroll-sroa.ll b/llvm/test/Other/unroll-sroa.ll
index e65756284ae6e..adf5e151d6716 100644
--- a/llvm/test/Other/unroll-sroa.ll
+++ b/llvm/test/Other/unroll-sroa.ll
@@ -7,22 +7,22 @@ target triple = "x86_64-unknown-linux-gnu"
; CHECK-LABEL: define void @foo
; CHECK-NOT: alloca
-; CHECK-NOT: call void @llvm.memcpy.p0i8.p0i8.i64
+; CHECK-NOT: call void @llvm.memcpy.p0.p0.i64
; Function Attrs: nounwind uwtable
-define void @foo(i32* %a, i32* %b) {
+define void @foo(ptr %a, ptr %b) {
entry:
- %a.addr = alloca i32*, align 8
- %b.addr = alloca i32*, align 8
+ %a.addr = alloca ptr, align 8
+ %b.addr = alloca ptr, align 8
%tmp = alloca [4 x float], align 16
%i = alloca i32, align 4
- store i32* %a, i32** %a.addr, align 8
- store i32* %b, i32** %b.addr, align 8
- store i32 0, i32* %i, align 4
+ store ptr %a, ptr %a.addr, align 8
+ store ptr %b, ptr %b.addr, align 8
+ store i32 0, ptr %i, align 4
br label %for.cond
for.cond: ; preds = %for.inc, %entry
- %iter2 = load i32, i32* %i, align 4
+ %iter2 = load i32, ptr %i, align 4
%cmp = icmp slt i32 %iter2, 4
br i1 %cmp, label %for.body, label %for.cond.cleanup
@@ -30,32 +30,29 @@ for.cond.cleanup: ; preds = %for.cond
br label %for.end
for.body: ; preds = %for.cond
- %inptr = load i32*, i32** %a.addr, align 8
- %idx2 = load i32, i32* %i, align 4
+ %inptr = load ptr, ptr %a.addr, align 8
+ %idx2 = load i32, ptr %i, align 4
%idxprom = sext i32 %idx2 to i64
- %arrayidx = getelementptr inbounds i32, i32* %inptr, i64 %idxprom
- %val = load i32, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %inptr, i64 %idxprom
+ %val = load i32, ptr %arrayidx, align 4
%conv = sitofp i32 %val to float
- %idx = load i32, i32* %i, align 4
+ %idx = load i32, ptr %i, align 4
%idxprom1 = sext i32 %idx to i64
- %arrayidx2 = getelementptr inbounds [4 x float], [4 x float]* %tmp, i64 0, i64 %idxprom1
- store float %conv, float* %arrayidx2, align 4
+ %arrayidx2 = getelementptr inbounds [4 x float], ptr %tmp, i64 0, i64 %idxprom1
+ store float %conv, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body
- %iter = load i32, i32* %i, align 4
+ %iter = load i32, ptr %i, align 4
%inc = add nsw i32 %iter, 1
- store i32 %inc, i32* %i, align 4
+ store i32 %inc, ptr %i, align 4
br label %for.cond
for.end: ; preds = %for.cond.cleanup
- %dstptr = load i32*, i32** %b.addr, align 8
- %dst = bitcast i32* %dstptr to i8*
- %arraydecay = getelementptr inbounds [4 x float], [4 x float]* %tmp, i64 0, i64 0
- %src = bitcast float* %arraydecay to i8*
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %dst, i8* align 16 %src, i64 16, i1 false)
+ %dstptr = load ptr, ptr %b.addr, align 8
+ call void @llvm.memcpy.p0.p0.i64(ptr align 4 %dstptr, ptr align 16 %tmp, i64 16, i1 false)
ret void
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg)
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg)
More information about the llvm-commits
mailing list