1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -mattr=+lse -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 define void @cmpxchg_i32(ptr %addr) { ret void }
8 define void @cmpxchg_i64(ptr %addr) { ret void }
18 ; CHECK-LABEL: name: cmpxchg_i32
21 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
22 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
23 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
24 ; CHECK-NEXT: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s32) = G_ATOMIC_CMPXCHG [[COPY]](p0), [[C]], [[C1]] :: (load store monotonic (s64) on %ir.addr)
25 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s32), [[C]]
26 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[ATOMIC_CMPXCHG]](s32)
27 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY1]], [[ICMP]]
28 ; CHECK-NEXT: $w0 = COPY [[MUL]](s32)
30 %1:_(s32) = G_CONSTANT i32 0
31 %2:_(s32) = G_CONSTANT i32 1
32 %3:_(s32), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store monotonic (s64) on %ir.addr)
33 %5:_(s32) = G_ANYEXT %4
34 %6:_(s32) = G_MUL %3, %5
45 ; CHECK-LABEL: name: cmpxchg_i64
48 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
49 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
50 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
51 ; CHECK-NEXT: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s64) = G_ATOMIC_CMPXCHG [[COPY]](p0), [[C]], [[C1]] :: (load store monotonic (s64) on %ir.addr)
52 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s64), [[C]]
53 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY [[ATOMIC_CMPXCHG]](s64)
54 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ICMP]](s32)
55 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[COPY1]], [[ANYEXT]]
56 ; CHECK-NEXT: $x0 = COPY [[MUL]](s64)
58 %1:_(s64) = G_CONSTANT i64 0
59 %2:_(s64) = G_CONSTANT i64 1
60 %3:_(s64), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store monotonic (s64) on %ir.addr)
61 %5:_(s64) = G_ANYEXT %4
62 %6:_(s64) = G_MUL %3, %5