1 ; RUN: llc < %s -march=ppc64 -verify-machineinstrs
3 ; This test is disabled until PPCISelLowering learns to insert proper 64-bit
4 ; code for ATOMIC_CMP_SWAP. Currently, it is inserting 32-bit instructions with
5 ; 64-bit operands which causes the machine code verifier to throw a tantrum.
9 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
10 target triple = "powerpc64-apple-darwin9"
11 @sc = common global i8 0 ; <i8*> [#uses=52]
12 @uc = common global i8 0 ; <i8*> [#uses=100]
13 @ss = common global i16 0 ; <i16*> [#uses=15]
14 @us = common global i16 0 ; <i16*> [#uses=15]
15 @si = common global i32 0 ; <i32*> [#uses=15]
16 @ui = common global i32 0 ; <i32*> [#uses=23]
17 @sl = common global i64 0, align 8 ; <i64*> [#uses=15]
18 @ul = common global i64 0, align 8 ; <i64*> [#uses=15]
19 @sll = common global i64 0, align 8 ; <i64*> [#uses=1]
20 @ull = common global i64 0, align 8 ; <i64*> [#uses=1]
22 define void @test_op_ignore() nounwind {
24 call i8 @llvm.atomic.load.add.i8.p0i8( i8* @sc, i8 1 ) ; <i8>:0 [#uses=0]
25 call i8 @llvm.atomic.load.add.i8.p0i8( i8* @uc, i8 1 ) ; <i8>:1 [#uses=0]
26 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:2 [#uses=1]
27 call i16 @llvm.atomic.load.add.i16.p0i16( i16* %2, i16 1 ) ; <i16>:3 [#uses=0]
28 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:4 [#uses=1]
29 call i16 @llvm.atomic.load.add.i16.p0i16( i16* %4, i16 1 ) ; <i16>:5 [#uses=0]
30 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:6 [#uses=1]
31 call i32 @llvm.atomic.load.add.i32.p0i32( i32* %6, i32 1 ) ; <i32>:7 [#uses=0]
32 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:8 [#uses=1]
33 call i32 @llvm.atomic.load.add.i32.p0i32( i32* %8, i32 1 ) ; <i32>:9 [#uses=0]
34 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:10 [#uses=1]
35 call i64 @llvm.atomic.load.add.i64.p0i64( i64* %10, i64 1 ) ; <i64>:11 [#uses=0]
36 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:12 [#uses=1]
37 call i64 @llvm.atomic.load.add.i64.p0i64( i64* %12, i64 1 ) ; <i64>:13 [#uses=0]
38 call i8 @llvm.atomic.load.sub.i8.p0i8( i8* @sc, i8 1 ) ; <i8>:14 [#uses=0]
39 call i8 @llvm.atomic.load.sub.i8.p0i8( i8* @uc, i8 1 ) ; <i8>:15 [#uses=0]
40 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:16 [#uses=1]
41 call i16 @llvm.atomic.load.sub.i16.p0i16( i16* %16, i16 1 ) ; <i16>:17 [#uses=0]
42 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:18 [#uses=1]
43 call i16 @llvm.atomic.load.sub.i16.p0i16( i16* %18, i16 1 ) ; <i16>:19 [#uses=0]
44 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:20 [#uses=1]
45 call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %20, i32 1 ) ; <i32>:21 [#uses=0]
46 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:22 [#uses=1]
47 call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %22, i32 1 ) ; <i32>:23 [#uses=0]
48 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:24 [#uses=1]
49 call i64 @llvm.atomic.load.sub.i64.p0i64( i64* %24, i64 1 ) ; <i64>:25 [#uses=0]
50 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:26 [#uses=1]
51 call i64 @llvm.atomic.load.sub.i64.p0i64( i64* %26, i64 1 ) ; <i64>:27 [#uses=0]
52 call i8 @llvm.atomic.load.or.i8.p0i8( i8* @sc, i8 1 ) ; <i8>:28 [#uses=0]
53 call i8 @llvm.atomic.load.or.i8.p0i8( i8* @uc, i8 1 ) ; <i8>:29 [#uses=0]
54 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:30 [#uses=1]
55 call i16 @llvm.atomic.load.or.i16.p0i16( i16* %30, i16 1 ) ; <i16>:31 [#uses=0]
56 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:32 [#uses=1]
57 call i16 @llvm.atomic.load.or.i16.p0i16( i16* %32, i16 1 ) ; <i16>:33 [#uses=0]
58 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:34 [#uses=1]
59 call i32 @llvm.atomic.load.or.i32.p0i32( i32* %34, i32 1 ) ; <i32>:35 [#uses=0]
60 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:36 [#uses=1]
61 call i32 @llvm.atomic.load.or.i32.p0i32( i32* %36, i32 1 ) ; <i32>:37 [#uses=0]
62 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:38 [#uses=1]
63 call i64 @llvm.atomic.load.or.i64.p0i64( i64* %38, i64 1 ) ; <i64>:39 [#uses=0]
64 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:40 [#uses=1]
65 call i64 @llvm.atomic.load.or.i64.p0i64( i64* %40, i64 1 ) ; <i64>:41 [#uses=0]
66 call i8 @llvm.atomic.load.xor.i8.p0i8( i8* @sc, i8 1 ) ; <i8>:42 [#uses=0]
67 call i8 @llvm.atomic.load.xor.i8.p0i8( i8* @uc, i8 1 ) ; <i8>:43 [#uses=0]
68 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:44 [#uses=1]
69 call i16 @llvm.atomic.load.xor.i16.p0i16( i16* %44, i16 1 ) ; <i16>:45 [#uses=0]
70 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:46 [#uses=1]
71 call i16 @llvm.atomic.load.xor.i16.p0i16( i16* %46, i16 1 ) ; <i16>:47 [#uses=0]
72 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:48 [#uses=1]
73 call i32 @llvm.atomic.load.xor.i32.p0i32( i32* %48, i32 1 ) ; <i32>:49 [#uses=0]
74 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:50 [#uses=1]
75 call i32 @llvm.atomic.load.xor.i32.p0i32( i32* %50, i32 1 ) ; <i32>:51 [#uses=0]
76 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:52 [#uses=1]
77 call i64 @llvm.atomic.load.xor.i64.p0i64( i64* %52, i64 1 ) ; <i64>:53 [#uses=0]
78 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:54 [#uses=1]
79 call i64 @llvm.atomic.load.xor.i64.p0i64( i64* %54, i64 1 ) ; <i64>:55 [#uses=0]
80 call i8 @llvm.atomic.load.and.i8.p0i8( i8* @sc, i8 1 ) ; <i8>:56 [#uses=0]
81 call i8 @llvm.atomic.load.and.i8.p0i8( i8* @uc, i8 1 ) ; <i8>:57 [#uses=0]
82 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:58 [#uses=1]
83 call i16 @llvm.atomic.load.and.i16.p0i16( i16* %58, i16 1 ) ; <i16>:59 [#uses=0]
84 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:60 [#uses=1]
85 call i16 @llvm.atomic.load.and.i16.p0i16( i16* %60, i16 1 ) ; <i16>:61 [#uses=0]
86 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:62 [#uses=1]
87 call i32 @llvm.atomic.load.and.i32.p0i32( i32* %62, i32 1 ) ; <i32>:63 [#uses=0]
88 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:64 [#uses=1]
89 call i32 @llvm.atomic.load.and.i32.p0i32( i32* %64, i32 1 ) ; <i32>:65 [#uses=0]
90 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:66 [#uses=1]
91 call i64 @llvm.atomic.load.and.i64.p0i64( i64* %66, i64 1 ) ; <i64>:67 [#uses=0]
92 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:68 [#uses=1]
93 call i64 @llvm.atomic.load.and.i64.p0i64( i64* %68, i64 1 ) ; <i64>:69 [#uses=0]
94 call i8 @llvm.atomic.load.nand.i8.p0i8( i8* @sc, i8 1 ) ; <i8>:70 [#uses=0]
95 call i8 @llvm.atomic.load.nand.i8.p0i8( i8* @uc, i8 1 ) ; <i8>:71 [#uses=0]
96 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:72 [#uses=1]
97 call i16 @llvm.atomic.load.nand.i16.p0i16( i16* %72, i16 1 ) ; <i16>:73 [#uses=0]
98 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:74 [#uses=1]
99 call i16 @llvm.atomic.load.nand.i16.p0i16( i16* %74, i16 1 ) ; <i16>:75 [#uses=0]
100 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:76 [#uses=1]
101 call i32 @llvm.atomic.load.nand.i32.p0i32( i32* %76, i32 1 ) ; <i32>:77 [#uses=0]
102 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:78 [#uses=1]
103 call i32 @llvm.atomic.load.nand.i32.p0i32( i32* %78, i32 1 ) ; <i32>:79 [#uses=0]
104 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:80 [#uses=1]
105 call i64 @llvm.atomic.load.nand.i64.p0i64( i64* %80, i64 1 ) ; <i64>:81 [#uses=0]
106 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:82 [#uses=1]
107 call i64 @llvm.atomic.load.nand.i64.p0i64( i64* %82, i64 1 ) ; <i64>:83 [#uses=0]
110 return: ; preds = %entry
114 declare i8 @llvm.atomic.load.add.i8.p0i8(i8*, i8) nounwind
116 declare i16 @llvm.atomic.load.add.i16.p0i16(i16*, i16) nounwind
118 declare i32 @llvm.atomic.load.add.i32.p0i32(i32*, i32) nounwind
120 declare i64 @llvm.atomic.load.add.i64.p0i64(i64*, i64) nounwind
122 declare i8 @llvm.atomic.load.sub.i8.p0i8(i8*, i8) nounwind
124 declare i16 @llvm.atomic.load.sub.i16.p0i16(i16*, i16) nounwind
126 declare i32 @llvm.atomic.load.sub.i32.p0i32(i32*, i32) nounwind
128 declare i64 @llvm.atomic.load.sub.i64.p0i64(i64*, i64) nounwind
130 declare i8 @llvm.atomic.load.or.i8.p0i8(i8*, i8) nounwind
132 declare i16 @llvm.atomic.load.or.i16.p0i16(i16*, i16) nounwind
134 declare i32 @llvm.atomic.load.or.i32.p0i32(i32*, i32) nounwind
136 declare i64 @llvm.atomic.load.or.i64.p0i64(i64*, i64) nounwind
138 declare i8 @llvm.atomic.load.xor.i8.p0i8(i8*, i8) nounwind
140 declare i16 @llvm.atomic.load.xor.i16.p0i16(i16*, i16) nounwind
142 declare i32 @llvm.atomic.load.xor.i32.p0i32(i32*, i32) nounwind
144 declare i64 @llvm.atomic.load.xor.i64.p0i64(i64*, i64) nounwind
146 declare i8 @llvm.atomic.load.and.i8.p0i8(i8*, i8) nounwind
148 declare i16 @llvm.atomic.load.and.i16.p0i16(i16*, i16) nounwind
150 declare i32 @llvm.atomic.load.and.i32.p0i32(i32*, i32) nounwind
152 declare i64 @llvm.atomic.load.and.i64.p0i64(i64*, i64) nounwind
154 declare i8 @llvm.atomic.load.nand.i8.p0i8(i8*, i8) nounwind
156 declare i16 @llvm.atomic.load.nand.i16.p0i16(i16*, i16) nounwind
158 declare i32 @llvm.atomic.load.nand.i32.p0i32(i32*, i32) nounwind
160 declare i64 @llvm.atomic.load.nand.i64.p0i64(i64*, i64) nounwind
162 define void @test_fetch_and_op() nounwind {
164 call i8 @llvm.atomic.load.add.i8.p0i8( i8* @sc, i8 11 ) ; <i8>:0 [#uses=1]
165 store i8 %0, i8* @sc, align 1
166 call i8 @llvm.atomic.load.add.i8.p0i8( i8* @uc, i8 11 ) ; <i8>:1 [#uses=1]
167 store i8 %1, i8* @uc, align 1
168 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:2 [#uses=1]
169 call i16 @llvm.atomic.load.add.i16.p0i16( i16* %2, i16 11 ) ; <i16>:3 [#uses=1]
170 store i16 %3, i16* @ss, align 2
171 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:4 [#uses=1]
172 call i16 @llvm.atomic.load.add.i16.p0i16( i16* %4, i16 11 ) ; <i16>:5 [#uses=1]
173 store i16 %5, i16* @us, align 2
174 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:6 [#uses=1]
175 call i32 @llvm.atomic.load.add.i32.p0i32( i32* %6, i32 11 ) ; <i32>:7 [#uses=1]
176 store i32 %7, i32* @si, align 4
177 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:8 [#uses=1]
178 call i32 @llvm.atomic.load.add.i32.p0i32( i32* %8, i32 11 ) ; <i32>:9 [#uses=1]
179 store i32 %9, i32* @ui, align 4
180 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:10 [#uses=1]
181 call i64 @llvm.atomic.load.add.i64.p0i64( i64* %10, i64 11 ) ; <i64>:11 [#uses=1]
182 store i64 %11, i64* @sl, align 8
183 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:12 [#uses=1]
184 call i64 @llvm.atomic.load.add.i64.p0i64( i64* %12, i64 11 ) ; <i64>:13 [#uses=1]
185 store i64 %13, i64* @ul, align 8
186 call i8 @llvm.atomic.load.sub.i8.p0i8( i8* @sc, i8 11 ) ; <i8>:14 [#uses=1]
187 store i8 %14, i8* @sc, align 1
188 call i8 @llvm.atomic.load.sub.i8.p0i8( i8* @uc, i8 11 ) ; <i8>:15 [#uses=1]
189 store i8 %15, i8* @uc, align 1
190 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:16 [#uses=1]
191 call i16 @llvm.atomic.load.sub.i16.p0i16( i16* %16, i16 11 ) ; <i16>:17 [#uses=1]
192 store i16 %17, i16* @ss, align 2
193 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:18 [#uses=1]
194 call i16 @llvm.atomic.load.sub.i16.p0i16( i16* %18, i16 11 ) ; <i16>:19 [#uses=1]
195 store i16 %19, i16* @us, align 2
196 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:20 [#uses=1]
197 call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %20, i32 11 ) ; <i32>:21 [#uses=1]
198 store i32 %21, i32* @si, align 4
199 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:22 [#uses=1]
200 call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %22, i32 11 ) ; <i32>:23 [#uses=1]
201 store i32 %23, i32* @ui, align 4
202 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:24 [#uses=1]
203 call i64 @llvm.atomic.load.sub.i64.p0i64( i64* %24, i64 11 ) ; <i64>:25 [#uses=1]
204 store i64 %25, i64* @sl, align 8
205 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:26 [#uses=1]
206 call i64 @llvm.atomic.load.sub.i64.p0i64( i64* %26, i64 11 ) ; <i64>:27 [#uses=1]
207 store i64 %27, i64* @ul, align 8
208 call i8 @llvm.atomic.load.or.i8.p0i8( i8* @sc, i8 11 ) ; <i8>:28 [#uses=1]
209 store i8 %28, i8* @sc, align 1
210 call i8 @llvm.atomic.load.or.i8.p0i8( i8* @uc, i8 11 ) ; <i8>:29 [#uses=1]
211 store i8 %29, i8* @uc, align 1
212 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:30 [#uses=1]
213 call i16 @llvm.atomic.load.or.i16.p0i16( i16* %30, i16 11 ) ; <i16>:31 [#uses=1]
214 store i16 %31, i16* @ss, align 2
215 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:32 [#uses=1]
216 call i16 @llvm.atomic.load.or.i16.p0i16( i16* %32, i16 11 ) ; <i16>:33 [#uses=1]
217 store i16 %33, i16* @us, align 2
218 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:34 [#uses=1]
219 call i32 @llvm.atomic.load.or.i32.p0i32( i32* %34, i32 11 ) ; <i32>:35 [#uses=1]
220 store i32 %35, i32* @si, align 4
221 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:36 [#uses=1]
222 call i32 @llvm.atomic.load.or.i32.p0i32( i32* %36, i32 11 ) ; <i32>:37 [#uses=1]
223 store i32 %37, i32* @ui, align 4
224 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:38 [#uses=1]
225 call i64 @llvm.atomic.load.or.i64.p0i64( i64* %38, i64 11 ) ; <i64>:39 [#uses=1]
226 store i64 %39, i64* @sl, align 8
227 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:40 [#uses=1]
228 call i64 @llvm.atomic.load.or.i64.p0i64( i64* %40, i64 11 ) ; <i64>:41 [#uses=1]
229 store i64 %41, i64* @ul, align 8
230 call i8 @llvm.atomic.load.xor.i8.p0i8( i8* @sc, i8 11 ) ; <i8>:42 [#uses=1]
231 store i8 %42, i8* @sc, align 1
232 call i8 @llvm.atomic.load.xor.i8.p0i8( i8* @uc, i8 11 ) ; <i8>:43 [#uses=1]
233 store i8 %43, i8* @uc, align 1
234 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:44 [#uses=1]
235 call i16 @llvm.atomic.load.xor.i16.p0i16( i16* %44, i16 11 ) ; <i16>:45 [#uses=1]
236 store i16 %45, i16* @ss, align 2
237 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:46 [#uses=1]
238 call i16 @llvm.atomic.load.xor.i16.p0i16( i16* %46, i16 11 ) ; <i16>:47 [#uses=1]
239 store i16 %47, i16* @us, align 2
240 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:48 [#uses=1]
241 call i32 @llvm.atomic.load.xor.i32.p0i32( i32* %48, i32 11 ) ; <i32>:49 [#uses=1]
242 store i32 %49, i32* @si, align 4
243 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:50 [#uses=1]
244 call i32 @llvm.atomic.load.xor.i32.p0i32( i32* %50, i32 11 ) ; <i32>:51 [#uses=1]
245 store i32 %51, i32* @ui, align 4
246 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:52 [#uses=1]
247 call i64 @llvm.atomic.load.xor.i64.p0i64( i64* %52, i64 11 ) ; <i64>:53 [#uses=1]
248 store i64 %53, i64* @sl, align 8
249 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:54 [#uses=1]
250 call i64 @llvm.atomic.load.xor.i64.p0i64( i64* %54, i64 11 ) ; <i64>:55 [#uses=1]
251 store i64 %55, i64* @ul, align 8
252 call i8 @llvm.atomic.load.and.i8.p0i8( i8* @sc, i8 11 ) ; <i8>:56 [#uses=1]
253 store i8 %56, i8* @sc, align 1
254 call i8 @llvm.atomic.load.and.i8.p0i8( i8* @uc, i8 11 ) ; <i8>:57 [#uses=1]
255 store i8 %57, i8* @uc, align 1
256 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:58 [#uses=1]
257 call i16 @llvm.atomic.load.and.i16.p0i16( i16* %58, i16 11 ) ; <i16>:59 [#uses=1]
258 store i16 %59, i16* @ss, align 2
259 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:60 [#uses=1]
260 call i16 @llvm.atomic.load.and.i16.p0i16( i16* %60, i16 11 ) ; <i16>:61 [#uses=1]
261 store i16 %61, i16* @us, align 2
262 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:62 [#uses=1]
263 call i32 @llvm.atomic.load.and.i32.p0i32( i32* %62, i32 11 ) ; <i32>:63 [#uses=1]
264 store i32 %63, i32* @si, align 4
265 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:64 [#uses=1]
266 call i32 @llvm.atomic.load.and.i32.p0i32( i32* %64, i32 11 ) ; <i32>:65 [#uses=1]
267 store i32 %65, i32* @ui, align 4
268 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:66 [#uses=1]
269 call i64 @llvm.atomic.load.and.i64.p0i64( i64* %66, i64 11 ) ; <i64>:67 [#uses=1]
270 store i64 %67, i64* @sl, align 8
271 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:68 [#uses=1]
272 call i64 @llvm.atomic.load.and.i64.p0i64( i64* %68, i64 11 ) ; <i64>:69 [#uses=1]
273 store i64 %69, i64* @ul, align 8
274 call i8 @llvm.atomic.load.nand.i8.p0i8( i8* @sc, i8 11 ) ; <i8>:70 [#uses=1]
275 store i8 %70, i8* @sc, align 1
276 call i8 @llvm.atomic.load.nand.i8.p0i8( i8* @uc, i8 11 ) ; <i8>:71 [#uses=1]
277 store i8 %71, i8* @uc, align 1
278 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:72 [#uses=1]
279 call i16 @llvm.atomic.load.nand.i16.p0i16( i16* %72, i16 11 ) ; <i16>:73 [#uses=1]
280 store i16 %73, i16* @ss, align 2
281 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:74 [#uses=1]
282 call i16 @llvm.atomic.load.nand.i16.p0i16( i16* %74, i16 11 ) ; <i16>:75 [#uses=1]
283 store i16 %75, i16* @us, align 2
284 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:76 [#uses=1]
285 call i32 @llvm.atomic.load.nand.i32.p0i32( i32* %76, i32 11 ) ; <i32>:77 [#uses=1]
286 store i32 %77, i32* @si, align 4
287 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:78 [#uses=1]
288 call i32 @llvm.atomic.load.nand.i32.p0i32( i32* %78, i32 11 ) ; <i32>:79 [#uses=1]
289 store i32 %79, i32* @ui, align 4
290 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:80 [#uses=1]
291 call i64 @llvm.atomic.load.nand.i64.p0i64( i64* %80, i64 11 ) ; <i64>:81 [#uses=1]
292 store i64 %81, i64* @sl, align 8
293 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:82 [#uses=1]
294 call i64 @llvm.atomic.load.nand.i64.p0i64( i64* %82, i64 11 ) ; <i64>:83 [#uses=1]
295 store i64 %83, i64* @ul, align 8
298 return: ; preds = %entry
302 define void @test_op_and_fetch() nounwind {
304 load i8* @uc, align 1 ; <i8>:0 [#uses=2]
305 call i8 @llvm.atomic.load.add.i8.p0i8( i8* @sc, i8 %0 ) ; <i8>:1 [#uses=1]
306 add i8 %1, %0 ; <i8>:2 [#uses=1]
307 store i8 %2, i8* @sc, align 1
308 load i8* @uc, align 1 ; <i8>:3 [#uses=2]
309 call i8 @llvm.atomic.load.add.i8.p0i8( i8* @uc, i8 %3 ) ; <i8>:4 [#uses=1]
310 add i8 %4, %3 ; <i8>:5 [#uses=1]
311 store i8 %5, i8* @uc, align 1
312 load i8* @uc, align 1 ; <i8>:6 [#uses=1]
313 zext i8 %6 to i16 ; <i16>:7 [#uses=2]
314 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:8 [#uses=1]
315 call i16 @llvm.atomic.load.add.i16.p0i16( i16* %8, i16 %7 ) ; <i16>:9 [#uses=1]
316 add i16 %9, %7 ; <i16>:10 [#uses=1]
317 store i16 %10, i16* @ss, align 2
318 load i8* @uc, align 1 ; <i8>:11 [#uses=1]
319 zext i8 %11 to i16 ; <i16>:12 [#uses=2]
320 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:13 [#uses=1]
321 call i16 @llvm.atomic.load.add.i16.p0i16( i16* %13, i16 %12 ) ; <i16>:14 [#uses=1]
322 add i16 %14, %12 ; <i16>:15 [#uses=1]
323 store i16 %15, i16* @us, align 2
324 load i8* @uc, align 1 ; <i8>:16 [#uses=1]
325 zext i8 %16 to i32 ; <i32>:17 [#uses=2]
326 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:18 [#uses=1]
327 call i32 @llvm.atomic.load.add.i32.p0i32( i32* %18, i32 %17 ) ; <i32>:19 [#uses=1]
328 add i32 %19, %17 ; <i32>:20 [#uses=1]
329 store i32 %20, i32* @si, align 4
330 load i8* @uc, align 1 ; <i8>:21 [#uses=1]
331 zext i8 %21 to i32 ; <i32>:22 [#uses=2]
332 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:23 [#uses=1]
333 call i32 @llvm.atomic.load.add.i32.p0i32( i32* %23, i32 %22 ) ; <i32>:24 [#uses=1]
334 add i32 %24, %22 ; <i32>:25 [#uses=1]
335 store i32 %25, i32* @ui, align 4
336 load i8* @uc, align 1 ; <i8>:26 [#uses=1]
337 zext i8 %26 to i64 ; <i64>:27 [#uses=2]
338 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:28 [#uses=1]
339 call i64 @llvm.atomic.load.add.i64.p0i64( i64* %28, i64 %27 ) ; <i64>:29 [#uses=1]
340 add i64 %29, %27 ; <i64>:30 [#uses=1]
341 store i64 %30, i64* @sl, align 8
342 load i8* @uc, align 1 ; <i8>:31 [#uses=1]
343 zext i8 %31 to i64 ; <i64>:32 [#uses=2]
344 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:33 [#uses=1]
345 call i64 @llvm.atomic.load.add.i64.p0i64( i64* %33, i64 %32 ) ; <i64>:34 [#uses=1]
346 add i64 %34, %32 ; <i64>:35 [#uses=1]
347 store i64 %35, i64* @ul, align 8
348 load i8* @uc, align 1 ; <i8>:36 [#uses=2]
349 call i8 @llvm.atomic.load.sub.i8.p0i8( i8* @sc, i8 %36 ) ; <i8>:37 [#uses=1]
350 sub i8 %37, %36 ; <i8>:38 [#uses=1]
351 store i8 %38, i8* @sc, align 1
352 load i8* @uc, align 1 ; <i8>:39 [#uses=2]
353 call i8 @llvm.atomic.load.sub.i8.p0i8( i8* @uc, i8 %39 ) ; <i8>:40 [#uses=1]
354 sub i8 %40, %39 ; <i8>:41 [#uses=1]
355 store i8 %41, i8* @uc, align 1
356 load i8* @uc, align 1 ; <i8>:42 [#uses=1]
357 zext i8 %42 to i16 ; <i16>:43 [#uses=2]
358 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:44 [#uses=1]
359 call i16 @llvm.atomic.load.sub.i16.p0i16( i16* %44, i16 %43 ) ; <i16>:45 [#uses=1]
360 sub i16 %45, %43 ; <i16>:46 [#uses=1]
361 store i16 %46, i16* @ss, align 2
362 load i8* @uc, align 1 ; <i8>:47 [#uses=1]
363 zext i8 %47 to i16 ; <i16>:48 [#uses=2]
364 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:49 [#uses=1]
365 call i16 @llvm.atomic.load.sub.i16.p0i16( i16* %49, i16 %48 ) ; <i16>:50 [#uses=1]
366 sub i16 %50, %48 ; <i16>:51 [#uses=1]
367 store i16 %51, i16* @us, align 2
368 load i8* @uc, align 1 ; <i8>:52 [#uses=1]
369 zext i8 %52 to i32 ; <i32>:53 [#uses=2]
370 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:54 [#uses=1]
371 call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %54, i32 %53 ) ; <i32>:55 [#uses=1]
372 sub i32 %55, %53 ; <i32>:56 [#uses=1]
373 store i32 %56, i32* @si, align 4
374 load i8* @uc, align 1 ; <i8>:57 [#uses=1]
375 zext i8 %57 to i32 ; <i32>:58 [#uses=2]
376 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:59 [#uses=1]
377 call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %59, i32 %58 ) ; <i32>:60 [#uses=1]
378 sub i32 %60, %58 ; <i32>:61 [#uses=1]
379 store i32 %61, i32* @ui, align 4
380 load i8* @uc, align 1 ; <i8>:62 [#uses=1]
381 zext i8 %62 to i64 ; <i64>:63 [#uses=2]
382 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:64 [#uses=1]
383 call i64 @llvm.atomic.load.sub.i64.p0i64( i64* %64, i64 %63 ) ; <i64>:65 [#uses=1]
384 sub i64 %65, %63 ; <i64>:66 [#uses=1]
385 store i64 %66, i64* @sl, align 8
386 load i8* @uc, align 1 ; <i8>:67 [#uses=1]
387 zext i8 %67 to i64 ; <i64>:68 [#uses=2]
388 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:69 [#uses=1]
389 call i64 @llvm.atomic.load.sub.i64.p0i64( i64* %69, i64 %68 ) ; <i64>:70 [#uses=1]
390 sub i64 %70, %68 ; <i64>:71 [#uses=1]
391 store i64 %71, i64* @ul, align 8
392 load i8* @uc, align 1 ; <i8>:72 [#uses=2]
393 call i8 @llvm.atomic.load.or.i8.p0i8( i8* @sc, i8 %72 ) ; <i8>:73 [#uses=1]
394 or i8 %73, %72 ; <i8>:74 [#uses=1]
395 store i8 %74, i8* @sc, align 1
396 load i8* @uc, align 1 ; <i8>:75 [#uses=2]
397 call i8 @llvm.atomic.load.or.i8.p0i8( i8* @uc, i8 %75 ) ; <i8>:76 [#uses=1]
398 or i8 %76, %75 ; <i8>:77 [#uses=1]
399 store i8 %77, i8* @uc, align 1
400 load i8* @uc, align 1 ; <i8>:78 [#uses=1]
401 zext i8 %78 to i16 ; <i16>:79 [#uses=2]
402 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:80 [#uses=1]
403 call i16 @llvm.atomic.load.or.i16.p0i16( i16* %80, i16 %79 ) ; <i16>:81 [#uses=1]
404 or i16 %81, %79 ; <i16>:82 [#uses=1]
405 store i16 %82, i16* @ss, align 2
406 load i8* @uc, align 1 ; <i8>:83 [#uses=1]
407 zext i8 %83 to i16 ; <i16>:84 [#uses=2]
408 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:85 [#uses=1]
409 call i16 @llvm.atomic.load.or.i16.p0i16( i16* %85, i16 %84 ) ; <i16>:86 [#uses=1]
410 or i16 %86, %84 ; <i16>:87 [#uses=1]
411 store i16 %87, i16* @us, align 2
412 load i8* @uc, align 1 ; <i8>:88 [#uses=1]
413 zext i8 %88 to i32 ; <i32>:89 [#uses=2]
414 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:90 [#uses=1]
415 call i32 @llvm.atomic.load.or.i32.p0i32( i32* %90, i32 %89 ) ; <i32>:91 [#uses=1]
416 or i32 %91, %89 ; <i32>:92 [#uses=1]
417 store i32 %92, i32* @si, align 4
418 load i8* @uc, align 1 ; <i8>:93 [#uses=1]
419 zext i8 %93 to i32 ; <i32>:94 [#uses=2]
420 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:95 [#uses=1]
421 call i32 @llvm.atomic.load.or.i32.p0i32( i32* %95, i32 %94 ) ; <i32>:96 [#uses=1]
422 or i32 %96, %94 ; <i32>:97 [#uses=1]
423 store i32 %97, i32* @ui, align 4
424 load i8* @uc, align 1 ; <i8>:98 [#uses=1]
425 zext i8 %98 to i64 ; <i64>:99 [#uses=2]
426 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:100 [#uses=1]
427 call i64 @llvm.atomic.load.or.i64.p0i64( i64* %100, i64 %99 ) ; <i64>:101 [#uses=1]
428 or i64 %101, %99 ; <i64>:102 [#uses=1]
429 store i64 %102, i64* @sl, align 8
430 load i8* @uc, align 1 ; <i8>:103 [#uses=1]
431 zext i8 %103 to i64 ; <i64>:104 [#uses=2]
432 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:105 [#uses=1]
433 call i64 @llvm.atomic.load.or.i64.p0i64( i64* %105, i64 %104 ) ; <i64>:106 [#uses=1]
434 or i64 %106, %104 ; <i64>:107 [#uses=1]
435 store i64 %107, i64* @ul, align 8
436 load i8* @uc, align 1 ; <i8>:108 [#uses=2]
437 call i8 @llvm.atomic.load.xor.i8.p0i8( i8* @sc, i8 %108 ) ; <i8>:109 [#uses=1]
438 xor i8 %109, %108 ; <i8>:110 [#uses=1]
439 store i8 %110, i8* @sc, align 1
440 load i8* @uc, align 1 ; <i8>:111 [#uses=2]
441 call i8 @llvm.atomic.load.xor.i8.p0i8( i8* @uc, i8 %111 ) ; <i8>:112 [#uses=1]
442 xor i8 %112, %111 ; <i8>:113 [#uses=1]
443 store i8 %113, i8* @uc, align 1
444 load i8* @uc, align 1 ; <i8>:114 [#uses=1]
445 zext i8 %114 to i16 ; <i16>:115 [#uses=2]
446 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:116 [#uses=1]
447 call i16 @llvm.atomic.load.xor.i16.p0i16( i16* %116, i16 %115 ) ; <i16>:117 [#uses=1]
448 xor i16 %117, %115 ; <i16>:118 [#uses=1]
449 store i16 %118, i16* @ss, align 2
450 load i8* @uc, align 1 ; <i8>:119 [#uses=1]
451 zext i8 %119 to i16 ; <i16>:120 [#uses=2]
452 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:121 [#uses=1]
453 call i16 @llvm.atomic.load.xor.i16.p0i16( i16* %121, i16 %120 ) ; <i16>:122 [#uses=1]
454 xor i16 %122, %120 ; <i16>:123 [#uses=1]
455 store i16 %123, i16* @us, align 2
456 load i8* @uc, align 1 ; <i8>:124 [#uses=1]
457 zext i8 %124 to i32 ; <i32>:125 [#uses=2]
458 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:126 [#uses=1]
459 call i32 @llvm.atomic.load.xor.i32.p0i32( i32* %126, i32 %125 ) ; <i32>:127 [#uses=1]
460 xor i32 %127, %125 ; <i32>:128 [#uses=1]
461 store i32 %128, i32* @si, align 4
462 load i8* @uc, align 1 ; <i8>:129 [#uses=1]
463 zext i8 %129 to i32 ; <i32>:130 [#uses=2]
464 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:131 [#uses=1]
465 call i32 @llvm.atomic.load.xor.i32.p0i32( i32* %131, i32 %130 ) ; <i32>:132 [#uses=1]
466 xor i32 %132, %130 ; <i32>:133 [#uses=1]
467 store i32 %133, i32* @ui, align 4
468 load i8* @uc, align 1 ; <i8>:134 [#uses=1]
469 zext i8 %134 to i64 ; <i64>:135 [#uses=2]
470 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:136 [#uses=1]
471 call i64 @llvm.atomic.load.xor.i64.p0i64( i64* %136, i64 %135 ) ; <i64>:137 [#uses=1]
472 xor i64 %137, %135 ; <i64>:138 [#uses=1]
473 store i64 %138, i64* @sl, align 8
474 load i8* @uc, align 1 ; <i8>:139 [#uses=1]
475 zext i8 %139 to i64 ; <i64>:140 [#uses=2]
476 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:141 [#uses=1]
477 call i64 @llvm.atomic.load.xor.i64.p0i64( i64* %141, i64 %140 ) ; <i64>:142 [#uses=1]
478 xor i64 %142, %140 ; <i64>:143 [#uses=1]
479 store i64 %143, i64* @ul, align 8
480 load i8* @uc, align 1 ; <i8>:144 [#uses=2]
481 call i8 @llvm.atomic.load.and.i8.p0i8( i8* @sc, i8 %144 ) ; <i8>:145 [#uses=1]
482 and i8 %145, %144 ; <i8>:146 [#uses=1]
483 store i8 %146, i8* @sc, align 1
484 load i8* @uc, align 1 ; <i8>:147 [#uses=2]
485 call i8 @llvm.atomic.load.and.i8.p0i8( i8* @uc, i8 %147 ) ; <i8>:148 [#uses=1]
486 and i8 %148, %147 ; <i8>:149 [#uses=1]
487 store i8 %149, i8* @uc, align 1
488 load i8* @uc, align 1 ; <i8>:150 [#uses=1]
489 zext i8 %150 to i16 ; <i16>:151 [#uses=2]
490 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:152 [#uses=1]
491 call i16 @llvm.atomic.load.and.i16.p0i16( i16* %152, i16 %151 ) ; <i16>:153 [#uses=1]
492 and i16 %153, %151 ; <i16>:154 [#uses=1]
493 store i16 %154, i16* @ss, align 2
494 load i8* @uc, align 1 ; <i8>:155 [#uses=1]
495 zext i8 %155 to i16 ; <i16>:156 [#uses=2]
496 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:157 [#uses=1]
497 call i16 @llvm.atomic.load.and.i16.p0i16( i16* %157, i16 %156 ) ; <i16>:158 [#uses=1]
498 and i16 %158, %156 ; <i16>:159 [#uses=1]
499 store i16 %159, i16* @us, align 2
500 load i8* @uc, align 1 ; <i8>:160 [#uses=1]
501 zext i8 %160 to i32 ; <i32>:161 [#uses=2]
502 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:162 [#uses=1]
503 call i32 @llvm.atomic.load.and.i32.p0i32( i32* %162, i32 %161 ) ; <i32>:163 [#uses=1]
504 and i32 %163, %161 ; <i32>:164 [#uses=1]
505 store i32 %164, i32* @si, align 4
506 load i8* @uc, align 1 ; <i8>:165 [#uses=1]
507 zext i8 %165 to i32 ; <i32>:166 [#uses=2]
508 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:167 [#uses=1]
509 call i32 @llvm.atomic.load.and.i32.p0i32( i32* %167, i32 %166 ) ; <i32>:168 [#uses=1]
510 and i32 %168, %166 ; <i32>:169 [#uses=1]
511 store i32 %169, i32* @ui, align 4
512 load i8* @uc, align 1 ; <i8>:170 [#uses=1]
513 zext i8 %170 to i64 ; <i64>:171 [#uses=2]
514 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:172 [#uses=1]
515 call i64 @llvm.atomic.load.and.i64.p0i64( i64* %172, i64 %171 ) ; <i64>:173 [#uses=1]
516 and i64 %173, %171 ; <i64>:174 [#uses=1]
517 store i64 %174, i64* @sl, align 8
518 load i8* @uc, align 1 ; <i8>:175 [#uses=1]
519 zext i8 %175 to i64 ; <i64>:176 [#uses=2]
520 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:177 [#uses=1]
521 call i64 @llvm.atomic.load.and.i64.p0i64( i64* %177, i64 %176 ) ; <i64>:178 [#uses=1]
522 and i64 %178, %176 ; <i64>:179 [#uses=1]
523 store i64 %179, i64* @ul, align 8
524 load i8* @uc, align 1 ; <i8>:180 [#uses=2]
525 call i8 @llvm.atomic.load.nand.i8.p0i8( i8* @sc, i8 %180 ) ; <i8>:181 [#uses=1]
526 xor i8 %181, -1 ; <i8>:182 [#uses=1]
527 and i8 %182, %180 ; <i8>:183 [#uses=1]
528 store i8 %183, i8* @sc, align 1
529 load i8* @uc, align 1 ; <i8>:184 [#uses=2]
530 call i8 @llvm.atomic.load.nand.i8.p0i8( i8* @uc, i8 %184 ) ; <i8>:185 [#uses=1]
531 xor i8 %185, -1 ; <i8>:186 [#uses=1]
532 and i8 %186, %184 ; <i8>:187 [#uses=1]
533 store i8 %187, i8* @uc, align 1
534 load i8* @uc, align 1 ; <i8>:188 [#uses=1]
535 zext i8 %188 to i16 ; <i16>:189 [#uses=2]
536 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:190 [#uses=1]
537 call i16 @llvm.atomic.load.nand.i16.p0i16( i16* %190, i16 %189 ) ; <i16>:191 [#uses=1]
538 xor i16 %191, -1 ; <i16>:192 [#uses=1]
539 and i16 %192, %189 ; <i16>:193 [#uses=1]
540 store i16 %193, i16* @ss, align 2
541 load i8* @uc, align 1 ; <i8>:194 [#uses=1]
542 zext i8 %194 to i16 ; <i16>:195 [#uses=2]
543 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:196 [#uses=1]
544 call i16 @llvm.atomic.load.nand.i16.p0i16( i16* %196, i16 %195 ) ; <i16>:197 [#uses=1]
545 xor i16 %197, -1 ; <i16>:198 [#uses=1]
546 and i16 %198, %195 ; <i16>:199 [#uses=1]
547 store i16 %199, i16* @us, align 2
548 load i8* @uc, align 1 ; <i8>:200 [#uses=1]
549 zext i8 %200 to i32 ; <i32>:201 [#uses=2]
550 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:202 [#uses=1]
551 call i32 @llvm.atomic.load.nand.i32.p0i32( i32* %202, i32 %201 ) ; <i32>:203 [#uses=1]
552 xor i32 %203, -1 ; <i32>:204 [#uses=1]
553 and i32 %204, %201 ; <i32>:205 [#uses=1]
554 store i32 %205, i32* @si, align 4
555 load i8* @uc, align 1 ; <i8>:206 [#uses=1]
556 zext i8 %206 to i32 ; <i32>:207 [#uses=2]
557 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:208 [#uses=1]
558 call i32 @llvm.atomic.load.nand.i32.p0i32( i32* %208, i32 %207 ) ; <i32>:209 [#uses=1]
559 xor i32 %209, -1 ; <i32>:210 [#uses=1]
560 and i32 %210, %207 ; <i32>:211 [#uses=1]
561 store i32 %211, i32* @ui, align 4
562 load i8* @uc, align 1 ; <i8>:212 [#uses=1]
563 zext i8 %212 to i64 ; <i64>:213 [#uses=2]
564 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:214 [#uses=1]
565 call i64 @llvm.atomic.load.nand.i64.p0i64( i64* %214, i64 %213 ) ; <i64>:215 [#uses=1]
566 xor i64 %215, -1 ; <i64>:216 [#uses=1]
567 and i64 %216, %213 ; <i64>:217 [#uses=1]
568 store i64 %217, i64* @sl, align 8
569 load i8* @uc, align 1 ; <i8>:218 [#uses=1]
570 zext i8 %218 to i64 ; <i64>:219 [#uses=2]
571 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:220 [#uses=1]
572 call i64 @llvm.atomic.load.nand.i64.p0i64( i64* %220, i64 %219 ) ; <i64>:221 [#uses=1]
573 xor i64 %221, -1 ; <i64>:222 [#uses=1]
574 and i64 %222, %219 ; <i64>:223 [#uses=1]
575 store i64 %223, i64* @ul, align 8
578 return: ; preds = %entry
582 define void @test_compare_and_swap() nounwind {
584 load i8* @uc, align 1 ; <i8>:0 [#uses=1]
585 load i8* @sc, align 1 ; <i8>:1 [#uses=1]
586 call i8 @llvm.atomic.cmp.swap.i8.p0i8( i8* @sc, i8 %0, i8 %1 ) ; <i8>:2 [#uses=1]
587 store i8 %2, i8* @sc, align 1
588 load i8* @uc, align 1 ; <i8>:3 [#uses=1]
589 load i8* @sc, align 1 ; <i8>:4 [#uses=1]
590 call i8 @llvm.atomic.cmp.swap.i8.p0i8( i8* @uc, i8 %3, i8 %4 ) ; <i8>:5 [#uses=1]
591 store i8 %5, i8* @uc, align 1
592 load i8* @uc, align 1 ; <i8>:6 [#uses=1]
593 zext i8 %6 to i16 ; <i16>:7 [#uses=1]
594 load i8* @sc, align 1 ; <i8>:8 [#uses=1]
595 sext i8 %8 to i16 ; <i16>:9 [#uses=1]
596 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:10 [#uses=1]
597 call i16 @llvm.atomic.cmp.swap.i16.p0i16( i16* %10, i16 %7, i16 %9 ) ; <i16>:11 [#uses=1]
598 store i16 %11, i16* @ss, align 2
599 load i8* @uc, align 1 ; <i8>:12 [#uses=1]
600 zext i8 %12 to i16 ; <i16>:13 [#uses=1]
601 load i8* @sc, align 1 ; <i8>:14 [#uses=1]
602 sext i8 %14 to i16 ; <i16>:15 [#uses=1]
603 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:16 [#uses=1]
604 call i16 @llvm.atomic.cmp.swap.i16.p0i16( i16* %16, i16 %13, i16 %15 ) ; <i16>:17 [#uses=1]
605 store i16 %17, i16* @us, align 2
606 load i8* @uc, align 1 ; <i8>:18 [#uses=1]
607 zext i8 %18 to i32 ; <i32>:19 [#uses=1]
608 load i8* @sc, align 1 ; <i8>:20 [#uses=1]
609 sext i8 %20 to i32 ; <i32>:21 [#uses=1]
610 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:22 [#uses=1]
611 call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %22, i32 %19, i32 %21 ) ; <i32>:23 [#uses=1]
612 store i32 %23, i32* @si, align 4
613 load i8* @uc, align 1 ; <i8>:24 [#uses=1]
614 zext i8 %24 to i32 ; <i32>:25 [#uses=1]
615 load i8* @sc, align 1 ; <i8>:26 [#uses=1]
616 sext i8 %26 to i32 ; <i32>:27 [#uses=1]
617 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:28 [#uses=1]
618 call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %28, i32 %25, i32 %27 ) ; <i32>:29 [#uses=1]
619 store i32 %29, i32* @ui, align 4
620 load i8* @uc, align 1 ; <i8>:30 [#uses=1]
621 zext i8 %30 to i64 ; <i64>:31 [#uses=1]
622 load i8* @sc, align 1 ; <i8>:32 [#uses=1]
623 sext i8 %32 to i64 ; <i64>:33 [#uses=1]
624 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:34 [#uses=1]
625 call i64 @llvm.atomic.cmp.swap.i64.p0i64( i64* %34, i64 %31, i64 %33 ) ; <i64>:35 [#uses=1]
626 store i64 %35, i64* @sl, align 8
627 load i8* @uc, align 1 ; <i8>:36 [#uses=1]
628 zext i8 %36 to i64 ; <i64>:37 [#uses=1]
629 load i8* @sc, align 1 ; <i8>:38 [#uses=1]
630 sext i8 %38 to i64 ; <i64>:39 [#uses=1]
631 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:40 [#uses=1]
632 call i64 @llvm.atomic.cmp.swap.i64.p0i64( i64* %40, i64 %37, i64 %39 ) ; <i64>:41 [#uses=1]
633 store i64 %41, i64* @ul, align 8
634 load i8* @uc, align 1 ; <i8>:42 [#uses=2]
635 load i8* @sc, align 1 ; <i8>:43 [#uses=1]
636 call i8 @llvm.atomic.cmp.swap.i8.p0i8( i8* @sc, i8 %42, i8 %43 ) ; <i8>:44 [#uses=1]
637 icmp eq i8 %44, %42 ; <i1>:45 [#uses=1]
638 zext i1 %45 to i8 ; <i8>:46 [#uses=1]
639 zext i8 %46 to i32 ; <i32>:47 [#uses=1]
640 store i32 %47, i32* @ui, align 4
641 load i8* @uc, align 1 ; <i8>:48 [#uses=2]
642 load i8* @sc, align 1 ; <i8>:49 [#uses=1]
643 call i8 @llvm.atomic.cmp.swap.i8.p0i8( i8* @uc, i8 %48, i8 %49 ) ; <i8>:50 [#uses=1]
644 icmp eq i8 %50, %48 ; <i1>:51 [#uses=1]
645 zext i1 %51 to i8 ; <i8>:52 [#uses=1]
646 zext i8 %52 to i32 ; <i32>:53 [#uses=1]
647 store i32 %53, i32* @ui, align 4
648 load i8* @uc, align 1 ; <i8>:54 [#uses=1]
649 zext i8 %54 to i16 ; <i16>:55 [#uses=2]
650 load i8* @sc, align 1 ; <i8>:56 [#uses=1]
651 sext i8 %56 to i16 ; <i16>:57 [#uses=1]
652 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:58 [#uses=1]
653 call i16 @llvm.atomic.cmp.swap.i16.p0i16( i16* %58, i16 %55, i16 %57 ) ; <i16>:59 [#uses=1]
654 icmp eq i16 %59, %55 ; <i1>:60 [#uses=1]
655 zext i1 %60 to i8 ; <i8>:61 [#uses=1]
656 zext i8 %61 to i32 ; <i32>:62 [#uses=1]
657 store i32 %62, i32* @ui, align 4
658 load i8* @uc, align 1 ; <i8>:63 [#uses=1]
659 zext i8 %63 to i16 ; <i16>:64 [#uses=2]
660 load i8* @sc, align 1 ; <i8>:65 [#uses=1]
661 sext i8 %65 to i16 ; <i16>:66 [#uses=1]
662 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:67 [#uses=1]
663 call i16 @llvm.atomic.cmp.swap.i16.p0i16( i16* %67, i16 %64, i16 %66 ) ; <i16>:68 [#uses=1]
664 icmp eq i16 %68, %64 ; <i1>:69 [#uses=1]
665 zext i1 %69 to i8 ; <i8>:70 [#uses=1]
666 zext i8 %70 to i32 ; <i32>:71 [#uses=1]
667 store i32 %71, i32* @ui, align 4
668 load i8* @uc, align 1 ; <i8>:72 [#uses=1]
669 zext i8 %72 to i32 ; <i32>:73 [#uses=2]
670 load i8* @sc, align 1 ; <i8>:74 [#uses=1]
671 sext i8 %74 to i32 ; <i32>:75 [#uses=1]
672 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:76 [#uses=1]
673 call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %76, i32 %73, i32 %75 ) ; <i32>:77 [#uses=1]
674 icmp eq i32 %77, %73 ; <i1>:78 [#uses=1]
675 zext i1 %78 to i8 ; <i8>:79 [#uses=1]
676 zext i8 %79 to i32 ; <i32>:80 [#uses=1]
677 store i32 %80, i32* @ui, align 4
678 load i8* @uc, align 1 ; <i8>:81 [#uses=1]
679 zext i8 %81 to i32 ; <i32>:82 [#uses=2]
680 load i8* @sc, align 1 ; <i8>:83 [#uses=1]
681 sext i8 %83 to i32 ; <i32>:84 [#uses=1]
682 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:85 [#uses=1]
683 call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %85, i32 %82, i32 %84 ) ; <i32>:86 [#uses=1]
684 icmp eq i32 %86, %82 ; <i1>:87 [#uses=1]
685 zext i1 %87 to i8 ; <i8>:88 [#uses=1]
686 zext i8 %88 to i32 ; <i32>:89 [#uses=1]
687 store i32 %89, i32* @ui, align 4
688 load i8* @uc, align 1 ; <i8>:90 [#uses=1]
689 zext i8 %90 to i64 ; <i64>:91 [#uses=2]
690 load i8* @sc, align 1 ; <i8>:92 [#uses=1]
691 sext i8 %92 to i64 ; <i64>:93 [#uses=1]
692 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:94 [#uses=1]
693 call i64 @llvm.atomic.cmp.swap.i64.p0i64( i64* %94, i64 %91, i64 %93 ) ; <i64>:95 [#uses=1]
694 icmp eq i64 %95, %91 ; <i1>:96 [#uses=1]
695 zext i1 %96 to i8 ; <i8>:97 [#uses=1]
696 zext i8 %97 to i32 ; <i32>:98 [#uses=1]
697 store i32 %98, i32* @ui, align 4
698 load i8* @uc, align 1 ; <i8>:99 [#uses=1]
699 zext i8 %99 to i64 ; <i64>:100 [#uses=2]
700 load i8* @sc, align 1 ; <i8>:101 [#uses=1]
701 sext i8 %101 to i64 ; <i64>:102 [#uses=1]
702 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:103 [#uses=1]
703 call i64 @llvm.atomic.cmp.swap.i64.p0i64( i64* %103, i64 %100, i64 %102 ) ; <i64>:104 [#uses=1]
704 icmp eq i64 %104, %100 ; <i1>:105 [#uses=1]
705 zext i1 %105 to i8 ; <i8>:106 [#uses=1]
706 zext i8 %106 to i32 ; <i32>:107 [#uses=1]
707 store i32 %107, i32* @ui, align 4
710 return: ; preds = %entry
714 declare i8 @llvm.atomic.cmp.swap.i8.p0i8(i8*, i8, i8) nounwind
716 declare i16 @llvm.atomic.cmp.swap.i16.p0i16(i16*, i16, i16) nounwind
718 declare i32 @llvm.atomic.cmp.swap.i32.p0i32(i32*, i32, i32) nounwind
720 declare i64 @llvm.atomic.cmp.swap.i64.p0i64(i64*, i64, i64) nounwind
722 define void @test_lock() nounwind {
724 call i8 @llvm.atomic.swap.i8.p0i8( i8* @sc, i8 1 ) ; <i8>:0 [#uses=1]
725 store i8 %0, i8* @sc, align 1
726 call i8 @llvm.atomic.swap.i8.p0i8( i8* @uc, i8 1 ) ; <i8>:1 [#uses=1]
727 store i8 %1, i8* @uc, align 1
728 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:2 [#uses=1]
729 call i16 @llvm.atomic.swap.i16.p0i16( i16* %2, i16 1 ) ; <i16>:3 [#uses=1]
730 store i16 %3, i16* @ss, align 2
731 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:4 [#uses=1]
732 call i16 @llvm.atomic.swap.i16.p0i16( i16* %4, i16 1 ) ; <i16>:5 [#uses=1]
733 store i16 %5, i16* @us, align 2
734 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:6 [#uses=1]
735 call i32 @llvm.atomic.swap.i32.p0i32( i32* %6, i32 1 ) ; <i32>:7 [#uses=1]
736 store i32 %7, i32* @si, align 4
737 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:8 [#uses=1]
738 call i32 @llvm.atomic.swap.i32.p0i32( i32* %8, i32 1 ) ; <i32>:9 [#uses=1]
739 store i32 %9, i32* @ui, align 4
740 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:10 [#uses=1]
741 call i64 @llvm.atomic.swap.i64.p0i64( i64* %10, i64 1 ) ; <i64>:11 [#uses=1]
742 store i64 %11, i64* @sl, align 8
743 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:12 [#uses=1]
744 call i64 @llvm.atomic.swap.i64.p0i64( i64* %12, i64 1 ) ; <i64>:13 [#uses=1]
745 store i64 %13, i64* @ul, align 8
746 call void @llvm.memory.barrier( i1 true, i1 true, i1 true, i1 true, i1 false )
747 volatile store i8 0, i8* @sc, align 1
748 volatile store i8 0, i8* @uc, align 1
749 bitcast i8* bitcast (i16* @ss to i8*) to i16* ; <i16*>:14 [#uses=1]
750 volatile store i16 0, i16* %14, align 2
751 bitcast i8* bitcast (i16* @us to i8*) to i16* ; <i16*>:15 [#uses=1]
752 volatile store i16 0, i16* %15, align 2
753 bitcast i8* bitcast (i32* @si to i8*) to i32* ; <i32*>:16 [#uses=1]
754 volatile store i32 0, i32* %16, align 4
755 bitcast i8* bitcast (i32* @ui to i8*) to i32* ; <i32*>:17 [#uses=1]
756 volatile store i32 0, i32* %17, align 4
757 bitcast i8* bitcast (i64* @sl to i8*) to i64* ; <i64*>:18 [#uses=1]
758 volatile store i64 0, i64* %18, align 8
759 bitcast i8* bitcast (i64* @ul to i8*) to i64* ; <i64*>:19 [#uses=1]
760 volatile store i64 0, i64* %19, align 8
761 bitcast i8* bitcast (i64* @sll to i8*) to i64* ; <i64*>:20 [#uses=1]
762 volatile store i64 0, i64* %20, align 8
763 bitcast i8* bitcast (i64* @ull to i8*) to i64* ; <i64*>:21 [#uses=1]
764 volatile store i64 0, i64* %21, align 8
767 return: ; preds = %entry
771 declare i8 @llvm.atomic.swap.i8.p0i8(i8*, i8) nounwind
773 declare i16 @llvm.atomic.swap.i16.p0i16(i16*, i16) nounwind
775 declare i32 @llvm.atomic.swap.i32.p0i32(i32*, i32) nounwind
777 declare i64 @llvm.atomic.swap.i64.p0i64(i64*, i64) nounwind
779 declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind