• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s | FileCheck %s
2target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
3target triple = "i686-pc-windows-msvc18.0.0"
4
5%struct.T = type { i64, [3 x i32] }
6
7; Function Attrs: nounwind optsize
8define void @f(i8* %p, i8* %q, i32* inalloca nocapture %unused) #0 {
9entry:
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* %p, i8* %q, i32 24, i32 8, i1 false)
14  br label %while.body
15
16while.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
23
24while.end:                                        ; preds = %while.body
25  ret void
26}
27
28; Function Attrs: argmemonly nounwind
29declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #1
30
31declare void @g(%struct.T*)
32
33; CHECK-LABEL: _f:
34; CHECK:     pushl %ebp
35; CHECK:     movl %esp, %ebp
36; CHECK:     andl $-8, %esp
37; CHECK-NOT: movl %esp, %esi
38; CHECK:     rep;movsl
39; CHECK:     leal 8(%esp), %esi
40
41; CHECK:     decl     (%esp)
42; CHECK:     seto     %al
43; CHECK:     lahf
44; CHECK:     movl     %eax, %edi
45; CHECK:     pushl     %esi
46; CHECK:     calll     _g
47; CHECK:     addl     $4, %esp
48; CHECK:     movl     %edi, %eax
49; CHECK:     addb     $127, %al
50; CHECK:     sahf
51
52attributes #0 = { nounwind optsize }
53attributes #1 = { argmemonly nounwind }
54