[llvm] c74c618 - [Attributor] Convert some tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 20 08:32:53 PDT 2023
Author: Nikita Popov
Date: 2023-06-20T17:32:46+02:00
New Revision: c74c618af1a9394dc7a58765ca38440d376fff9b
URL: https://github.com/llvm/llvm-project/commit/c74c618af1a9394dc7a58765ca38440d376fff9b
DIFF: https://github.com/llvm/llvm-project/commit/c74c618af1a9394dc7a58765ca38440d376fff9b.diff
LOG: [Attributor] Convert some tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/Transforms/Attributor/nodelete.ll
llvm/test/Transforms/Attributor/nofree.ll
llvm/test/Transforms/Attributor/norecurse.ll
llvm/test/Transforms/Attributor/willreturn.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Attributor/nodelete.ll b/llvm/test/Transforms/Attributor/nodelete.ll
index 8617cf9d3df8e..94fceb568d27b 100644
--- a/llvm/test/Transforms/Attributor/nodelete.ll
+++ b/llvm/test/Transforms/Attributor/nodelete.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
%"a" = type { i64 }
%"b" = type { i8 }
@@ -22,11 +22,11 @@ define hidden i64 @f1() align 2 {
;
entry:
%ref.tmp = alloca %"a", align 8
- %call2 = call i64 @f2(%"a"* %ref.tmp)
+ %call2 = call i64 @f2(ptr %ref.tmp)
ret i64 %call2
}
-define internal i64 @f2(%"a"* %this) align 2 {
+define internal i64 @f2(ptr %this) align 2 {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@f2
; CGSCC-SAME: () #[[ATTR0]] align 2 {
@@ -34,15 +34,14 @@ define internal i64 @f2(%"a"* %this) align 2 {
; CGSCC-NEXT: ret i64 undef
;
entry:
- %this.addr = alloca %"a"*, align 8
- store %"a"* %this, %"a"** %this.addr, align 8
- %this1 = load %"a"*, %"a"** %this.addr, align 8
- %0 = bitcast %"a"* %this1 to %"b"*
- call void @f3(%"b"* %0)
+ %this.addr = alloca ptr, align 8
+ store ptr %this, ptr %this.addr, align 8
+ %this1 = load ptr, ptr %this.addr, align 8
+ call void @f3(ptr %this1)
ret i64 undef
}
-define internal void @f3(%"b"* %this) align 2 {
+define internal void @f3(ptr %this) align 2 {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@f3
; CGSCC-SAME: () #[[ATTR0]] align 2 {
@@ -50,14 +49,14 @@ define internal void @f3(%"b"* %this) align 2 {
; CGSCC-NEXT: ret void
;
entry:
- %this.addr = alloca %"b"*, align 8
- store %"b"* %this, %"b"** %this.addr, align 8
- %this1 = load %"b"*, %"b"** %this.addr, align 8
- %call = call i1 @f4(%"b"* %this1)
+ %this.addr = alloca ptr, align 8
+ store ptr %this, ptr %this.addr, align 8
+ %this1 = load ptr, ptr %this.addr, align 8
+ %call = call i1 @f4(ptr %this1)
ret void
}
-define internal i1 @f4(%"b"* %this) align 2 {
+define internal i1 @f4(ptr %this) align 2 {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@f4
; CGSCC-SAME: () #[[ATTR0]] align 2 {
@@ -65,26 +64,25 @@ define internal i1 @f4(%"b"* %this) align 2 {
; CGSCC-NEXT: ret i1 undef
;
entry:
- %this.addr = alloca %"b"*, align 8
- store %"b"* %this, %"b"** %this.addr, align 8
- %this1 = load %"b"*, %"b"** %this.addr, align 8
- %call = call %"a"* @f5(%"b"* %this1)
+ %this.addr = alloca ptr, align 8
+ store ptr %this, ptr %this.addr, align 8
+ %this1 = load ptr, ptr %this.addr, align 8
+ %call = call ptr @f5(ptr %this1)
ret i1 undef
}
-define internal %"a"* @f5(%"b"* %this) align 2 {
+define internal ptr @f5(ptr %this) align 2 {
; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@f5
; CGSCC-SAME: () #[[ATTR1:[0-9]+]] align 2 {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: ret %a* undef
+; CGSCC-NEXT: ret ptr undef
;
entry:
- %this.addr = alloca %"b"*, align 8
- store %"b"* %this, %"b"** %this.addr, align 8
- %this1 = load %"b"*, %"b"** %this.addr, align 8
- %0 = bitcast %"b"* %this1 to %"a"*
- ret %"a"* %0
+ %this.addr = alloca ptr, align 8
+ store ptr %this, ptr %this.addr, align 8
+ %this1 = load ptr, ptr %this.addr, align 8
+ ret ptr %this1
}
;.
; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
diff --git a/llvm/test/Transforms/Attributor/nofree.ll b/llvm/test/Transforms/Attributor/nofree.ll
index a5ac3f193d100..4a9e21d58cce5 100644
--- a/llvm/test/Transforms/Attributor/nofree.ll
+++ b/llvm/test/Transforms/Attributor/nofree.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@@ -8,9 +8,9 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; We use FIXME's to indicate problems and missing attributes.
; Free functions
-declare void @free(i8* nocapture) local_unnamed_addr #1
-declare noalias i8* @realloc(i8* nocapture, i64) local_unnamed_addr #0
-declare void @_ZdaPv(i8*) local_unnamed_addr #2
+declare void @free(ptr nocapture) local_unnamed_addr #1
+declare noalias ptr @realloc(ptr nocapture, i64) local_unnamed_addr #0
+declare void @_ZdaPv(ptr) local_unnamed_addr #2
; TEST 1 (positive case)
@@ -30,14 +30,14 @@ define void @only_return() #0 {
; free(p);
; }
-define void @only_free(i8* nocapture %0) local_unnamed_addr #0 {
+define void @only_free(ptr nocapture %0) local_unnamed_addr #0 {
; CHECK: Function Attrs: noinline nounwind uwtable
; CHECK-LABEL: define {{[^@]+}}@only_free
-; CHECK-SAME: (i8* nocapture [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] {
-; CHECK-NEXT: tail call void @free(i8* nocapture [[TMP0]]) #[[ATTR0:[0-9]+]]
+; CHECK-SAME: (ptr nocapture [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] {
+; CHECK-NEXT: tail call void @free(ptr nocapture [[TMP0]]) #[[ATTR0:[0-9]+]]
; CHECK-NEXT: ret void
;
- tail call void @free(i8* %0) #1
+ tail call void @free(ptr %0) #1
ret void
}
@@ -53,40 +53,40 @@ define void @only_free(i8* nocapture %0) local_unnamed_addr #0 {
; }
-define void @free_in_scc1(i8* nocapture %0) local_unnamed_addr #0 {
+define void @free_in_scc1(ptr nocapture %0) local_unnamed_addr #0 {
; CHECK: Function Attrs: noinline nounwind uwtable
; CHECK-LABEL: define {{[^@]+}}@free_in_scc1
-; CHECK-SAME: (i8* nocapture [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
-; CHECK-NEXT: tail call void @free_in_scc2(i8* nocapture [[TMP0]]) #[[ATTR0]]
+; CHECK-SAME: (ptr nocapture [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
+; CHECK-NEXT: tail call void @free_in_scc2(ptr nocapture [[TMP0]]) #[[ATTR0]]
; CHECK-NEXT: ret void
;
- tail call void @free_in_scc2(i8* %0) #1
+ tail call void @free_in_scc2(ptr %0) #1
ret void
}
-define void @free_in_scc2(i8* nocapture %0) local_unnamed_addr #0 {
+define void @free_in_scc2(ptr nocapture %0) local_unnamed_addr #0 {
; CHECK: Function Attrs: noinline nounwind uwtable
; CHECK-LABEL: define {{[^@]+}}@free_in_scc2
-; CHECK-SAME: (i8* nocapture [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8* [[TMP0]], null
+; CHECK-SAME: (ptr nocapture [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[TMP0]], null
; CHECK-NEXT: br i1 [[CMP]], label [[REC:%.*]], label [[CALL:%.*]]
; CHECK: call:
-; CHECK-NEXT: tail call void @free(i8* nocapture [[TMP0]]) #[[ATTR0]]
+; CHECK-NEXT: tail call void @free(ptr nocapture [[TMP0]]) #[[ATTR0]]
; CHECK-NEXT: br label [[END:%.*]]
; CHECK: rec:
-; CHECK-NEXT: tail call void @free_in_scc1(i8* nocapture [[TMP0]]) #[[ATTR0]]
+; CHECK-NEXT: tail call void @free_in_scc1(ptr nocapture [[TMP0]]) #[[ATTR0]]
; CHECK-NEXT: br label [[END]]
; CHECK: end:
; CHECK-NEXT: ret void
;
- %cmp = icmp eq i8* %0, null
+ %cmp = icmp eq ptr %0, null
br i1 %cmp, label %rec, label %call
call:
- tail call void @free(i8* %0) #1
+ tail call void @free(ptr %0) #1
br label %end
rec:
- tail call void @free_in_scc1(i8* %0)
+ tail call void @free_in_scc1(ptr %0)
br label %end
end:
ret void
@@ -140,23 +140,23 @@ define void @mutual_recursion2() #0 {
; delete [] p;
; }
-define void @_Z9delete_opPc(i8* %0) local_unnamed_addr #0 {
+define void @_Z9delete_opPc(ptr %0) local_unnamed_addr #0 {
; CHECK: Function Attrs: noinline nounwind uwtable
; CHECK-LABEL: define {{[^@]+}}@_Z9delete_opPc
-; CHECK-SAME: (i8* [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
-; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null
+; CHECK-SAME: (ptr [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
+; CHECK-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
; CHECK-NEXT: br i1 [[TMP2]], label [[TMP4:%.*]], label [[TMP3:%.*]]
; CHECK: 3:
-; CHECK-NEXT: tail call void @_ZdaPv(i8* nonnull [[TMP0]]) #[[ATTR2:[0-9]+]]
+; CHECK-NEXT: tail call void @_ZdaPv(ptr nonnull [[TMP0]]) #[[ATTR2:[0-9]+]]
; CHECK-NEXT: br label [[TMP4]]
; CHECK: 4:
; CHECK-NEXT: ret void
;
- %2 = icmp eq i8* %0, null
+ %2 = icmp eq ptr %0, null
br i1 %2, label %4, label %3
; <label>:3: ; preds = %1
- tail call void @_ZdaPv(i8* nonnull %0) #2
+ tail call void @_ZdaPv(ptr nonnull %0) #2
br label %4
; <label>:4: ; preds = %3, %1
@@ -166,15 +166,15 @@ define void @_Z9delete_opPc(i8* %0) local_unnamed_addr #0 {
; TEST 6 (negative case)
; Call realloc
-define noalias i8* @call_realloc(i8* nocapture %0, i64 %1) local_unnamed_addr #0 {
+define noalias ptr @call_realloc(ptr nocapture %0, i64 %1) local_unnamed_addr #0 {
; CHECK: Function Attrs: noinline nounwind uwtable
; CHECK-LABEL: define {{[^@]+}}@call_realloc
-; CHECK-SAME: (i8* nocapture [[TMP0:%.*]], i64 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR1]] {
-; CHECK-NEXT: [[RET:%.*]] = tail call i8* @realloc(i8* nocapture [[TMP0]], i64 [[TMP1]]) #[[ATTR2]]
-; CHECK-NEXT: ret i8* [[RET]]
+; CHECK-SAME: (ptr nocapture [[TMP0:%.*]], i64 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR1]] {
+; CHECK-NEXT: [[RET:%.*]] = tail call ptr @realloc(ptr nocapture [[TMP0]], i64 [[TMP1]]) #[[ATTR2]]
+; CHECK-NEXT: ret ptr [[RET]]
;
- %ret = tail call i8* @realloc(i8* %0, i64 %1) #2
- ret i8* %ret
+ %ret = tail call ptr @realloc(ptr %0, i64 %1) #2
+ ret ptr %ret
}
@@ -299,17 +299,17 @@ define void @f2() #0 {
}
; TEST 12 NoFree argument - positive.
-define double @test12(double* nocapture readonly %a) {
+define double @test12(ptr nocapture readonly %a) {
; CHECK: Function Attrs: nofree nounwind
; CHECK-LABEL: define {{[^@]+}}@test12
-; CHECK-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR7:[0-9]+]] {
+; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR7:[0-9]+]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load double, double* [[A]], align 8
+; CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[A]], align 8
; CHECK-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR2]]
; CHECK-NEXT: ret double [[CALL]]
;
entry:
- %0 = load double, double* %a, align 8
+ %0 = load double, ptr %a, align 8
%call = tail call double @cos(double %0) #2
ret double %call
}
@@ -318,120 +318,118 @@ declare double @cos(double) nobuiltin nounwind nofree
; FIXME: %a should be nofree.
; TEST 13 NoFree argument - positive.
-define noalias i32* @test13(i64* nocapture readonly %a) {
+define noalias ptr @test13(ptr nocapture readonly %a) {
; CHECK: Function Attrs: nounwind
; CHECK-LABEL: define {{[^@]+}}@test13
-; CHECK-SAME: (i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i64, i64* [[A]], align 8
-; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @malloc(i64 [[TMP0]]) #[[ATTR2]]
-; CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[CALL]] to i32*
-; CHECK-NEXT: ret i32* [[TMP1]]
+; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A]], align 8
+; CHECK-NEXT: [[CALL:%.*]] = tail call noalias ptr @malloc(i64 [[TMP0]]) #[[ATTR2]]
+; CHECK-NEXT: ret ptr [[CALL]]
;
entry:
- %0 = load i64, i64* %a, align 8
- %call = tail call noalias i8* @malloc(i64 %0) #2
- %1 = bitcast i8* %call to i32*
- ret i32* %1
+ %0 = load i64, ptr %a, align 8
+ %call = tail call noalias ptr @malloc(i64 %0) #2
+ ret ptr %call
}
-define void @test14(i8* nocapture %0, i8* nocapture %1) {
+define void @test14(ptr nocapture %0, ptr nocapture %1) {
; CHECK: Function Attrs: nounwind
; CHECK-LABEL: define {{[^@]+}}@test14
-; CHECK-SAME: (i8* nocapture [[TMP0:%.*]], i8* nocapture nofree readnone [[TMP1:%.*]]) #[[ATTR0]] {
-; CHECK-NEXT: tail call void @free(i8* nocapture [[TMP0]]) #[[ATTR0]]
+; CHECK-SAME: (ptr nocapture [[TMP0:%.*]], ptr nocapture nofree readnone [[TMP1:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT: tail call void @free(ptr nocapture [[TMP0]]) #[[ATTR0]]
; CHECK-NEXT: ret void
;
- tail call void @free(i8* %0) #1
+ tail call void @free(ptr %0) #1
ret void
}
; UTC_ARGS: --enable
-define void @nonnull_assume_pos(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) {
+define void @nonnull_assume_pos(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4) {
; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_pos
-; ATTRIBUTOR-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]])
-; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) #11 [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ]
-; ATTRIBUTOR-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]])
+; ATTRIBUTOR-SAME: (ptr nofree [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr nofree [[ARG3:%.*]], ptr [[ARG4:%.*]])
+; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) #11 [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
+; ATTRIBUTOR-NEXT: call void @unknown(ptr nofree [[ARG1]], ptr [[ARG2]], ptr nofree [[ARG3]], ptr [[ARG4]])
; ATTRIBUTOR-NEXT: ret void
;
; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_pos
-; CHECK-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) {
-; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ]
-; CHECK-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]])
+; CHECK-SAME: (ptr nofree [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr nofree [[ARG3:%.*]], ptr [[ARG4:%.*]]) {
+; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
+; CHECK-NEXT: call void @unknown(ptr nofree [[ARG1]], ptr [[ARG2]], ptr nofree [[ARG3]], ptr [[ARG4]])
; CHECK-NEXT: ret void
;
- call void @llvm.assume(i1 true) ["nofree"(i8* %arg1), "nofree"(i8* %arg3)]
- call void @unknown(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4)
+ call void @llvm.assume(i1 true) ["nofree"(ptr %arg1), "nofree"(ptr %arg3)]
+ call void @unknown(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4)
ret void
}
-define void @nonnull_assume_neg(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) {
+define void @nonnull_assume_neg(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4) {
; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_neg
-; ATTRIBUTOR-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]])
-; ATTRIBUTOR-NEXT: call void @unknown(i8* [[ARG1]], i8* [[ARG2]], i8* [[ARG3]], i8* [[ARG4]])
-; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ]
+; ATTRIBUTOR-SAME: (ptr [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr [[ARG3:%.*]], ptr [[ARG4:%.*]])
+; ATTRIBUTOR-NEXT: call void @unknown(ptr [[ARG1]], ptr [[ARG2]], ptr [[ARG3]], ptr [[ARG4]])
+; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
; ATTRIBUTOR-NEXT: ret void
;
; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_neg
-; CHECK-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) {
-; CHECK-NEXT: call void @unknown(i8* [[ARG1]], i8* [[ARG2]], i8* [[ARG3]], i8* [[ARG4]])
-; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ]
+; CHECK-SAME: (ptr [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr [[ARG3:%.*]], ptr [[ARG4:%.*]]) {
+; CHECK-NEXT: call void @unknown(ptr [[ARG1]], ptr [[ARG2]], ptr [[ARG3]], ptr [[ARG4]])
+; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
; CHECK-NEXT: ret void
;
- call void @unknown(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4)
- call void @llvm.assume(i1 true) ["nofree"(i8* %arg1), "nofree"(i8* %arg3)]
+ call void @unknown(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4)
+ call void @llvm.assume(i1 true) ["nofree"(ptr %arg1), "nofree"(ptr %arg3)]
ret void
}
-define void @nonnull_assume_call(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) {
+define void @nonnull_assume_call(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4) {
; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_call
-; ATTRIBUTOR-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]])
-; ATTRIBUTOR-NEXT: call void @unknown(i8* [[ARG1]], i8* [[ARG2]], i8* [[ARG3]], i8* [[ARG4]])
-; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias readnone [[ARG1]])
-; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias readnone [[ARG2]])
-; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ]
-; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias nofree readnone [[ARG3]])
-; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias readnone [[ARG4]])
-; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias nofree readnone [[ARG1]])
-; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias readnone [[ARG2]])
-; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG4]]) ]
-; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias nofree readnone [[ARG3]])
-; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias nofree readnone [[ARG4]])
+; ATTRIBUTOR-SAME: (ptr [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr [[ARG3:%.*]], ptr [[ARG4:%.*]])
+; ATTRIBUTOR-NEXT: call void @unknown(ptr [[ARG1]], ptr [[ARG2]], ptr [[ARG3]], ptr [[ARG4]])
+; ATTRIBUTOR-NEXT: call void @use_i8_ptr(ptr noalias readnone [[ARG1]])
+; ATTRIBUTOR-NEXT: call void @use_i8_ptr(ptr noalias readnone [[ARG2]])
+; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
+; ATTRIBUTOR-NEXT: call void @use_i8_ptr(ptr noalias nofree readnone [[ARG3]])
+; ATTRIBUTOR-NEXT: call void @use_i8_ptr(ptr noalias readnone [[ARG4]])
+; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(ptr noalias nofree readnone [[ARG1]])
+; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(ptr noalias readnone [[ARG2]])
+; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG4]]) ]
+; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(ptr noalias nofree readnone [[ARG3]])
+; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(ptr noalias nofree readnone [[ARG4]])
; ATTRIBUTOR-NEXT: ret void
;
; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_call
-; CHECK-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) {
-; CHECK-NEXT: call void @unknown(i8* [[ARG1]], i8* [[ARG2]], i8* [[ARG3]], i8* [[ARG4]])
-; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture readnone [[ARG1]]) #[[ATTR0]]
-; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture readnone [[ARG2]]) #[[ATTR0]]
-; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ]
-; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG3]]) #[[ATTR0]]
-; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture readnone [[ARG4]]) #[[ATTR0]]
-; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree readnone [[ARG1]]) #[[ATTR0]]
-; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture readnone [[ARG2]]) #[[ATTR0]]
-; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG4]]) ]
-; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree readnone [[ARG3]]) #[[ATTR0]]
-; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree readnone [[ARG4]]) #[[ATTR0]]
+; CHECK-SAME: (ptr [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr [[ARG3:%.*]], ptr [[ARG4:%.*]]) {
+; CHECK-NEXT: call void @unknown(ptr [[ARG1]], ptr [[ARG2]], ptr [[ARG3]], ptr [[ARG4]])
+; CHECK-NEXT: call void @use_i8_ptr(ptr noalias nocapture readnone [[ARG1]]) #[[ATTR0]]
+; CHECK-NEXT: call void @use_i8_ptr(ptr noalias nocapture readnone [[ARG2]]) #[[ATTR0]]
+; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG3]]) ]
+; CHECK-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[ARG3]]) #[[ATTR0]]
+; CHECK-NEXT: call void @use_i8_ptr(ptr noalias nocapture readnone [[ARG4]]) #[[ATTR0]]
+; CHECK-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree readnone [[ARG1]]) #[[ATTR0]]
+; CHECK-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture readnone [[ARG2]]) #[[ATTR0]]
+; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(ptr [[ARG1]]), "nofree"(ptr [[ARG4]]) ]
+; CHECK-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree readnone [[ARG3]]) #[[ATTR0]]
+; CHECK-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree readnone [[ARG4]]) #[[ATTR0]]
; CHECK-NEXT: ret void
;
- call void @unknown(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4)
- call void @use_i8_ptr(i8* %arg1)
- call void @use_i8_ptr(i8* %arg2)
- call void @llvm.assume(i1 true) ["nofree"(i8* %arg1), "nofree"(i8* %arg3)]
- call void @use_i8_ptr(i8* %arg3)
- call void @use_i8_ptr(i8* %arg4)
- call void @use_i8_ptr_ret(i8* %arg1)
- call void @use_i8_ptr_ret(i8* %arg2)
- call void @llvm.assume(i1 true) ["nofree"(i8* %arg1), "nofree"(i8* %arg4)]
- call void @use_i8_ptr_ret(i8* %arg3)
- call void @use_i8_ptr_ret(i8* %arg4)
+ call void @unknown(ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4)
+ call void @use_i8_ptr(ptr %arg1)
+ call void @use_i8_ptr(ptr %arg2)
+ call void @llvm.assume(i1 true) ["nofree"(ptr %arg1), "nofree"(ptr %arg3)]
+ call void @use_i8_ptr(ptr %arg3)
+ call void @use_i8_ptr(ptr %arg4)
+ call void @use_i8_ptr_ret(ptr %arg1)
+ call void @use_i8_ptr_ret(ptr %arg2)
+ call void @llvm.assume(i1 true) ["nofree"(ptr %arg1), "nofree"(ptr %arg4)]
+ call void @use_i8_ptr_ret(ptr %arg3)
+ call void @use_i8_ptr_ret(ptr %arg4)
ret void
}
declare void @llvm.assume(i1)
-declare void @unknown(i8*, i8*, i8*, i8*)
-declare void @use_i8_ptr(i8* nocapture readnone) nounwind
-declare void @use_i8_ptr_ret(i8* nocapture readnone) nounwind willreturn
+declare void @unknown(ptr, ptr, ptr, ptr)
+declare void @use_i8_ptr(ptr nocapture readnone) nounwind
+declare void @use_i8_ptr_ret(ptr nocapture readnone) nounwind willreturn
-declare noalias i8* @malloc(i64)
+declare noalias ptr @malloc(i64)
attributes #0 = { nounwind uwtable noinline }
attributes #1 = { nounwind }
diff --git a/llvm/test/Transforms/Attributor/norecurse.ll b/llvm/test/Transforms/Attributor/norecurse.ll
index b920ef3af1077..5704b15fef7df 100644
--- a/llvm/test/Transforms/Attributor/norecurse.ll
+++ b/llvm/test/Transforms/Attributor/norecurse.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=10 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=10 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
define i32 @leaf() {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
@@ -65,20 +65,20 @@ define i32 @extern() {
; CHECK-NEXT: declare i32 @k()
declare i32 @k() readnone
-define void @intrinsic(i8* %dest, i8* %src, i32 %len) {
+define void @intrinsic(ptr %dest, ptr %src, i32 %len) {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; CHECK-LABEL: define {{[^@]+}}@intrinsic
-; CHECK-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR4:[0-9]+]] {
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[DEST]], i8* noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR9:[0-9]+]]
+; CHECK-SAME: (ptr nocapture nofree writeonly [[DEST:%.*]], ptr nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR4:[0-9]+]] {
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture nofree writeonly [[DEST]], ptr noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR9:[0-9]+]]
; CHECK-NEXT: ret void
;
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 %len, i1 false)
ret void
}
; CHECK: Function Attrs
-; CHECK-NEXT: declare void @llvm.memcpy.p0i8.p0i8.i32
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1)
+; CHECK-NEXT: declare void @llvm.memcpy.p0.p0.i32
+declare void @llvm.memcpy.p0.p0.i32(ptr, ptr, i32, i1)
define internal i32 @called_by_norecurse() {
; CHECK: Function Attrs: norecurse nosync memory(none)
@@ -162,7 +162,7 @@ define void @f(i32 %x) {
; TUNIT-SAME: (i32 [[X:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4
-; TUNIT-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4
+; TUNIT-NEXT: store i32 [[X]], ptr [[X_ADDR]], align 4
; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; TUNIT: if.then:
@@ -184,8 +184,8 @@ define void @f(i32 %x) {
;
entry:
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %0 = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4
%tobool = icmp ne i32 %0, 0
br i1 %tobool, label %if.then, label %if.end
@@ -217,9 +217,9 @@ define linkonce_odr i32 @leaf_redefinable() {
}
; Call through a function pointer
-define i32 @eval_func1(i32 (i32)* , i32) local_unnamed_addr {
+define i32 @eval_func1(ptr , i32) local_unnamed_addr {
; CHECK-LABEL: define {{[^@]+}}@eval_func1
-; CHECK-SAME: (i32 (i32)* nocapture nofree noundef nonnull [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr {
+; CHECK-SAME: (ptr nocapture nofree noundef nonnull [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr {
; CHECK-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]])
; CHECK-NEXT: ret i32 [[TMP3]]
;
@@ -227,10 +227,10 @@ define i32 @eval_func1(i32 (i32)* , i32) local_unnamed_addr {
ret i32 %3
}
-define i32 @eval_func2(i32 (i32)* , i32) local_unnamed_addr null_pointer_is_valid{
+define i32 @eval_func2(ptr , i32) local_unnamed_addr null_pointer_is_valid{
; CHECK: Function Attrs: null_pointer_is_valid
; CHECK-LABEL: define {{[^@]+}}@eval_func2
-; CHECK-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] {
+; CHECK-SAME: (ptr nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] {
; CHECK-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]])
; CHECK-NEXT: ret i32 [[TMP3]]
;
diff --git a/llvm/test/Transforms/Attributor/willreturn.ll b/llvm/test/Transforms/Attributor/willreturn.ll
index af986de49df0e..b0a92dc5986c2 100644
--- a/llvm/test/Transforms/Attributor/willreturn.ll
+++ b/llvm/test/Transforms/Attributor/willreturn.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
target datalayout = "e-m:e-i54:64-f80:128-n8:16:32:64-S128"
@@ -253,17 +253,17 @@ define void @only_exit() local_unnamed_addr #0 {
; }
; return;
; }
-define void @conditional_exit(i32 %0, i32* nocapture readonly %1) local_unnamed_addr #0 {
+define void @conditional_exit(i32 %0, ptr nocapture readonly %1) local_unnamed_addr #0 {
; CHECK: Function Attrs: noinline nounwind uwtable
; CHECK-LABEL: define {{[^@]+}}@conditional_exit
-; CHECK-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] {
+; CHECK-SAME: (i32 [[TMP0:%.*]], ptr nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] {
; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
; CHECK-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]]
; CHECK: 4:
; CHECK-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]]
; CHECK-NEXT: unreachable
; CHECK: 5:
-; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP1]], align 4
+; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP1]], align 4
; CHECK-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0
; CHECK-NEXT: br i1 [[TMP7]], label [[TMP9:%.*]], label [[TMP8:%.*]]
; CHECK: 8:
@@ -280,7 +280,7 @@ define void @conditional_exit(i32 %0, i32* nocapture readonly %1) local_unnamed_
unreachable
; <label>:5: ; preds = %2
- %6 = load i32, i32* %1, align 4
+ %6 = load i32, ptr %1, align 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %9, label %8
@@ -424,29 +424,29 @@ label2:
; CHECK-NEXT: declare i1 @maybe_raise_exception()
declare i1 @maybe_raise_exception() #1 willreturn
-define void @invoke_test() personality i32 (...)* @__gxx_personality_v0 {
+define void @invoke_test() personality ptr @__gxx_personality_v0 {
; TUNIT: Function Attrs: mustprogress nounwind willreturn
; TUNIT-LABEL: define {{[^@]+}}@invoke_test
-; TUNIT-SAME: () #[[ATTR12:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 {
+; TUNIT-SAME: () #[[ATTR12:[0-9]+]] personality ptr @__gxx_personality_v0 {
; TUNIT-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR27]]
; TUNIT-NEXT: to label [[N:%.*]] unwind label [[F:%.*]]
; TUNIT: N:
; TUNIT-NEXT: ret void
; TUNIT: F:
-; TUNIT-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 }
-; TUNIT-NEXT: catch i8* null
+; TUNIT-NEXT: [[VAL:%.*]] = landingpad { ptr, i32 }
+; TUNIT-NEXT: catch ptr null
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: mustprogress nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@invoke_test
-; CGSCC-SAME: () #[[ATTR12:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 {
+; CGSCC-SAME: () #[[ATTR12:[0-9]+]] personality ptr @__gxx_personality_v0 {
; CGSCC-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR28]]
; CGSCC-NEXT: to label [[N:%.*]] unwind label [[F:%.*]]
; CGSCC: N:
; CGSCC-NEXT: ret void
; CGSCC: F:
-; CGSCC-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 }
-; CGSCC-NEXT: catch i8* null
+; CGSCC-NEXT: [[VAL:%.*]] = landingpad { ptr, i32 }
+; CGSCC-NEXT: catch ptr null
; CGSCC-NEXT: ret void
;
invoke i1 @maybe_raise_exception()
@@ -454,8 +454,8 @@ define void @invoke_test() personality i32 (...)* @__gxx_personality_v0 {
N:
ret void
F:
- %val = landingpad { i8*, i32 }
- catch i8* null
+ %val = landingpad { ptr, i32 }
+ catch ptr null
ret void
}
@@ -472,18 +472,18 @@ declare i32 @__gxx_personality_v0(...)
; return ans;
; }
-define i32 @loop_constant_trip_count(i32* nocapture readonly %0) #0 {
+define i32 @loop_constant_trip_count(ptr nocapture readonly %0) #0 {
; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable
; CHECK-LABEL: define {{[^@]+}}@loop_constant_trip_count
-; CHECK-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR13:[0-9]+]] {
+; CHECK-SAME: (ptr nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR13:[0-9]+]] {
; CHECK-NEXT: br label [[TMP3:%.*]]
; CHECK: 2:
; CHECK-NEXT: ret i32 [[TMP8:%.*]]
; CHECK: 3:
; CHECK-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ]
; CHECK-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ]
-; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]]
-; CHECK-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4
+; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, ptr [[TMP0]], i64 [[TMP4]]
+; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP6]], align 4
; CHECK-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]]
; CHECK-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1
; CHECK-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10
@@ -497,8 +497,8 @@ define i32 @loop_constant_trip_count(i32* nocapture readonly %0) #0 {
; <label>:3: ; preds = %3, %1
%4 = phi i64 [ 0, %1 ], [ %9, %3 ]
%5 = phi i32 [ 0, %1 ], [ %8, %3 ]
- %6 = getelementptr inbounds i32, i32* %0, i64 %4
- %7 = load i32, i32* %6, align 4
+ %6 = getelementptr inbounds i32, ptr %0, i64 %4
+ %7 = load i32, ptr %6, align 4
%8 = add nsw i32 %7, %5
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 10
@@ -516,10 +516,10 @@ define i32 @loop_constant_trip_count(i32* nocapture readonly %0) #0 {
; }
; return ans;
; }
-define i32 @loop_trip_count_unbound(i32 %0, i32 %1, i32* nocapture readonly %2, i32 %3) local_unnamed_addr #0 {
+define i32 @loop_trip_count_unbound(i32 %0, i32 %1, ptr nocapture readonly %2, i32 %3) local_unnamed_addr #0 {
; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind memory(argmem: read) uwtable
; CHECK-LABEL: define {{[^@]+}}@loop_trip_count_unbound
-; CHECK-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR14:[0-9]+]] {
+; CHECK-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], ptr nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR14:[0-9]+]] {
; CHECK-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]]
; CHECK-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]]
; CHECK: 6:
@@ -529,8 +529,8 @@ define i32 @loop_trip_count_unbound(i32 %0, i32 %1, i32* nocapture readonly %2,
; CHECK-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ]
; CHECK-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ]
; CHECK-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64
-; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]]
-; CHECK-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4
+; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[TMP11]]
+; CHECK-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
; CHECK-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]]
; CHECK-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]]
; CHECK-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]]
@@ -547,8 +547,8 @@ define i32 @loop_trip_count_unbound(i32 %0, i32 %1, i32* nocapture readonly %2,
%9 = phi i32 [ %15, %8 ], [ %0, %4 ]
%10 = phi i32 [ %14, %8 ], [ 0, %4 ]
%11 = zext i32 %9 to i64
- %12 = getelementptr inbounds i32, i32* %2, i64 %11
- %13 = load i32, i32* %12, align 4
+ %12 = getelementptr inbounds i32, ptr %2, i64 %11
+ %13 = load i32, ptr %12, align 4
%14 = add nsw i32 %13, %10
%15 = add i32 %9, %3
%16 = icmp eq i32 %15, %1
@@ -567,10 +567,10 @@ define i32 @loop_trip_count_unbound(i32 %0, i32 %1, i32* nocapture readonly %2,
; }
-define i32 @loop_trip_dec(i32 %0, i32* nocapture readonly %1) local_unnamed_addr #0 {
+define i32 @loop_trip_dec(i32 %0, ptr nocapture readonly %1) local_unnamed_addr #0 {
; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable
; CHECK-LABEL: define {{[^@]+}}@loop_trip_dec
-; CHECK-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR13]] {
+; CHECK-SAME: (i32 [[TMP0:%.*]], ptr nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR13]] {
; CHECK-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1
; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]]
; CHECK: 4:
@@ -579,8 +579,8 @@ define i32 @loop_trip_dec(i32 %0, i32* nocapture readonly %1) local_unnamed_addr
; CHECK: 6:
; CHECK-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ]
; CHECK-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ]
-; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]]
-; CHECK-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4
+; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 [[TMP7]]
+; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP9]], align 4
; CHECK-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]]
; CHECK-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1
; CHECK-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0
@@ -599,8 +599,8 @@ define i32 @loop_trip_dec(i32 %0, i32* nocapture readonly %1) local_unnamed_addr
; <label>:6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %12, %6 ]
%8 = phi i32 [ 0, %4 ], [ %11, %6 ]
- %9 = getelementptr inbounds i32, i32* %1, i64 %7
- %10 = load i32, i32* %9, align 4
+ %9 = getelementptr inbounds i32, ptr %1, i64 %7
+ %10 = load i32, ptr %9, align 4
%11 = add nsw i32 %10, %8
%12 = add nsw i64 %7, -1
%13 = icmp sgt i64 %7, 0
@@ -746,17 +746,17 @@ unreachable_label:
}
; CHECK: Function Attrs: noreturn nounwind
-; CHECK-NEXT: declare void @llvm.eh.sjlj.longjmp(i8*)
-declare void @llvm.eh.sjlj.longjmp(i8*)
+; CHECK-NEXT: declare void @llvm.eh.sjlj.longjmp(ptr)
+declare void @llvm.eh.sjlj.longjmp(ptr)
-define void @call_longjmp(i8* nocapture readnone %0) local_unnamed_addr #0 {
+define void @call_longjmp(ptr nocapture readnone %0) local_unnamed_addr #0 {
; CHECK: Function Attrs: noinline nounwind uwtable
; CHECK-LABEL: define {{[^@]+}}@call_longjmp
-; CHECK-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR7]] {
-; CHECK-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR5]]
+; CHECK-SAME: (ptr nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR7]] {
+; CHECK-NEXT: tail call void @llvm.eh.sjlj.longjmp(ptr noalias readnone [[TMP0]]) #[[ATTR5]]
; CHECK-NEXT: unreachable
;
- tail call void @llvm.eh.sjlj.longjmp(i8* %0)
+ tail call void @llvm.eh.sjlj.longjmp(ptr %0)
ret void
}
More information about the llvm-commits
mailing list