1 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
2 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
3 target triple = "i686-pc-windows-msvc18.0.0"
5 %struct.T = type { i64, [3 x i32] }
7 ; Function Attrs: nounwind optsize
8 define void @f(ptr %p, ptr %q, ptr inalloca(i32) nocapture %unused) #0 {
10 %g = alloca %struct.T, align 8
11 %r = alloca i32, align 8
12 store i32 0, ptr %r, align 4
13 call void @llvm.memcpy.p0.p0.i32(ptr align 8 %p, ptr align 8 %q, i32 24, i1 false)
16 while.body: ; preds = %while.body, %entry
17 %load = load i32, ptr %r, align 4
18 %dec = add nsw i32 %load, -1
19 store i32 %dec, ptr %r, align 4
21 %tobool = icmp eq i32 %dec, 0
22 br i1 %tobool, label %while.end, label %while.body
24 while.end: ; preds = %while.body
28 define void @f_pgso(ptr %p, ptr %q, ptr inalloca(i32) nocapture %unused) !prof !14 {
30 %g = alloca %struct.T, align 8
31 %r = alloca i32, align 8
32 store i32 0, ptr %r, align 4
33 call void @llvm.memcpy.p0.p0.i32(ptr align 8 %p, ptr align 8 %q, i32 24, i1 false)
36 while.body: ; preds = %while.body, %entry
37 %load = load i32, ptr %r, align 4
38 %dec = add nsw i32 %load, -1
39 store i32 %dec, ptr %r, align 4
41 %tobool = icmp eq i32 %dec, 0
42 br i1 %tobool, label %while.end, label %while.body
44 while.end: ; preds = %while.body
48 ; Function Attrs: argmemonly nounwind
49 declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture readonly, i32, i1) #1
55 ; CHECK: movl %esp, %ebp
56 ; CHECK: andl $-8, %esp
57 ; CHECK-NOT: movl %esp, %esi
59 ; CHECK: leal 8(%esp), %esi
62 ; CHECK: setne %[[NE_REG:.*]]
65 ; CHECK: addl $4, %esp
66 ; CHECK: testb %[[NE_REG]], %[[NE_REG]]
69 ; CHECK-LABEL: _f_pgso:
71 ; CHECK: movl %esp, %ebp
72 ; CHECK: andl $-8, %esp
73 ; CHECK-NOT: movl %esp, %esi
75 ; CHECK: leal 8(%esp), %esi
78 ; CHECK: setne %[[NE_REG:.*]]
81 ; CHECK: addl $4, %esp
82 ; CHECK: testb %[[NE_REG]], %[[NE_REG]]
85 attributes #0 = { nounwind optsize }
86 attributes #1 = { argmemonly nounwind }
88 !llvm.module.flags = !{!0}
89 !0 = !{i32 1, !"ProfileSummary", !1}
90 !1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
91 !2 = !{!"ProfileFormat", !"InstrProf"}
92 !3 = !{!"TotalCount", i64 10000}
93 !4 = !{!"MaxCount", i64 10}
94 !5 = !{!"MaxInternalCount", i64 1}
95 !6 = !{!"MaxFunctionCount", i64 1000}
96 !7 = !{!"NumCounts", i64 3}
97 !8 = !{!"NumFunctions", i64 3}
98 !9 = !{!"DetailedSummary", !10}
99 !10 = !{!11, !12, !13}
100 !11 = !{i32 10000, i64 100, i32 1}
101 !12 = !{i32 999000, i64 100, i32 1}
102 !13 = !{i32 999999, i64 1, i32 2}
103 !14 = !{!"function_entry_count", i64 0}