1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | 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, i32* %a4, i32* %a5, i8* %a6, i32 %a7) #0 align 2 {
11 ; CHECK-LABEL: repeated_tail_dup:
12 ; CHECK: # %bb.0: # %entry
13 ; CHECK-NEXT: testb $1, %dil
14 ; CHECK-NEXT: je .LBB0_3
15 ; CHECK-NEXT: .p2align 4, 0x90
16 ; CHECK-NEXT: .LBB0_2: # %land.lhs.true
17 ; CHECK-NEXT: movl $10, (%rdx)
18 ; CHECK-NEXT: .LBB0_6: # %dup2
19 ; CHECK-NEXT: movl $2, (%rcx)
20 ; CHECK-NEXT: testl %r9d, %r9d
21 ; CHECK-NEXT: jne .LBB0_8
22 ; CHECK-NEXT: .LBB0_1: # %for.cond
23 ; CHECK-NEXT: testb $1, %dil
24 ; CHECK-NEXT: jne .LBB0_2
25 ; CHECK-NEXT: .LBB0_3: # %if.end56
26 ; CHECK-NEXT: testb $1, %sil
27 ; CHECK-NEXT: je .LBB0_5
28 ; CHECK-NEXT: # %bb.4: # %if.then64
29 ; CHECK-NEXT: movb $1, (%r8)
30 ; CHECK-NEXT: testl %r9d, %r9d
31 ; CHECK-NEXT: je .LBB0_1
32 ; CHECK-NEXT: jmp .LBB0_8
33 ; CHECK-NEXT: .p2align 4, 0x90
34 ; CHECK-NEXT: .LBB0_5: # %if.end70
35 ; CHECK-NEXT: movl $12, (%rdx)
36 ; CHECK-NEXT: jmp .LBB0_6
37 ; CHECK-NEXT: .LBB0_8: # %for.end
42 for.cond: ; preds = %dup1, %entry
43 br i1 %a1, label %land.lhs.true, label %if.end56
45 land.lhs.true: ; preds = %for.cond
46 store i32 10, i32* %a4, align 8
49 if.end56: ; preds = %for.cond
50 br i1 %a2, label %if.then64, label %if.end70
52 if.then64: ; preds = %if.end56
53 store i8 1, i8* %a6, align 1
56 if.end70: ; preds = %if.end56
57 store i32 12, i32* %a4, align 8
60 dup2: ; preds = %if.end70, %land.lhs.true
61 store i32 2, i32* %a5, align 4
64 dup1: ; preds = %dup2, %if.then64
65 %val = load i32, i32* %a4, align 8
66 %switch = icmp ult i32 %a7, 1
67 br i1 %switch, label %for.cond, label %for.end
69 for.end: ; preds = %dup1
73 attributes #0 = { uwtable }