mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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
This commit is contained in:
parent
46cb5afdcd
commit
236b71fc75
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user