1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -debug-entry-values | FileCheck %s
4 ; Function Attrs: uwtable
5 ; When tail-duplicating during placement, we work backward from blocks with
6 ; multiple successors. In this case, the block dup1 gets duplicated into dup2
7 ; and if.then64, and then the block dup2 gets duplicated into land.lhs.true
10 define void @repeated_tail_dup(i1 %a1, i1 %a2, ptr %a4, ptr %a5, ptr %a6, i32 %a7) #0 align 2 {
11 ; CHECK-LABEL: repeated_tail_dup:
12 ; CHECK: # %bb.0: # %entry
13 ; CHECK-NEXT: jmp .LBB0_1
14 ; CHECK-NEXT: .p2align 4
15 ; CHECK-NEXT: .LBB0_2: # %land.lhs.true
16 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
17 ; CHECK-NEXT: movl $10, (%rdx)
18 ; CHECK-NEXT: .LBB0_6: # %dup2
19 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
20 ; CHECK-NEXT: movl $2, (%rcx)
21 ; CHECK-NEXT: testl %r9d, %r9d
22 ; CHECK-NEXT: jne .LBB0_8
23 ; CHECK-NEXT: .LBB0_1: # %for.cond
24 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
25 ; CHECK-NEXT: testb $1, %dil
26 ; CHECK-NEXT: jne .LBB0_2
27 ; CHECK-NEXT: # %bb.3: # %if.end56
28 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
29 ; CHECK-NEXT: testb $1, %sil
30 ; CHECK-NEXT: je .LBB0_5
31 ; CHECK-NEXT: # %bb.4: # %if.then64
32 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
33 ; CHECK-NEXT: movb $1, (%r8)
34 ; CHECK-NEXT: testl %r9d, %r9d
35 ; CHECK-NEXT: je .LBB0_1
36 ; CHECK-NEXT: jmp .LBB0_8
37 ; CHECK-NEXT: .p2align 4
38 ; CHECK-NEXT: .LBB0_5: # %if.end70
39 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
40 ; CHECK-NEXT: movl $12, (%rdx)
41 ; CHECK-NEXT: jmp .LBB0_6
42 ; CHECK-NEXT: .LBB0_8: # %for.end
47 for.cond: ; preds = %dup1, %entry
48 br i1 %a1, label %land.lhs.true, label %if.end56
50 land.lhs.true: ; preds = %for.cond
51 store i32 10, ptr %a4, align 8
54 if.end56: ; preds = %for.cond
55 br i1 %a2, label %if.then64, label %if.end70
57 if.then64: ; preds = %if.end56
58 store i8 1, ptr %a6, align 1
61 if.end70: ; preds = %if.end56
62 store i32 12, ptr %a4, align 8
65 dup2: ; preds = %if.end70, %land.lhs.true
66 store i32 2, ptr %a5, align 4
69 dup1: ; preds = %dup2, %if.then64
70 %val = load i32, ptr %a4, align 8
71 %switch = icmp ult i32 %a7, 1
72 br i1 %switch, label %for.cond, label %for.end
74 for.end: ; preds = %dup1
78 attributes #0 = { uwtable }