1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -verify-machineinstrs -mtriple=x86_64-pc-windows-msvc19.11.0 -mattr=+avx,+cx16 | FileCheck %s 3 4%struct.TestStruct = type { %union.Int128 } 5%union.Int128 = type { i128 } 6%struct.SomeArrays = type { %struct.SillyArray, %struct.SillyArray, %struct.SillyArray } 7%struct.SillyArray = type { i8*, i32, i32 } 8 9declare void @llvm.lifetime.start.p0i8(i64, i8*) 10 11define void @foo(%struct.TestStruct* %arg) align 2 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { 12; Check that %rbx is being used for a frame pointer 13; CHECK-LABEL: foo: 14; CHECK: movq %rsp, %rbx 15 16; Check that %rbx is saved and restored around both lock cmpxchg16b. 17; CHECK: movq %rbx, %r9 18; CHECK-NEXT: movabsq $1393743441367457520, %rcx # imm = 0x135792468ABCDEF0 19; CHECK-NEXT: movq %rcx, %rax 20; CHECK-NEXT: movq %rcx, %rdx 21; CHECK-NEXT: movq %rcx, %rbx 22; CHECK-NEXT: lock cmpxchg16b (%r8) 23; CHECK-NEXT: movq %r9, %rbx 24 25; CHECK: movq %rbx, %r9 26; CHECK-NEXT: movq %rcx, %rax 27; CHECK-NEXT: movq %rcx, %rdx 28; CHECK-NEXT: movq %rcx, %rbx 29; CHECK-NEXT: lock cmpxchg16b (%r8) 30; CHECK-NEXT: movq %r9, %rbx 31bb: 32 %i = alloca %struct.SomeArrays, align 8 33 %i1 = alloca %struct.SomeArrays, align 8 34 %i2 = getelementptr inbounds %struct.TestStruct, %struct.TestStruct* %arg, i64 0, i32 0, i32 0 35 %i3 = cmpxchg i128* %i2, i128 25710028567316702934644703134494809840, i128 25710028567316702934644703134494809840 seq_cst seq_cst 36 %i4 = extractvalue { i128, i1 } %i3, 0 37 %i5 = trunc i128 %i4 to i64 38 %i6 = icmp eq i64 %i5, 0 39 br i1 %i6, label %bb9, label %bb7 40 41bb7: ; preds = %bb 42 %i8 = cmpxchg i128* %i2, i128 25710028567316702934644703134494809840, i128 25710028567316702934644703134494809840 seq_cst seq_cst 43 br label %bb9 44 45bb9: ; preds = %bb7, %bb 46 %i10 = bitcast %struct.SomeArrays* %i to i8* 47 call void @llvm.lifetime.start.p0i8(i64 48, i8* nonnull %i10) 48 call void @llvm.memset.p0i8.i64(i8* nonnull align 8 dereferenceable(48) %i10, i8 0, i64 48, i1 false) 49 %i11 = bitcast %struct.SomeArrays* %i1 to i8* 50 call void @llvm.lifetime.start.p0i8(i64 48, i8* nonnull %i11) 51 %i12 = bitcast %struct.SomeArrays* %i1 to i8* 52 call void @llvm.memset.p0i8.i64(i8* nonnull align 8 dereferenceable(48) %i12, i8 0, i64 48, i1 false) 53 %i13 = invoke nonnull align 8 dereferenceable(48) %struct.SomeArrays* @"??4SomeArrays@@QEAAAEAU0@$$QEAU0@@Z"(%struct.SomeArrays* nonnull %i, %struct.SomeArrays* nonnull align 8 dereferenceable(48) %i1) 54 to label %bb14 unwind label %bb45 55 56bb14: ; preds = %bb9 57 call void @llvm.lifetime.end.p0i8(i64 48, i8* nonnull %i10) 58 ret void 59 60bb45: ; preds = %bb9 61 %i46 = cleanuppad within none [] 62 %i47 = getelementptr inbounds %struct.SomeArrays, %struct.SomeArrays* %i1, i64 0, i32 2, i32 0 63 %i48 = load i8*, i8** %i47, align 8 64 invoke void @"?free@@YAXPEAX@Z"(i8* %i48) [ "funclet"(token %i46) ] 65 to label %bb51 unwind label %bb49 66 67bb49: ; preds = %bb45 68 %i50 = cleanuppad within %i46 [] 69 call void @__std_terminate() [ "funclet"(token %i50) ] 70 unreachable 71 72bb51: ; preds = %bb45 73 %i52 = getelementptr inbounds %struct.SomeArrays, %struct.SomeArrays* %i1, i64 0, i32 1, i32 0 74 %i53 = load i8*, i8** %i52, align 8 75 invoke void @"?free@@YAXPEAX@Z"(i8* %i53) [ "funclet"(token %i46) ] 76 to label %bb56 unwind label %bb54 77 78bb54: ; preds = %bb51 79 %i55 = cleanuppad within %i46 [] 80 call void @__std_terminate() [ "funclet"(token %i55) ] 81 unreachable 82 83bb56: ; preds = %bb51 84 call void @llvm.lifetime.end.p0i8(i64 48, i8* nonnull %i10) 85 cleanupret from %i46 unwind to caller 86} 87 88declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) 89 90declare void @llvm.memset.p0i8.i64(i8*, i8, i64, i1) 91 92declare dso_local i32 @__CxxFrameHandler3(...) 93 94declare nonnull align 8 dereferenceable(48) %struct.SomeArrays* @"??4SomeArrays@@QEAAAEAU0@$$QEAU0@@Z"(%struct.SomeArrays*, %struct.SomeArrays* nonnull align 8 dereferenceable(48)) align 2 95 96declare void @"?free@@YAXPEAX@Z"(i8*) 97 98declare void @__std_terminate() 99