llvm.org GIT mirror llvm / 236b71f
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 Eli Friedman 8 years ago
2 changed file(s) with 5 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -loweratomic -S | FileCheck %s
1
2 declare i8 @llvm.atomic.load.add.i8.p0i8(i8* %ptr, i8 %delta)
3 declare i8 @llvm.atomic.load.nand.i8.p0i8(i8* %ptr, i8 %delta)
4 declare i8 @llvm.atomic.load.min.i8.p0i8(i8* %ptr, i8 %delta)
51
62 define i8 @add() {
73 ; CHECK: @add
84 %i = alloca i8
9 %j = call i8 @llvm.atomic.load.add.i8.p0i8(i8* %i, i8 42)
5 %j = atomicrmw add i8* %i, i8 42 monotonic
106 ; CHECK: [[INST:%[a-z0-9]+]] = load
117 ; CHECK-NEXT: add
128 ; CHECK-NEXT: store
1713 define i8 @nand() {
1814 ; CHECK: @nand
1915 %i = alloca i8
20 %j = call i8 @llvm.atomic.load.nand.i8.p0i8(i8* %i, i8 42)
16 %j = atomicrmw nand i8* %i, i8 42 monotonic
2117 ; CHECK: [[INST:%[a-z0-9]+]] = load
2218 ; CHECK-NEXT: and
2319 ; CHECK-NEXT: xor
2925 define i8 @min() {
3026 ; CHECK: @min
3127 %i = alloca i8
32 %j = call i8 @llvm.atomic.load.min.i8.p0i8(i8* %i, i8 42)
28 %j = atomicrmw min i8* %i, i8 42 monotonic
3329 ; CHECK: [[INST:%[a-z0-9]+]] = load
3430 ; CHECK-NEXT: icmp
3531 ; CHECK-NEXT: select
0 ; RUN: opt < %s -loweratomic -S | FileCheck %s
1
2 declare i8 @llvm.atomic.cmp.swap.i8.p0i8(i8* %ptr, i8 %cmp, i8 %val)
3 declare i8 @llvm.atomic.swap.i8.p0i8(i8* %ptr, i8 %val)
41
52 define i8 @cmpswap() {
63 ; CHECK: @cmpswap
74 %i = alloca i8
8 %j = call i8 @llvm.atomic.cmp.swap.i8.p0i8(i8* %i, i8 0, i8 42)
5 %j = cmpxchg i8* %i, i8 0, i8 42 monotonic
96 ; CHECK: [[INST:%[a-z0-9]+]] = load
107 ; CHECK-NEXT: icmp
118 ; CHECK-NEXT: select
1714 define i8 @swap() {
1815 ; CHECK: @swap
1916 %i = alloca i8
20 %j = call i8 @llvm.atomic.swap.i8.p0i8(i8* %i, i8 42)
17 %j = atomicrmw xchg i8* %i, i8 42 monotonic
2118 ; CHECK: [[INST:%[a-z0-9]+]] = load
2219 ; CHECK-NEXT: store
2320 ret i8 %j