1 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -O3 | FileCheck %s
3 ; Function Attrs: uwtable
4 ; When tail-duplicating during placement, we work backward from blocks with
5 ; multiple successors. In this case, the block dup1 gets duplicated into dup2
6 ; and if.then64, and then the block dup2 only gets duplicated into land.lhs.true.
8 define void @partial_tail_dup(i1 %a1, i1 %a2, ptr %a4, ptr %a5, ptr %a6, i32 %a7) #0 align 2 !prof !1 {
9 ; CHECK-LABEL: partial_tail_dup:
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: .p2align 4, 0x90
12 ; CHECK-NEXT: .LBB0_1: # %for.cond
13 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
14 ; CHECK-NEXT: testb $1, %dil
15 ; CHECK-NEXT: je .LBB0_3
16 ; CHECK-NEXT: # %bb.2: # %land.lhs.true
17 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
18 ; CHECK-NEXT: movl $10, (%rdx)
19 ; CHECK-NEXT: movl $2, (%rcx)
20 ; CHECK-NEXT: testl %r9d, %r9d
21 ; CHECK-NEXT: je .LBB0_1
22 ; CHECK-NEXT: jmp .LBB0_8
23 ; CHECK-NEXT: .p2align 4, 0x90
24 ; CHECK-NEXT: .LBB0_6: # %dup2
25 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
26 ; CHECK-NEXT: movl $2, (%rcx)
27 ; CHECK-NEXT: testl %r9d, %r9d
28 ; CHECK-NEXT: je .LBB0_1
29 ; CHECK-NEXT: jmp .LBB0_8
30 ; CHECK-NEXT: .p2align 4, 0x90
31 ; CHECK-NEXT: .LBB0_3: # %if.end56
32 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
33 ; CHECK-NEXT: testb $1, %sil
34 ; CHECK-NEXT: je .LBB0_5
35 ; CHECK-NEXT: # %bb.4: # %if.then64
36 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
37 ; CHECK-NEXT: movb $1, (%r8)
38 ; CHECK-NEXT: testl %r9d, %r9d
39 ; CHECK-NEXT: je .LBB0_1
40 ; CHECK-NEXT: jmp .LBB0_8
41 ; CHECK-NEXT: .LBB0_5: # %if.end70
42 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
43 ; CHECK-NEXT: movl $12, (%rdx)
44 ; CHECK-NEXT: jne .LBB0_6
45 ; CHECK-NEXT: .LBB0_8: # %for.end
51 br i1 %a1, label %land.lhs.true, label %if.end56
54 store i32 10, ptr %a4, align 8
58 br i1 %a2, label %if.then64, label %if.end70, !prof !2
61 store i8 1, ptr %a6, align 1
65 store i32 12, ptr %a4, align 8
66 br i1 %a2, label %dup2, label %for.end
69 store i32 2, ptr %a5, align 4
73 %val = load i32, ptr %a4, align 8
74 %switch = icmp ult i32 %a7, 1
75 br i1 %switch, label %for.cond, label %for.end, !prof !3
81 attributes #0 = { uwtable }
83 !1 = !{!"function_entry_count", i64 2}
84 !2 = !{!"branch_weights", i32 5, i32 1}
85 !3 = !{!"branch_weights", i32 5, i32 1}