[llvm] f1dda96 - [Attributor] Convert test to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 20 08:39:10 PDT 2023
Author: Nikita Popov
Date: 2023-06-20T17:38:40+02:00
New Revision: f1dda9625f39eab6c3bc0390e27654088769d664
URL: https://github.com/llvm/llvm-project/commit/f1dda9625f39eab6c3bc0390e27654088769d664
DIFF: https://github.com/llvm/llvm-project/commit/f1dda9625f39eab6c3bc0390e27654088769d664.diff
LOG: [Attributor] Convert test to opaque pointers (NFC)
Added:
Modified:
llvm/test/Transforms/Attributor/nosync.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Attributor/nosync.ll b/llvm/test/Transforms/Attributor/nosync.ll
index 27100f3586c56..880ff5dc0dd7e 100644
--- a/llvm/test/Transforms/Attributor/nosync.ll
+++ b/llvm/test/Transforms/Attributor/nosync.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=3 -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=3 -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"
; Test cases designed for the nosync function attribute.
@@ -29,17 +29,17 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
;.
; CHECK: @[[A:[a-zA-Z0-9_$"\\.-]+]] = common global i32 0, align 4
;.
-define i32* @foo(%struct.ST* %s) nounwind optsize ssp memory(none) uwtable {
+define ptr @foo(ptr %s) nounwind optsize ssp memory(none) uwtable {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind optsize ssp willreturn memory(none) uwtable
; CHECK-LABEL: define {{[^@]+}}@foo
-; CHECK-SAME: (%struct.ST* nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: (ptr nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13
-; CHECK-NEXT: ret i32* [[ARRAYIDX]]
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], ptr [[S]], i64 1, i32 2, i32 1, i64 5, i64 13
+; CHECK-NEXT: ret ptr [[ARRAYIDX]]
;
entry:
- %arrayidx = getelementptr inbounds %struct.ST, %struct.ST* %s, i64 1, i32 2, i32 1, i64 5, i64 13
- ret i32* %arrayidx
+ %arrayidx = getelementptr inbounds %struct.ST, ptr %s, i64 1, i32 2, i32 1, i64 5, i64 13
+ ret ptr %arrayidx
}
; TEST 2
@@ -49,14 +49,14 @@ entry:
; return n;
; }
-define i32 @load_monotonic(i32* nocapture readonly %arg) norecurse nounwind uwtable {
+define i32 @load_monotonic(ptr nocapture readonly %arg) norecurse nounwind uwtable {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@load_monotonic
-; CHECK-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] {
-; CHECK-NEXT: [[I:%.*]] = load atomic i32, i32* [[ARG]] monotonic, align 4
+; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] {
+; CHECK-NEXT: [[I:%.*]] = load atomic i32, ptr [[ARG]] monotonic, align 4
; CHECK-NEXT: ret i32 [[I]]
;
- %i = load atomic i32, i32* %arg monotonic, align 4
+ %i = load atomic i32, ptr %arg monotonic, align 4
ret i32 %i
}
@@ -67,14 +67,14 @@ define i32 @load_monotonic(i32* nocapture readonly %arg) norecurse nounwind uwta
; atomic_load_explicit(num, memory_order_relaxed);
; }
-define void @store_monotonic(i32* nocapture %arg) norecurse nounwind uwtable {
+define void @store_monotonic(ptr nocapture %arg) norecurse nounwind uwtable {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@store_monotonic
-; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT: store atomic i32 10, i32* [[ARG]] monotonic, align 4
+; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT: store atomic i32 10, ptr [[ARG]] monotonic, align 4
; CHECK-NEXT: ret void
;
- store atomic i32 10, i32* %arg monotonic, align 4
+ store atomic i32 10, ptr %arg monotonic, align 4
ret void
}
@@ -85,14 +85,14 @@ define void @store_monotonic(i32* nocapture %arg) norecurse nounwind uwtable {
; return n;
; }
-define i32 @load_acquire(i32* nocapture readonly %arg) norecurse nounwind uwtable {
+define i32 @load_acquire(ptr nocapture readonly %arg) norecurse nounwind uwtable {
; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@load_acquire
-; CHECK-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {
-; CHECK-NEXT: [[I:%.*]] = load atomic i32, i32* [[ARG]] acquire, align 4
+; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {
+; CHECK-NEXT: [[I:%.*]] = load atomic i32, ptr [[ARG]] acquire, align 4
; CHECK-NEXT: ret i32 [[I]]
;
- %i = load atomic i32, i32* %arg acquire, align 4
+ %i = load atomic i32, ptr %arg acquire, align 4
ret i32 %i
}
@@ -102,27 +102,27 @@ define i32 @load_acquire(i32* nocapture readonly %arg) norecurse nounwind uwtabl
; atomic_store_explicit(num, 10, memory_order_release);
; }
-define void @load_release(i32* nocapture %arg) norecurse nounwind uwtable {
+define void @load_release(ptr nocapture %arg) norecurse nounwind uwtable {
; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@load_release
-; CHECK-SAME: (i32* nocapture nofree noundef writeonly align 4 [[ARG:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT: store atomic volatile i32 10, i32* [[ARG]] release, align 4
+; CHECK-SAME: (ptr nocapture nofree noundef writeonly align 4 [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: store atomic volatile i32 10, ptr [[ARG]] release, align 4
; CHECK-NEXT: ret void
;
- store atomic volatile i32 10, i32* %arg release, align 4
+ store atomic volatile i32 10, ptr %arg release, align 4
ret void
}
; TEST 6 - negative volatile, relaxed atomic
-define void @load_volatile_release(i32* nocapture %arg) norecurse nounwind uwtable {
+define void @load_volatile_release(ptr nocapture %arg) norecurse nounwind uwtable {
; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@load_volatile_release
-; CHECK-SAME: (i32* nocapture nofree noundef writeonly align 4 [[ARG:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT: store atomic volatile i32 10, i32* [[ARG]] release, align 4
+; CHECK-SAME: (ptr nocapture nofree noundef writeonly align 4 [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: store atomic volatile i32 10, ptr [[ARG]] release, align 4
; CHECK-NEXT: ret void
;
- store atomic volatile i32 10, i32* %arg release, align 4
+ store atomic volatile i32 10, ptr %arg release, align 4
ret void
}
@@ -132,14 +132,14 @@ define void @load_volatile_release(i32* nocapture %arg) norecurse nounwind uwtab
; *num = 14;
; }
-define void @volatile_store(i32* %arg) norecurse nounwind uwtable {
+define void @volatile_store(ptr %arg) norecurse nounwind uwtable {
; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@volatile_store
-; CHECK-SAME: (i32* nofree noundef align 4 [[ARG:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT: store volatile i32 14, i32* [[ARG]], align 4
+; CHECK-SAME: (ptr nofree noundef align 4 [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: store volatile i32 14, ptr [[ARG]], align 4
; CHECK-NEXT: ret void
;
- store volatile i32 14, i32* %arg, align 4
+ store volatile i32 14, ptr %arg, align 4
ret void
}
@@ -150,14 +150,14 @@ define void @volatile_store(i32* %arg) norecurse nounwind uwtable {
; return n;
; }
-define i32 @volatile_load(i32* %arg) norecurse nounwind uwtable {
+define i32 @volatile_load(ptr %arg) norecurse nounwind uwtable {
; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@volatile_load
-; CHECK-SAME: (i32* nofree noundef align 4 [[ARG:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT: [[I:%.*]] = load volatile i32, i32* [[ARG]], align 4
+; CHECK-SAME: (ptr nofree noundef align 4 [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: [[I:%.*]] = load volatile i32, ptr [[ARG]], align 4
; CHECK-NEXT: ret i32 [[I]]
;
- %i = load volatile i32, i32* %arg, align 4
+ %i = load volatile i32, ptr %arg, align 4
ret i32 %i
}
@@ -198,34 +198,34 @@ define void @call_might_sync() noinline nounwind uwtable {
; TEST 11 - positive, should deduce nosync
; volatile operation in same scc but dead. Call volatile_load defined in TEST 8.
-define i32 @scc1(i32* %arg) noinline nounwind uwtable {
+define i32 @scc1(ptr %arg) noinline nounwind uwtable {
; TUNIT: Function Attrs: nofree noinline nounwind memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@scc1
-; TUNIT-SAME: (i32* nofree [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
-; TUNIT-NEXT: tail call void @scc2(i32* nofree [[ARG]]) #[[ATTR19:[0-9]+]]
-; TUNIT-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree align 4 [[ARG]]) #[[ATTR19]]
+; TUNIT-SAME: (ptr nofree [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
+; TUNIT-NEXT: tail call void @scc2(ptr nofree [[ARG]]) #[[ATTR19:[0-9]+]]
+; TUNIT-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(ptr nofree align 4 [[ARG]]) #[[ATTR19]]
; TUNIT-NEXT: ret i32 [[VAL]]
;
; CGSCC: Function Attrs: nofree noinline nounwind memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@scc1
-; CGSCC-SAME: (i32* nofree [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
-; CGSCC-NEXT: tail call void @scc2(i32* nofree [[ARG]]) #[[ATTR19:[0-9]+]]
-; CGSCC-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree noundef align 4 [[ARG]]) #[[ATTR16:[0-9]+]]
+; CGSCC-SAME: (ptr nofree [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
+; CGSCC-NEXT: tail call void @scc2(ptr nofree [[ARG]]) #[[ATTR19:[0-9]+]]
+; CGSCC-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(ptr nofree noundef align 4 [[ARG]]) #[[ATTR16:[0-9]+]]
; CGSCC-NEXT: ret i32 [[VAL]]
;
- tail call void @scc2(i32* %arg)
- %val = tail call i32 @volatile_load(i32* %arg)
+ tail call void @scc2(ptr %arg)
+ %val = tail call i32 @volatile_load(ptr %arg)
ret i32 %val
}
-define void @scc2(i32* %arg) noinline nounwind uwtable {
+define void @scc2(ptr %arg) noinline nounwind uwtable {
; CHECK: Function Attrs: nofree noinline nounwind memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@scc2
-; CHECK-SAME: (i32* nofree [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
-; CHECK-NEXT: [[I:%.*]] = tail call i32 @scc1(i32* nofree [[ARG]]) #[[ATTR19:[0-9]+]]
+; CHECK-SAME: (ptr nofree [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
+; CHECK-NEXT: [[I:%.*]] = tail call i32 @scc1(ptr nofree [[ARG]]) #[[ATTR19:[0-9]+]]
; CHECK-NEXT: ret void
;
- %i = tail call i32 @scc1(i32* %arg)
+ %i = tail call i32 @scc1(ptr %arg)
ret void
}
@@ -248,31 +248,28 @@ define void @scc2(i32* %arg) noinline nounwind uwtable {
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
-define void @foo1(i32* %arg, %"struct.std::atomic"* %arg1) {
+define void @foo1(ptr %arg, ptr %arg1) {
; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn
; CHECK-LABEL: define {{[^@]+}}@foo1
-; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[ARG1:%.*]]) #[[ATTR6:[0-9]+]] {
-; CHECK-NEXT: store i32 100, i32* [[ARG]], align 4
+; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]], ptr nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ARG1:%.*]]) #[[ATTR6:[0-9]+]] {
+; CHECK-NEXT: store i32 100, ptr [[ARG]], align 4
; CHECK-NEXT: fence release
-; CHECK-NEXT: [[I:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[ARG1]], i64 0, i32 0, i32 0
-; CHECK-NEXT: store atomic i8 1, i8* [[I]] monotonic, align 1
+; CHECK-NEXT: store atomic i8 1, ptr [[ARG1]] monotonic, align 1
; CHECK-NEXT: ret void
;
- store i32 100, i32* %arg, align 4
+ store i32 100, ptr %arg, align 4
fence release
- %i = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %arg1, i64 0, i32 0, i32 0
- store atomic i8 1, i8* %i monotonic, align 1
+ store atomic i8 1, ptr %arg1 monotonic, align 1
ret void
}
-define void @bar(i32* %arg, %"struct.std::atomic"* %arg1) {
+define void @bar(ptr %arg, ptr %arg1) {
; CHECK: Function Attrs: nofree norecurse nounwind
; CHECK-LABEL: define {{[^@]+}}@bar
-; CHECK-SAME: (i32* nocapture nofree readnone [[ARG:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[ARG1:%.*]]) #[[ATTR7:[0-9]+]] {
-; CHECK-NEXT: [[I:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[ARG1]], i64 0, i32 0, i32 0
+; CHECK-SAME: (ptr nocapture nofree readnone [[ARG:%.*]], ptr nocapture nofree nonnull readonly dereferenceable(1) [[ARG1:%.*]]) #[[ATTR7:[0-9]+]] {
; CHECK-NEXT: br label [[BB2:%.*]]
; CHECK: bb2:
-; CHECK-NEXT: [[I3:%.*]] = load atomic i8, i8* [[I]] monotonic, align 1
+; CHECK-NEXT: [[I3:%.*]] = load atomic i8, ptr [[ARG1]] monotonic, align 1
; CHECK-NEXT: [[I4:%.*]] = and i8 [[I3]], 1
; CHECK-NEXT: [[I5:%.*]] = icmp eq i8 [[I4]], 0
; CHECK-NEXT: br i1 [[I5]], label [[BB2]], label [[BB6:%.*]]
@@ -280,11 +277,10 @@ define void @bar(i32* %arg, %"struct.std::atomic"* %arg1) {
; CHECK-NEXT: fence acquire
; CHECK-NEXT: ret void
;
- %i = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %arg1, i64 0, i32 0, i32 0
br label %bb2
bb2:
- %i3 = load atomic i8, i8* %i monotonic, align 1
+ %i3 = load atomic i8, ptr %arg1 monotonic, align 1
%i4 = and i8 %i3, 1
%i5 = icmp eq i8 %i4, 0
br i1 %i5, label %bb2, label %bb6
@@ -295,31 +291,28 @@ bb6:
}
; TEST 13 - Fence syncscope("singlethread") seq_cst
-define void @foo1_singlethread(i32* %arg, %"struct.std::atomic"* %arg1) {
+define void @foo1_singlethread(ptr %arg, ptr %arg1) {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
; CHECK-LABEL: define {{[^@]+}}@foo1_singlethread
-; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[ARG1:%.*]]) #[[ATTR8:[0-9]+]] {
-; CHECK-NEXT: store i32 100, i32* [[ARG]], align 4
+; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]], ptr nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ARG1:%.*]]) #[[ATTR8:[0-9]+]] {
+; CHECK-NEXT: store i32 100, ptr [[ARG]], align 4
; CHECK-NEXT: fence syncscope("singlethread") release
-; CHECK-NEXT: [[I:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[ARG1]], i64 0, i32 0, i32 0
-; CHECK-NEXT: store atomic i8 1, i8* [[I]] monotonic, align 1
+; CHECK-NEXT: store atomic i8 1, ptr [[ARG1]] monotonic, align 1
; CHECK-NEXT: ret void
;
- store i32 100, i32* %arg, align 4
+ store i32 100, ptr %arg, align 4
fence syncscope("singlethread") release
- %i = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %arg1, i64 0, i32 0, i32 0
- store atomic i8 1, i8* %i monotonic, align 1
+ store atomic i8 1, ptr %arg1 monotonic, align 1
ret void
}
-define void @bar_singlethread(i32* %arg, %"struct.std::atomic"* %arg1) {
+define void @bar_singlethread(ptr %arg, ptr %arg1) {
; CHECK: Function Attrs: nofree norecurse nosync nounwind
; CHECK-LABEL: define {{[^@]+}}@bar_singlethread
-; CHECK-SAME: (i32* nocapture nofree readnone [[ARG:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[ARG1:%.*]]) #[[ATTR9:[0-9]+]] {
-; CHECK-NEXT: [[I:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[ARG1]], i64 0, i32 0, i32 0
+; CHECK-SAME: (ptr nocapture nofree readnone [[ARG:%.*]], ptr nocapture nofree nonnull readonly dereferenceable(1) [[ARG1:%.*]]) #[[ATTR9:[0-9]+]] {
; CHECK-NEXT: br label [[BB2:%.*]]
; CHECK: bb2:
-; CHECK-NEXT: [[I3:%.*]] = load atomic i8, i8* [[I]] monotonic, align 1
+; CHECK-NEXT: [[I3:%.*]] = load atomic i8, ptr [[ARG1]] monotonic, align 1
; CHECK-NEXT: [[I4:%.*]] = and i8 [[I3]], 1
; CHECK-NEXT: [[I5:%.*]] = icmp eq i8 [[I4]], 0
; CHECK-NEXT: br i1 [[I5]], label [[BB2]], label [[BB6:%.*]]
@@ -327,11 +320,10 @@ define void @bar_singlethread(i32* %arg, %"struct.std::atomic"* %arg1) {
; CHECK-NEXT: fence syncscope("singlethread") acquire
; CHECK-NEXT: ret void
;
- %i = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %arg1, i64 0, i32 0, i32 0
br label %bb2
bb2:
- %i3 = load atomic i8, i8* %i monotonic, align 1
+ %i3 = load atomic i8, ptr %arg1 monotonic, align 1
%i4 = and i8 %i3, 1
%i5 = icmp eq i8 %i4, 0
br i1 %i5, label %bb2, label %bb6
@@ -341,21 +333,21 @@ bb6:
ret void
}
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 %isvolatile)
-declare void @llvm.memset.p0i8.i32(i8* %dest, i8 %val, i32 %len, i1 %isvolatile)
+declare void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 %len, i1 %isvolatile)
+declare void @llvm.memset.p0.i32(ptr %dest, i8 %val, i32 %len, i1 %isvolatile)
; TEST 14 - negative, checking volatile intrinsics.
; It is odd to add nocapture but a result of the llvm.memcpy nocapture.
;
-define i32 @memcpy_volatile(i8* %ptr1, i8* %ptr2) {
+define i32 @memcpy_volatile(ptr %ptr1, ptr %ptr2) {
; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite)
; CHECK-LABEL: define {{[^@]+}}@memcpy_volatile
-; CHECK-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR12:[0-9]+]] {
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR20:[0-9]+]]
+; CHECK-SAME: (ptr nocapture nofree writeonly [[PTR1:%.*]], ptr nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR12:[0-9]+]] {
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture nofree writeonly [[PTR1]], ptr noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR20:[0-9]+]]
; CHECK-NEXT: ret i32 4
;
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %ptr1, i8* %ptr2, i32 8, i1 true)
+ call void @llvm.memcpy.p0.p0.i32(ptr %ptr1, ptr %ptr2, i32 8, i1 true)
ret i32 4
}
@@ -363,14 +355,14 @@ define i32 @memcpy_volatile(i8* %ptr1, i8* %ptr2) {
; It is odd to add nocapture but a result of the llvm.memset nocapture.
;
-define i32 @memset_non_volatile(i8* %ptr1, i8 %val) {
+define i32 @memset_non_volatile(ptr %ptr1, i8 %val) {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
; CHECK-LABEL: define {{[^@]+}}@memset_non_volatile
-; CHECK-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR13:[0-9]+]] {
-; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR20]]
+; CHECK-SAME: (ptr nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR13:[0-9]+]] {
+; CHECK-NEXT: call void @llvm.memset.p0.i32(ptr nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR20]]
; CHECK-NEXT: ret i32 4
;
- call void @llvm.memset.p0i8.i32(i8* %ptr1, i8 %val, i32 8, i1 false)
+ call void @llvm.memset.p0.i32(ptr %ptr1, i8 %val, i32 8, i1 false)
ret i32 4
}
@@ -401,8 +393,8 @@ define void @convergent_readnone() {
}
; CHECK: Function Attrs: nounwind
-; CHECK-NEXT: declare void @llvm.x86.sse2.clflush(i8*)
-declare void @llvm.x86.sse2.clflush(i8*)
+; CHECK-NEXT: declare void @llvm.x86.sse2.clflush(ptr)
+declare void @llvm.x86.sse2.clflush(ptr)
@a = common global i32 0, align 4
; TEST 18 - negative. Synchronizing intrinsic
@@ -411,10 +403,10 @@ define void @i_totally_sync() {
; CHECK: Function Attrs: nounwind
; CHECK-LABEL: define {{[^@]+}}@i_totally_sync
; CHECK-SAME: () #[[ATTR16:[0-9]+]] {
-; CHECK-NEXT: tail call void @llvm.x86.sse2.clflush(i8* noundef nonnull align 4 dereferenceable(4) bitcast (i32* @a to i8*))
+; CHECK-NEXT: tail call void @llvm.x86.sse2.clflush(ptr noundef nonnull align 4 dereferenceable(4) @a)
; CHECK-NEXT: ret void
;
- tail call void @llvm.x86.sse2.clflush(i8* bitcast (i32* @a to i8*))
+ tail call void @llvm.x86.sse2.clflush(ptr @a)
ret void
}
More information about the llvm-commits
mailing list