aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/LowerAtomic
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-09-26 20:15:56 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-09-26 20:15:56 +0000
commit236b71fc75d43d8f49541d0bef918efaa1053643 (patch)
treea820591429f64a7fc703e559830aabc57c83cfde /test/Transforms/LowerAtomic
parent46cb5afdcd031c371c78201fb34291d9d48b2ee4 (diff)
Upgrade a couple more tests to the new atomic instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LowerAtomic')
-rw-r--r--test/Transforms/LowerAtomic/atomic-load.ll10
-rw-r--r--test/Transforms/LowerAtomic/atomic-swap.ll7
2 files changed, 5 insertions, 12 deletions
diff --git a/test/Transforms/LowerAtomic/atomic-load.ll b/test/Transforms/LowerAtomic/atomic-load.ll
index 5b110d6b7e..bc04e88344 100644
--- a/test/Transforms/LowerAtomic/atomic-load.ll
+++ b/test/Transforms/LowerAtomic/atomic-load.ll
@@ -1,13 +1,9 @@
; RUN: opt < %s -loweratomic -S | FileCheck %s
-declare i8 @llvm.atomic.load.add.i8.p0i8(i8* %ptr, i8 %delta)
-declare i8 @llvm.atomic.load.nand.i8.p0i8(i8* %ptr, i8 %delta)
-declare i8 @llvm.atomic.load.min.i8.p0i8(i8* %ptr, i8 %delta)
-
define i8 @add() {
; CHECK: @add
%i = alloca i8
- %j = call i8 @llvm.atomic.load.add.i8.p0i8(i8* %i, i8 42)
+ %j = atomicrmw add i8* %i, i8 42 monotonic
; CHECK: [[INST:%[a-z0-9]+]] = load
; CHECK-NEXT: add
; CHECK-NEXT: store
@@ -18,7 +14,7 @@ define i8 @add() {
define i8 @nand() {
; CHECK: @nand
%i = alloca i8
- %j = call i8 @llvm.atomic.load.nand.i8.p0i8(i8* %i, i8 42)
+ %j = atomicrmw nand i8* %i, i8 42 monotonic
; CHECK: [[INST:%[a-z0-9]+]] = load
; CHECK-NEXT: and
; CHECK-NEXT: xor
@@ -30,7 +26,7 @@ define i8 @nand() {
define i8 @min() {
; CHECK: @min
%i = alloca i8
- %j = call i8 @llvm.atomic.load.min.i8.p0i8(i8* %i, i8 42)
+ %j = atomicrmw min i8* %i, i8 42 monotonic
; CHECK: [[INST:%[a-z0-9]+]] = load
; CHECK-NEXT: icmp
; CHECK-NEXT: select
diff --git a/test/Transforms/LowerAtomic/atomic-swap.ll b/test/Transforms/LowerAtomic/atomic-swap.ll
index 0a59c8595e..5e2f034a51 100644
--- a/test/Transforms/LowerAtomic/atomic-swap.ll
+++ b/test/Transforms/LowerAtomic/atomic-swap.ll
@@ -1,12 +1,9 @@
; RUN: opt < %s -loweratomic -S | FileCheck %s
-declare i8 @llvm.atomic.cmp.swap.i8.p0i8(i8* %ptr, i8 %cmp, i8 %val)
-declare i8 @llvm.atomic.swap.i8.p0i8(i8* %ptr, i8 %val)
-
define i8 @cmpswap() {
; CHECK: @cmpswap
%i = alloca i8
- %j = call i8 @llvm.atomic.cmp.swap.i8.p0i8(i8* %i, i8 0, i8 42)
+ %j = cmpxchg i8* %i, i8 0, i8 42 monotonic
; CHECK: [[INST:%[a-z0-9]+]] = load
; CHECK-NEXT: icmp
; CHECK-NEXT: select
@@ -18,7 +15,7 @@ define i8 @cmpswap() {
define i8 @swap() {
; CHECK: @swap
%i = alloca i8
- %j = call i8 @llvm.atomic.swap.i8.p0i8(i8* %i, i8 42)
+ %j = atomicrmw xchg i8* %i, i8 42 monotonic
; CHECK: [[INST:%[a-z0-9]+]] = load
; CHECK-NEXT: store
ret i8 %j