aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/DeadStoreElimination/atomic.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/DeadStoreElimination/atomic.ll')
-rw-r--r--test/Transforms/DeadStoreElimination/atomic.ll56
1 files changed, 5 insertions, 51 deletions
diff --git a/test/Transforms/DeadStoreElimination/atomic.ll b/test/Transforms/DeadStoreElimination/atomic.ll
index af303fa..79beee8 100644
--- a/test/Transforms/DeadStoreElimination/atomic.ll
+++ b/test/Transforms/DeadStoreElimination/atomic.ll
@@ -23,28 +23,6 @@ define void @test1() {
ret void
}
-; DSE across seq_cst load (allowed)
-define i32 @test2() {
-; CHECK-LABEL: test2
-; CHECK-NOT: store i32 0
-; CHECK: store i32 1
- store i32 0, i32* @x
- %x = load atomic i32* @y seq_cst, align 4
- store i32 1, i32* @x
- ret i32 %x
-}
-
-; DSE across seq_cst store (allowed)
-define void @test3() {
-; CHECK-LABEL: test3
-; CHECK-NOT: store i32 0
-; CHECK: store atomic i32 2
- store i32 0, i32* @x
- store atomic i32 2, i32* @y seq_cst, align 4
- store i32 1, i32* @x
- ret void
-}
-
; DSE remove unordered store (allowed)
define void @test4() {
; CHECK-LABEL: test4
@@ -69,7 +47,7 @@ define void @test6() {
; CHECK-LABEL: test6
; CHECK-NOT: store
; CHECK: ret void
- %x = load atomic i32* @x unordered, align 4
+ %x = load atomic i32, i32* @x unordered, align 4
store atomic i32 %x, i32* @x unordered, align 4
ret void
}
@@ -93,7 +71,7 @@ define i32 @test8() {
%a = alloca i32
call void @randomop(i32* %a)
store i32 0, i32* %a, align 4
- %x = load atomic i32* @x seq_cst, align 4
+ %x = load atomic i32, i32* @x seq_cst, align 4
ret i32 %x
}
@@ -103,7 +81,7 @@ define i32 @test9() {
; CHECK-NOT: store i32 0
; CHECK: store i32 1
store i32 0, i32* @x
- %x = load atomic i32* @y monotonic, align 4
+ %x = load atomic i32, i32* @y monotonic, align 4
store i32 1, i32* @x
ret i32 %x
}
@@ -125,7 +103,7 @@ define i32 @test11() {
; CHECK: store atomic i32 0
; CHECK: store atomic i32 1
store atomic i32 0, i32* @x monotonic, align 4
- %x = load atomic i32* @y monotonic, align 4
+ %x = load atomic i32, i32* @y monotonic, align 4
store atomic i32 1, i32* @x monotonic, align 4
ret i32 %x
}
@@ -141,30 +119,6 @@ define void @test12() {
ret void
}
-; DSE is allowed across a pair of an atomic read and then write.
-define i32 @test13() {
-; CHECK-LABEL: test13
-; CHECK-NOT: store i32 0
-; CHECK: store i32 1
- store i32 0, i32* @x
- %x = load atomic i32* @y seq_cst, align 4
- store atomic i32 %x, i32* @y seq_cst, align 4
- store i32 1, i32* @x
- ret i32 %x
-}
-
-; Same if it is acquire-release instead of seq_cst/seq_cst
-define i32 @test14() {
-; CHECK-LABEL: test14
-; CHECK-NOT: store i32 0
-; CHECK: store i32 1
- store i32 0, i32* @x
- %x = load atomic i32* @y acquire, align 4
- store atomic i32 %x, i32* @y release, align 4
- store i32 1, i32* @x
- ret i32 %x
-}
-
; But DSE is not allowed across a release-acquire pair.
define i32 @test15() {
; CHECK-LABEL: test15
@@ -172,7 +126,7 @@ define i32 @test15() {
; CHECK: store i32 1
store i32 0, i32* @x
store atomic i32 0, i32* @y release, align 4
- %x = load atomic i32* @y acquire, align 4
+ %x = load atomic i32, i32* @y acquire, align 4
store i32 1, i32* @x
ret i32 %x
}