[llvm] d5c5265 - [Attributor] Name instructions in test (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 20 08:39:08 PDT 2023
Author: Nikita Popov
Date: 2023-06-20T17:37:31+02:00
New Revision: d5c52651c3fd39b529842f67c0184e2fffa74b3e
URL: https://github.com/llvm/llvm-project/commit/d5c52651c3fd39b529842f67c0184e2fffa74b3e
DIFF: https://github.com/llvm/llvm-project/commit/d5c52651c3fd39b529842f67c0184e2fffa74b3e.diff
LOG: [Attributor] Name instructions in test (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 d5f702b3878cf..27100f3586c56 100644
--- a/llvm/test/Transforms/Attributor/nosync.ll
+++ b/llvm/test/Transforms/Attributor/nosync.ll
@@ -29,7 +29,7 @@ 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 uwtable readnone optsize ssp {
+define i32* @foo(%struct.ST* %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]+]] {
@@ -49,15 +49,15 @@ entry:
; return n;
; }
-define i32 @load_monotonic(i32* nocapture readonly %0) norecurse nounwind uwtable {
+define i32 @load_monotonic(i32* 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) [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] {
-; CHECK-NEXT: [[TMP2:%.*]] = load atomic i32, i32* [[TMP0]] monotonic, align 4
-; CHECK-NEXT: ret i32 [[TMP2]]
+; 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-NEXT: ret i32 [[I]]
;
- %2 = load atomic i32, i32* %0 monotonic, align 4
- ret i32 %2
+ %i = load atomic i32, i32* %arg monotonic, align 4
+ ret i32 %i
}
@@ -67,14 +67,14 @@ define i32 @load_monotonic(i32* nocapture readonly %0) norecurse nounwind uwtabl
; atomic_load_explicit(num, memory_order_relaxed);
; }
-define void @store_monotonic(i32* nocapture %0) norecurse nounwind uwtable {
+define void @store_monotonic(i32* 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) [[TMP0:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT: store atomic i32 10, i32* [[TMP0]] monotonic, align 4
+; 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-NEXT: ret void
;
- store atomic i32 10, i32* %0 monotonic, align 4
+ store atomic i32 10, i32* %arg monotonic, align 4
ret void
}
@@ -85,15 +85,15 @@ define void @store_monotonic(i32* nocapture %0) norecurse nounwind uwtable {
; return n;
; }
-define i32 @load_acquire(i32* nocapture readonly %0) norecurse nounwind uwtable {
+define i32 @load_acquire(i32* 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) [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] {
-; CHECK-NEXT: [[TMP2:%.*]] = load atomic i32, i32* [[TMP0]] acquire, align 4
-; CHECK-NEXT: ret i32 [[TMP2]]
+; 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-NEXT: ret i32 [[I]]
;
- %2 = load atomic i32, i32* %0 acquire, align 4
- ret i32 %2
+ %i = load atomic i32, i32* %arg acquire, align 4
+ ret i32 %i
}
; TEST 5 - negative, should not deduce nosync
@@ -102,27 +102,27 @@ define i32 @load_acquire(i32* nocapture readonly %0) norecurse nounwind uwtable
; atomic_store_explicit(num, 10, memory_order_release);
; }
-define void @load_release(i32* nocapture %0) norecurse nounwind uwtable {
+define void @load_release(i32* 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 [[TMP0:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT: store atomic volatile i32 10, i32* [[TMP0]] release, align 4
+; CHECK-SAME: (i32* nocapture nofree noundef writeonly align 4 [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: store atomic volatile i32 10, i32* [[ARG]] release, align 4
; CHECK-NEXT: ret void
;
- store atomic volatile i32 10, i32* %0 release, align 4
+ store atomic volatile i32 10, i32* %arg release, align 4
ret void
}
; TEST 6 - negative volatile, relaxed atomic
-define void @load_volatile_release(i32* nocapture %0) norecurse nounwind uwtable {
+define void @load_volatile_release(i32* 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 [[TMP0:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT: store atomic volatile i32 10, i32* [[TMP0]] release, align 4
+; CHECK-SAME: (i32* nocapture nofree noundef writeonly align 4 [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: store atomic volatile i32 10, i32* [[ARG]] release, align 4
; CHECK-NEXT: ret void
;
- store atomic volatile i32 10, i32* %0 release, align 4
+ store atomic volatile i32 10, i32* %arg release, align 4
ret void
}
@@ -132,14 +132,14 @@ define void @load_volatile_release(i32* nocapture %0) norecurse nounwind uwtable
; *num = 14;
; }
-define void @volatile_store(i32* %0) norecurse nounwind uwtable {
+define void @volatile_store(i32* %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 [[TMP0:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT: store volatile i32 14, i32* [[TMP0]], align 4
+; CHECK-SAME: (i32* nofree noundef align 4 [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: store volatile i32 14, i32* [[ARG]], align 4
; CHECK-NEXT: ret void
;
- store volatile i32 14, i32* %0, align 4
+ store volatile i32 14, i32* %arg, align 4
ret void
}
@@ -150,15 +150,15 @@ define void @volatile_store(i32* %0) norecurse nounwind uwtable {
; return n;
; }
-define i32 @volatile_load(i32* %0) norecurse nounwind uwtable {
+define i32 @volatile_load(i32* %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 [[TMP0:%.*]]) #[[ATTR2]] {
-; CHECK-NEXT: [[TMP2:%.*]] = load volatile i32, i32* [[TMP0]], align 4
-; CHECK-NEXT: ret i32 [[TMP2]]
+; CHECK-SAME: (i32* nofree noundef align 4 [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: [[I:%.*]] = load volatile i32, i32* [[ARG]], align 4
+; CHECK-NEXT: ret i32 [[I]]
;
- %2 = load volatile i32, i32* %0, align 4
- ret i32 %2
+ %i = load volatile i32, i32* %arg, align 4
+ ret i32 %i
}
; TEST 9
@@ -167,7 +167,7 @@ define i32 @volatile_load(i32* %0) norecurse nounwind uwtable {
; CHECK-NEXT: declare void @nosync_function()
declare void @nosync_function() noinline nounwind uwtable nosync
-define void @call_nosync_function() nounwind uwtable noinline {
+define void @call_nosync_function() noinline nounwind uwtable {
; CHECK: Function Attrs: noinline nosync nounwind uwtable
; CHECK-LABEL: define {{[^@]+}}@call_nosync_function
; CHECK-SAME: () #[[ATTR3:[0-9]+]] {
@@ -184,7 +184,7 @@ define void @call_nosync_function() nounwind uwtable noinline {
; CHECK-NEXT: declare void @might_sync()
declare void @might_sync() noinline nounwind uwtable
-define void @call_might_sync() nounwind uwtable noinline {
+define void @call_might_sync() noinline nounwind uwtable {
; CHECK: Function Attrs: noinline nounwind uwtable
; CHECK-LABEL: define {{[^@]+}}@call_might_sync
; CHECK-SAME: () #[[ATTR4]] {
@@ -198,35 +198,35 @@ define void @call_might_sync() nounwind uwtable noinline {
; TEST 11 - positive, should deduce nosync
; volatile operation in same scc but dead. Call volatile_load defined in TEST 8.
-define i32 @scc1(i32* %0) noinline nounwind uwtable {
+define i32 @scc1(i32* %arg) noinline nounwind uwtable {
; TUNIT: Function Attrs: nofree noinline nounwind memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@scc1
-; TUNIT-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] {
-; TUNIT-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]]
-; TUNIT-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree align 4 [[TMP0]]) #[[ATTR19]]
+; 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-NEXT: ret i32 [[VAL]]
;
; CGSCC: Function Attrs: nofree noinline nounwind memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@scc1
-; CGSCC-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] {
-; CGSCC-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]]
-; CGSCC-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree noundef align 4 [[TMP0]]) #[[ATTR14:[0-9]+]]
+; 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-NEXT: ret i32 [[VAL]]
;
- tail call void @scc2(i32* %0);
- %val = tail call i32 @volatile_load(i32* %0);
- ret i32 %val;
+ tail call void @scc2(i32* %arg)
+ %val = tail call i32 @volatile_load(i32* %arg)
+ ret i32 %val
}
-define void @scc2(i32* %0) noinline nounwind uwtable {
+define void @scc2(i32* %arg) noinline nounwind uwtable {
; CHECK: Function Attrs: nofree noinline nounwind memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@scc2
-; CHECK-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] {
-; CHECK-NEXT: [[TMP2:%.*]] = tail call i32 @scc1(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]]
+; CHECK-SAME: (i32* nofree [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
+; CHECK-NEXT: [[I:%.*]] = tail call i32 @scc1(i32* nofree [[ARG]]) #[[ATTR19:[0-9]+]]
; CHECK-NEXT: ret void
;
- tail call i32 @scc1(i32* %0);
- ret void;
+ %i = tail call i32 @scc1(i32* %arg)
+ ret void
}
; TEST 12 - fences, negative
@@ -248,101 +248,101 @@ define void @scc2(i32* %0) noinline nounwind uwtable {
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
-define void @foo1(i32* %0, %"struct.std::atomic"* %1) {
+define void @foo1(i32* %arg, %"struct.std::atomic"* %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) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] {
-; CHECK-NEXT: store i32 100, i32* [[TMP0]], align 4
+; 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-NEXT: fence release
-; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0
-; CHECK-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1
+; 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: ret void
;
- store i32 100, i32* %0, align 4
+ store i32 100, i32* %arg, align 4
fence release
- %3 = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %1, i64 0, i32 0, i32 0
- store atomic i8 1, i8* %3 monotonic, align 1
+ %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
ret void
}
-define void @bar(i32* %0, %"struct.std::atomic"* %1) {
+define void @bar(i32* %arg, %"struct.std::atomic"* %arg1) {
; CHECK: Function Attrs: nofree norecurse nounwind
; CHECK-LABEL: define {{[^@]+}}@bar
-; CHECK-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] {
-; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0
-; CHECK-NEXT: br label [[TMP4:%.*]]
-; CHECK: 4:
-; CHECK-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1
-; CHECK-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1
-; CHECK-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0
-; CHECK-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]]
-; CHECK: 8:
+; 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-NEXT: br label [[BB2:%.*]]
+; CHECK: bb2:
+; CHECK-NEXT: [[I3:%.*]] = load atomic i8, i8* [[I]] 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:%.*]]
+; CHECK: bb6:
; CHECK-NEXT: fence acquire
; CHECK-NEXT: ret void
;
- %3 = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %1, i64 0, i32 0, i32 0
- br label %4
+ %i = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %arg1, i64 0, i32 0, i32 0
+ br label %bb2
-4: ; preds = %4, %2
- %5 = load atomic i8, i8* %3 monotonic, align 1
- %6 = and i8 %5, 1
- %7 = icmp eq i8 %6, 0
- br i1 %7, label %4, label %8
+bb2:
+ %i3 = load atomic i8, i8* %i monotonic, align 1
+ %i4 = and i8 %i3, 1
+ %i5 = icmp eq i8 %i4, 0
+ br i1 %i5, label %bb2, label %bb6
-8: ; preds = %4
+bb6:
fence acquire
ret void
}
; TEST 13 - Fence syncscope("singlethread") seq_cst
-define void @foo1_singlethread(i32* %0, %"struct.std::atomic"* %1) {
+define void @foo1_singlethread(i32* %arg, %"struct.std::atomic"* %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) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8:[0-9]+]] {
-; CHECK-NEXT: store i32 100, i32* [[TMP0]], align 4
+; 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-NEXT: fence syncscope("singlethread") release
-; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0
-; CHECK-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1
+; 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: ret void
;
- store i32 100, i32* %0, align 4
+ store i32 100, i32* %arg, align 4
fence syncscope("singlethread") release
- %3 = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %1, i64 0, i32 0, i32 0
- store atomic i8 1, i8* %3 monotonic, align 1
+ %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
ret void
}
-define void @bar_singlethread(i32* %0, %"struct.std::atomic"* %1) {
+define void @bar_singlethread(i32* %arg, %"struct.std::atomic"* %arg1) {
; CHECK: Function Attrs: nofree norecurse nosync nounwind
; CHECK-LABEL: define {{[^@]+}}@bar_singlethread
-; CHECK-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] {
-; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0
-; CHECK-NEXT: br label [[TMP4:%.*]]
-; CHECK: 4:
-; CHECK-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1
-; CHECK-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1
-; CHECK-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0
-; CHECK-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]]
-; CHECK: 8:
+; 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-NEXT: br label [[BB2:%.*]]
+; CHECK: bb2:
+; CHECK-NEXT: [[I3:%.*]] = load atomic i8, i8* [[I]] 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:%.*]]
+; CHECK: bb6:
; CHECK-NEXT: fence syncscope("singlethread") acquire
; CHECK-NEXT: ret void
;
- %3 = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %1, i64 0, i32 0, i32 0
- br label %4
+ %i = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %arg1, i64 0, i32 0, i32 0
+ br label %bb2
-4: ; preds = %4, %2
- %5 = load atomic i8, i8* %3 monotonic, align 1
- %6 = and i8 %5, 1
- %7 = icmp eq i8 %6, 0
- br i1 %7, label %4, label %8
+bb2:
+ %i3 = load atomic i8, i8* %i monotonic, align 1
+ %i4 = and i8 %i3, 1
+ %i5 = icmp eq i8 %i4, 0
+ br i1 %i5, label %bb2, label %bb6
-8: ; preds = %4
+bb6:
fence syncscope("singlethread") acquire
ret void
}
-declare void @llvm.memcpy(i8* %dest, i8* %src, i32 %len, i1 %isvolatile)
-declare void @llvm.memset(i8* %dest, i8 %val, i32 %len, i1 %isvolatile)
+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)
; TEST 14 - negative, checking volatile intrinsics.
@@ -351,11 +351,11 @@ declare void @llvm.memset(i8* %dest, i8 %val, i32 %len, i1 %isvolatile)
define i32 @memcpy_volatile(i8* %ptr1, i8* %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:%.*]]) #[[ATTR10:[0-9]+]] {
+; 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-NEXT: ret i32 4
;
- call void @llvm.memcpy(i8* %ptr1, i8* %ptr2, i32 8, i1 1)
+ call void @llvm.memcpy.p0i8.p0i8.i32(i8* %ptr1, i8* %ptr2, i32 8, i1 true)
ret i32 4
}
@@ -366,11 +366,11 @@ define i32 @memcpy_volatile(i8* %ptr1, i8* %ptr2) {
define i32 @memset_non_volatile(i8* %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:%.*]]) #[[ATTR11:[0-9]+]] {
+; 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-NEXT: ret i32 4
;
- call void @llvm.memset(i8* %ptr1, i8 %val, i32 8, i1 0)
+ call void @llvm.memset.p0i8.i32(i8* %ptr1, i8 %val, i32 8, i1 false)
ret i32 4
}
@@ -379,20 +379,20 @@ define i32 @memset_non_volatile(i8* %ptr1, i8 %val) {
define i32 @inline_asm_test(i32 %x) {
; CHECK-LABEL: define {{[^@]+}}@inline_asm_test
; CHECK-SAME: (i32 [[X:%.*]]) {
-; CHECK-NEXT: [[TMP1:%.*]] = call i32 asm sideeffect "bswap $0", "=r,r"(i32 [[X]])
+; CHECK-NEXT: [[I:%.*]] = call i32 asm sideeffect "bswap $0", "=r,r"(i32 [[X]])
; CHECK-NEXT: ret i32 4
;
- call i32 asm sideeffect "bswap $0", "=r,r"(i32 %x)
+ %i = call i32 asm sideeffect "bswap $0", "=r,r"(i32 %x)
ret i32 4
}
declare void @readnone_test() convergent readnone
; TEST 17 - negative. Convergent
-define void @convergent_readnone(){
+define void @convergent_readnone() {
; CHECK: Function Attrs: memory(none)
; CHECK-LABEL: define {{[^@]+}}@convergent_readnone
-; CHECK-SAME: () #[[ATTR13:[0-9]+]] {
+; CHECK-SAME: () #[[ATTR15:[0-9]+]] {
; CHECK-NEXT: call void @readnone_test()
; CHECK-NEXT: ret void
;
@@ -410,7 +410,7 @@ declare void @llvm.x86.sse2.clflush(i8*)
define void @i_totally_sync() {
; CHECK: Function Attrs: nounwind
; CHECK-LABEL: define {{[^@]+}}@i_totally_sync
-; CHECK-SAME: () #[[ATTR14:[0-9]+]] {
+; 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: ret void
;
@@ -418,28 +418,28 @@ define void @i_totally_sync() {
ret void
}
-declare float @llvm.cos(float %val) readnone
+declare float @llvm.cos.f32(float %val) readnone
; TEST 19 - positive, readnone & non-convergent intrinsic.
define i32 @cos_test(float %x) {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: define {{[^@]+}}@cos_test
-; CHECK-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] {
+; CHECK-SAME: (float [[X:%.*]]) #[[ATTR18:[0-9]+]] {
; CHECK-NEXT: ret i32 4
;
- call float @llvm.cos(float %x)
+ %i = call float @llvm.cos.f32(float %x)
ret i32 4
}
define float @cos_test2(float %x) {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: define {{[^@]+}}@cos_test2
-; CHECK-SAME: (float [[X:%.*]]) #[[ATTR15]] {
+; CHECK-SAME: (float [[X:%.*]]) #[[ATTR18]] {
; CHECK-NEXT: [[C:%.*]] = call nofpclass(inf) float @llvm.cos.f32(float [[X]]) #[[ATTR20]]
; CHECK-NEXT: ret float [[C]]
;
- %c = call float @llvm.cos(float %x)
+ %c = call float @llvm.cos.f32(float %x)
ret float %c
}
;.
@@ -453,15 +453,15 @@ define float @cos_test2(float %x) {
; CHECK: attributes #[[ATTR7]] = { nofree norecurse nounwind }
; CHECK: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn }
; CHECK: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind }
-; CHECK: attributes #[[ATTR10]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) }
-; CHECK: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
-; CHECK: attributes #[[ATTR12:[0-9]+]] = { convergent memory(none) }
-; CHECK: attributes #[[ATTR13]] = { memory(none) }
-; CHECK: attributes #[[ATTR14]] = { nounwind }
-; CHECK: attributes #[[ATTR15]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
-; CHECK: attributes #[[ATTR16:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
-; CHECK: attributes #[[ATTR17:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) }
-; CHECK: attributes #[[ATTR18:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
+; CHECK: attributes #[[ATTR10:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
+; CHECK: attributes #[[ATTR11:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) }
+; CHECK: attributes #[[ATTR12]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) }
+; CHECK: attributes #[[ATTR13]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
+; CHECK: attributes #[[ATTR14:[0-9]+]] = { convergent memory(none) }
+; CHECK: attributes #[[ATTR15]] = { memory(none) }
+; CHECK: attributes #[[ATTR16]] = { nounwind }
+; CHECK: attributes #[[ATTR17:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
+; CHECK: attributes #[[ATTR18]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CHECK: attributes #[[ATTR19]] = { nofree nounwind }
; CHECK: attributes #[[ATTR20]] = { willreturn }
;.
More information about the llvm-commits
mailing list