annotate test/CodeGen/ARM/cmpxchg-weak.ll @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents 1172e4bd9c6f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 ; RUN: llc < %s -mtriple=armv7-apple-ios -verify-machineinstrs | FileCheck %s
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 define void @test_cmpxchg_weak(i32 *%addr, i32 %desired, i32 %new) {
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 ; CHECK-LABEL: test_cmpxchg_weak:
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 %pair = cmpxchg weak i32* %addr, i32 %desired, i32 %new seq_cst monotonic
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 %oldval = extractvalue { i32, i1 } %pair, 0
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
8 ; CHECK-NEXT: BB#0:
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
9 ; CHECK-NEXT: ldrex [[LOADED:r[0-9]+]], [r0]
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
10 ; CHECK-NEXT: cmp [[LOADED]], r1
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
11 ; CHECK-NEXT: bne [[LDFAILBB:LBB[0-9]+_[0-9]+]]
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
12 ; CHECK-NEXT: BB#1:
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
13 ; CHECK-NEXT: dmb ish
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
14 ; CHECK-NEXT: strex [[SUCCESS:r[0-9]+]], r2, [r0]
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
15 ; CHECK-NEXT: cmp [[SUCCESS]], #0
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
16 ; CHECK-NEXT: beq [[SUCCESSBB:LBB[0-9]+_[0-9]+]]
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
17 ; CHECK-NEXT: BB#2:
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
18 ; CHECK-NEXT: str r3, [r0]
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
19 ; CHECK-NEXT: bx lr
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
20 ; CHECK-NEXT: [[LDFAILBB]]:
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
21 ; CHECK-NEXT: clrex
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
22 ; CHECK-NEXT: str r3, [r0]
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
23 ; CHECK-NEXT: bx lr
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
24 ; CHECK-NEXT: [[SUCCESSBB]]:
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
25 ; CHECK-NEXT: dmb ish
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
26 ; CHECK-NEXT: str r3, [r0]
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
27 ; CHECK-NEXT: bx lr
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 store i32 %oldval, i32* %addr
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 ret void
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 }
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 define i1 @test_cmpxchg_weak_to_bool(i32, i32 *%addr, i32 %desired, i32 %new) {
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 ; CHECK-LABEL: test_cmpxchg_weak_to_bool:
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 %pair = cmpxchg weak i32* %addr, i32 %desired, i32 %new seq_cst monotonic
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 %success = extractvalue { i32, i1 } %pair, 1
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
40 ; CHECK-NEXT: BB#0:
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
41 ; CHECK-NEXT: ldrex [[LOADED:r[0-9]+]], [r1]
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
42 ; CHECK-NEXT: cmp [[LOADED]], r2
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
43 ; CHECK-NEXT: bne [[LDFAILBB:LBB[0-9]+_[0-9]+]]
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
44 ; CHECK-NEXT: BB#1:
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
45 ; CHECK-NEXT: dmb ish
1172e4bd9c6f update 4.0.0
mir3636
parents: 95
diff changeset
46 ; CHECK-NEXT: mov r0, #0
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
47 ; CHECK-NEXT: strex [[SUCCESS:r[0-9]+]], r3, [r1]
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
48 ; CHECK-NEXT: cmp [[SUCCESS]], #0
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
49 ; CHECK-NEXT: bxne lr
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
50 ; CHECK-NEXT: mov r0, #1
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
51 ; CHECK-NEXT: dmb ish
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
52 ; CHECK-NEXT: bx lr
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
53 ; CHECK-NEXT: [[LDFAILBB]]:
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
54 ; CHECK-NEXT: mov r0, #0
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
55 ; CHECK-NEXT: clrex
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
56 ; CHECK-NEXT: bx lr
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 ret i1 %success
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 }