1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -mtriple=i686-linux-gnu -atomic-expand %s | FileCheck %s
5 define i256 @atomic_load256_libcall(ptr %ptr) nounwind {
6 ; CHECK-LABEL: @atomic_load256_libcall(
7 ; CHECK-NEXT: [[TMP1:%.*]] = alloca i256, align 16
8 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 32, ptr [[TMP1]])
9 ; CHECK-NEXT: call void @__atomic_load(i32 32, ptr [[PTR:%.*]], ptr [[TMP1]], i32 0)
10 ; CHECK-NEXT: [[TMP2:%.*]] = load i256, ptr [[TMP1]], align 16
11 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 32, ptr [[TMP1]])
12 ; CHECK-NEXT: ret i256 [[TMP2]]
14 %result = load atomic i256, ptr %ptr unordered, align 16
18 define i256 @atomic_load256_libcall_as1(ptr addrspace(1) %ptr) nounwind {
19 ; CHECK-LABEL: @atomic_load256_libcall_as1(
20 ; CHECK-NEXT: [[TMP1:%.*]] = addrspacecast ptr addrspace(1) [[PTR:%.*]] to ptr
21 ; CHECK-NEXT: [[TMP2:%.*]] = alloca i256, align 16
22 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 32, ptr [[TMP2]])
23 ; CHECK-NEXT: call void @__atomic_load(i32 32, ptr [[TMP1]], ptr [[TMP2]], i32 0)
24 ; CHECK-NEXT: [[TMP3:%.*]] = load i256, ptr [[TMP2]], align 16
25 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 32, ptr [[TMP2]])
26 ; CHECK-NEXT: ret i256 [[TMP3]]
28 %result = load atomic i256, ptr addrspace(1) %ptr unordered, align 16