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(i64* %addr) { ret void }
8 define void @cmpxchg_i64(i64* %addr) { ret void }
18 ; CHECK-LABEL: name: cmpxchg_i32
19 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
20 ; CHECK: [[CMP:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
21 ; CHECK: [[CST:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
22 ; CHECK: [[RES:%[0-9]+]]:_(s32) = G_ATOMIC_CMPXCHG [[COPY]](p0), [[CMP]], [[CST]] :: (load store monotonic 8 on %ir.addr)
23 ; CHECK: [[SRES:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[RES]](s32), [[CMP]]
24 ; CHECK: [[SRES32:%[0-9]+]]:_(s32) = COPY [[SRES]]
25 ; CHECK: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[RES]], [[SRES32]]
26 ; CHECK: $w0 = COPY [[MUL]]
28 %1:_(s32) = G_CONSTANT i32 0
29 %2:_(s32) = G_CONSTANT i32 1
30 %3:_(s32), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store monotonic 8 on %ir.addr)
31 %5:_(s32) = G_ANYEXT %4
32 %6:_(s32) = G_MUL %3, %5
43 ; CHECK-LABEL: name: cmpxchg_i64
44 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
45 ; CHECK: [[CMP:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
46 ; CHECK: [[CST:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
47 ; CHECK: [[RES:%[0-9]+]]:_(s64) = G_ATOMIC_CMPXCHG [[COPY]](p0), [[CMP]], [[CST]] :: (load store monotonic 8 on %ir.addr)
48 ; CHECK: [[SRES:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[RES]](s64), [[CMP]]
49 ; CHECK: [[SRES64:%[0-9]+]]:_(s64) = G_ANYEXT [[SRES]]
50 ; CHECK: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[RES]], [[SRES64]]
51 ; CHECK: $x0 = COPY [[MUL]]
53 %1:_(s64) = G_CONSTANT i64 0
54 %2:_(s64) = G_CONSTANT i64 1
55 %3:_(s64), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store monotonic 8 on %ir.addr)
56 %5:_(s64) = G_ANYEXT %4
57 %6:_(s64) = G_MUL %3, %5