1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=verify -S < %s | FileCheck %s
4 define i32 @load(ptr %a) {
6 ; CHECK-NEXT: [[I:%.*]] = load i32, ptr [[A:%.*]], align 4
7 ; CHECK-NEXT: ret i32 [[I]]
13 define void @store(ptr %a, i32 %i) {
14 ; CHECK-LABEL: @store(
15 ; CHECK-NEXT: store i32 [[I:%.*]], ptr [[A:%.*]], align 4
16 ; CHECK-NEXT: ret void
22 define void @cmpxchg(ptr %p, i32 %a, i32 %b) {
23 ; CHECK-LABEL: @cmpxchg(
24 ; CHECK-NEXT: [[VAL_SUCCESS:%.*]] = cmpxchg ptr [[P:%.*]], i32 [[A:%.*]], i32 [[B:%.*]] acq_rel monotonic, align 4
25 ; CHECK-NEXT: ret void
27 %val_success = cmpxchg ptr %p, i32 %a, i32 %b acq_rel monotonic
31 define void @atomicrmw(ptr %a, i32 %i) {
32 ; CHECK-LABEL: @atomicrmw(
33 ; CHECK-NEXT: [[B:%.*]] = atomicrmw add ptr [[A:%.*]], i32 [[I:%.*]] acquire, align 4
34 ; CHECK-NEXT: ret void
36 %b = atomicrmw add ptr %a, i32 %i acquire
40 define void @opaque_mangle(ptr %a) {
41 ; CHECK-LABEL: @opaque_mangle(
42 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 8, ptr [[A:%.*]])
43 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 8, ptr [[A]])
44 ; CHECK-NEXT: ret void
46 call void @llvm.lifetime.start.p0(i64 8, ptr %a)
47 call void @llvm.lifetime.end.p0(i64 8, ptr %a)
51 define void @intrinsic_calls(ptr %a) {
52 ; CHECK-LABEL: @intrinsic_calls(
53 ; CHECK-NEXT: [[TMP1:%.*]] = call <2 x i32> @llvm.masked.load.v2i32.p0(ptr [[A:%.*]], i32 4, <2 x i1> zeroinitializer, <2 x i32> zeroinitializer)
54 ; CHECK-NEXT: call void @llvm.masked.store.v2i32.p0(<2 x i32> zeroinitializer, ptr [[A]], i32 4, <2 x i1> zeroinitializer)
55 ; CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.masked.gather.v2i64.v2p0(<2 x ptr> zeroinitializer, i32 4, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
56 ; CHECK-NEXT: [[TMP3:%.*]] = call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype(i32) null, i32 0, i32 0)
57 ; CHECK-NEXT: ret void
59 call <2 x i32> @llvm.masked.load.v2i32.p0(ptr %a, i32 4, <2 x i1> zeroinitializer, <2 x i32> zeroinitializer)
60 call void @llvm.masked.store.v2i32.p0(<2 x i32> zeroinitializer, ptr %a, i32 4, <2 x i1> zeroinitializer)
61 call <2 x i64> @llvm.masked.gather.v2i64.v2p0(<2 x ptr> zeroinitializer, i32 4, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
62 call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype(i32) null, i32 0, i32 0)
66 ; CHECK: @llvm.lifetime.start.p0
67 ; CHECK: @llvm.lifetime.end.p0
68 declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
69 declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
71 declare <2 x i32> @llvm.masked.load.v2i32.p0(ptr, i32, <2 x i1>, <2 x i32>)
72 declare void @llvm.masked.store.v2i32.p0(<2 x i32>, ptr, i32, <2 x i1>)
73 declare <2 x i64> @llvm.masked.gather.v2i64.v2p0(<2 x ptr>, i32, <2 x i1>, <2 x i64>)
74 declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32)