branch-relaxation.ll
2.94 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
; RUN: llc < %s -march=avr | FileCheck %s
; CHECK-LABEL: relax_breq
; CHECK: cpi r{{[0-9]+}}, 0
; CHECK: brne LBB0_1
; CHECK: rjmp LBB0_2
; LBB0_1:
define i8 @relax_breq(i1 %a) {
entry-block:
br i1 %a, label %hello, label %finished
hello:
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
br label %finished
finished:
ret i8 3
}
; CHECK-LABEL: no_relax_breq
; CHECK: cpi r{{[0-9]+}}, 0
; CHECK: breq [[END_BB:LBB[0-9]+_[0-9]+]]
; CHECK: nop
; ...
; LBB0_1:
define i8 @no_relax_breq(i1 %a) {
entry-block:
br i1 %a, label %hello, label %finished
hello:
; There are not enough NOPs to require relaxation.
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
call void asm sideeffect "nop", ""()
br label %finished
finished:
ret i8 3
}