1 ; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s
4 ; Assertion `(Disp->isImm() || Disp->isGlobal()) && (Other.Disp->isImm() || Other.Disp->isGlobal()) && "Address displacement operand is always an immediate or a global"' failed.
6 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
7 target triple = "i686-pc-windows-msvc"
9 declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture readonly, i32, i1) argmemonly nounwind
10 declare <2 x i64> @_mm_xor_si128(<2 x i64>, <2 x i64>) optsize
11 declare <2 x i64> @llvm.x86.pclmulqdq(<2 x i64>, <2 x i64>, i8) nounwind readnone
12 declare <4 x float> @_mm_castsi128_ps(<2 x i64>) optsize
14 ; Check that the LEA optimization pass works with CPI address displacements.
15 define void @test1(ptr nocapture readonly %src, i32 %len) #0 {
16 %parts = alloca [4 x i32], align 4
17 call void @llvm.memcpy.p0.p0.i32(ptr %parts, ptr %src, i32 %len, i1 false)
18 %call0 = tail call <2 x i64> @_mm_xor_si128(<2 x i64> undef, <2 x i64> <i64 -9187201950435737472, i64 -9187201950435737472>)
19 %tmp0 = tail call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> undef, <2 x i64> <i64 7631803798, i64 5708721108>, i8 16)
20 %call1 = tail call <4 x float> @_mm_castsi128_ps(<2 x i64> %tmp0)
24 ; CHECK: calll _memcpy
25 ; CHECK: movaps __xmm@{{[0-9a-f]+}}, %xmm1
26 ; CHECK: calll __mm_xor_si128
27 ; CHECK: pclmulqdq $16, __xmm@{{[0-9a-f]+}}, %xmm0
28 ; CHECK: jmp __mm_castsi128_ps
31 declare i32 @GetLastError(...)
32 declare void @IsolationAwareDeactivateActCtx(i32, i32)
33 declare ptr @llvm.localaddress()
34 declare void @llvm.localescape(...)
35 declare ptr @llvm.localrecover(ptr, ptr, i32)
37 @IsolationAwarePrivateT_SqbjaYRiRY = common global i32 0, align 4
39 ; Check that the MCSymbol objects are created to be used in "\01?fin$0@0@test2@@".
40 define void @test2() #0 {
42 %fActivateActCtxSuccess = alloca i32, align 4
43 %proc = alloca i32, align 4
44 %ulpCookie = alloca i32, align 4
45 call void (...) @llvm.localescape(ptr nonnull %fActivateActCtxSuccess, ptr nonnull %proc, ptr nonnull %ulpCookie)
46 %tmp0 = tail call ptr @llvm.localaddress()
47 call fastcc void @"\01?fin$0@0@test2@@"(ptr %tmp0)
50 ; CHECK: .set Ltest2$frame_escape_0, 8
51 ; CHECK: .set Ltest2$frame_escape_1, 4
52 ; CHECK: .set Ltest2$frame_escape_2, 0
53 ; CHECK: calll "?fin$0@0@test2@@"
56 ; Check that the LEA optimization pass works with MCSymbol address displacements.
57 define internal fastcc void @"\01?fin$0@0@test2@@"(ptr readonly %frame_pointer) unnamed_addr noinline nounwind optsize {
59 %tmp0 = tail call ptr @llvm.localrecover(ptr @test2, ptr %frame_pointer, i32 1)
60 %tmp1 = tail call ptr @llvm.localrecover(ptr @test2, ptr %frame_pointer, i32 2)
61 %tmp2 = load i32, ptr @IsolationAwarePrivateT_SqbjaYRiRY, align 4
62 %tobool = icmp eq i32 %tmp2, 0
63 br i1 %tobool, label %if.end, label %land.lhs.true
66 %tmp3 = tail call ptr @llvm.localrecover(ptr @test2, ptr %frame_pointer, i32 0)
67 %tmp4 = load i32, ptr %tmp3, align 4
68 %tobool1 = icmp eq i32 %tmp4, 0
69 br i1 %tobool1, label %if.end, label %if.then
72 %tmp5 = load i32, ptr %tmp0, align 4
73 %tobool2 = icmp eq i32 %tmp5, 0
74 br i1 %tobool2, label %cond.end, label %cond.true
77 %call = tail call i32 @GetLastError()
81 %tmp6 = load i32, ptr %tmp1, align 4
82 tail call void @IsolationAwareDeactivateActCtx(i32 0, i32 %tmp6)
87 ; CHECK-LABEL: "?fin$0@0@test2@@":
88 ; CHECK: cmpl $0, Ltest2$frame_escape_0([[REG1:%[a-z]+]])
89 ; CHECK: leal Ltest2$frame_escape_1([[REG1]]), [[REG2:%[a-z]+]]
90 ; CHECK: leal Ltest2$frame_escape_2([[REG1]]), [[REG3:%[a-z]+]]
91 ; CHECK: cmpl $0, ([[REG2]])
92 ; CHECK: pushl ([[REG3]])
95 attributes #0 = { nounwind optsize "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-features"="+mmx,+pclmul,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3" "unsafe-fp-math"="false" "use-soft-float"="false" }