File: fast-isel-call.ll

package info (click to toggle)
llvm-3.0 3.0-10
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 75,412 kB
  • sloc: cpp: 468,043; asm: 109,345; ansic: 13,782; sh: 12,935; ml: 4,716; python: 4,351; perl: 2,096; makefile: 1,905; pascal: 1,578; exp: 389; xml: 283; lisp: 187; csh: 117
file content (55 lines) | stat: -rw-r--r-- 1,319 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
; RUN: llc < %s -O0 -fast-isel-abort -march=x86 | FileCheck %s

%struct.s = type {i32, i32, i32}

define i32 @test1() nounwind {
tak:
	%tmp = call i1 @foo()
	br i1 %tmp, label %BB1, label %BB2
BB1:
	ret i32 1
BB2:
	ret i32 0
; CHECK: test1:
; CHECK: calll
; CHECK-NEXT: testb	$1
}
declare zeroext i1 @foo()  nounwind

declare void @foo2(%struct.s* byval)

define void @test2(%struct.s* %d) nounwind {
  call void @foo2(%struct.s* byval %d )
  ret void
; CHECK: test2:
; CHECK: movl	(%eax)
; CHECK: movl {{.*}}, (%esp)
; CHECK: movl	4(%eax)
; CHECK: movl {{.*}}, 4(%esp)
; CHECK: movl	8(%eax)
; CHECK: movl {{.*}}, 8(%esp)
}

declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind

define void @test3(i8* %a) {
  call void @llvm.memset.p0i8.i32(i8* %a, i8 0, i32 100, i32 1, i1 false)
  ret void
; CHECK: test3:
; CHECK:   movl	{{.*}}, (%esp)
; CHECK:   movl	$0, 4(%esp)
; CHECK:   movl	$100, 8(%esp)
; CHECK:   calll {{.*}}memset
}

declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind

define void @test4(i8* %a, i8* %b) {
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %b, i32 100, i32 1, i1 false)
  ret void
; CHECK: test4:
; CHECK:   movl	{{.*}}, (%esp)
; CHECK:   movl	{{.*}}, 4(%esp)
; CHECK:   movl	$100, 8(%esp)
; CHECK:   calll {{.*}}memcpy
}