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(i8* %p, i8* %q, i32* inalloca(i32) nocapture %unused) #0 {
10 %g = alloca %struct.T, align 8
11 %r = alloca i32, align 8
12 store i32 0, i32* %r, align 4
13 call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %p, i8* align 8 %q, i32 24, i1 false)
16 while.body: ; preds = %while.body, %entry
17 %load = load i32, i32* %r, align 4
18 %dec = add nsw i32 %load, -1
19 store i32 %dec, i32* %r, align 4
20 call void @g(%struct.T* %g)
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(i8* %p, i8* %q, i32* inalloca(i32) nocapture %unused) !prof !14 {
30 %g = alloca %struct.T, align 8
31 %r = alloca i32, align 8
32 store i32 0, i32* %r, align 4
33 call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %p, i8* align 8 %q, i32 24, i1 false)
36 while.body: ; preds = %while.body, %entry
37 %load = load i32, i32* %r, align 4
38 %dec = add nsw i32 %load, -1
39 store i32 %dec, i32* %r, align 4
40 call void @g(%struct.T* %g)
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.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1) #1
51 declare void @g(%struct.T*)
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}