1 ; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s -check-prefix=X64
2 ; Control Flow Guard is currently only available on Windows
5 ; Test that Control Flow Guard checks are correctly added for x86_64 vector calls.
6 define void @func_cf_vector_x64(void (%struct.HVA)* %0, %struct.HVA* %1) #0 {
8 %2 = alloca %struct.HVA, align 8
9 %3 = bitcast %struct.HVA* %2 to i8*
10 %4 = bitcast %struct.HVA* %1 to i8*
11 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %3, i8* align 8 %4, i64 32, i1 false)
12 %5 = load %struct.HVA, %struct.HVA* %2, align 8
13 call x86_vectorcallcc void %0(%struct.HVA inreg %5)
16 ; X64-LABEL: func_cf_vector_x64
17 ; X64: movq %rcx, %rax
18 ; X64: movups (%rdx), %xmm0
19 ; X64: movups 16(%rdx), %xmm1
20 ; X64: movaps %xmm0, 32(%rsp)
21 ; X64: movaps %xmm1, 48(%rsp)
22 ; X64: movsd 32(%rsp), %xmm0 # xmm0 = mem[0],zero
23 ; X64: movsd 40(%rsp), %xmm1 # xmm1 = mem[0],zero
24 ; X64: movsd 48(%rsp), %xmm2 # xmm2 = mem[0],zero
25 ; X64: movsd 56(%rsp), %xmm3 # xmm3 = mem[0],zero
26 ; X64: callq *__guard_dispatch_icall_fptr(%rip)
29 attributes #0 = { "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" }
31 %struct.HVA = type { double, double, double, double }
33 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1 immarg) #1
34 attributes #1 = { argmemonly nounwind willreturn }
37 !llvm.module.flags = !{!0}
38 !0 = !{i32 2, !"cfguard", i32 2}