• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3
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
8; and if.end70
9
10define 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:    jmp .LBB0_1
14; CHECK-NEXT:    .p2align 4, 0x90
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, 0x90
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
43; CHECK-NEXT:    retq
44entry:
45  br label %for.cond
46
47for.cond:                                         ; preds = %dup1, %entry
48  br i1 %a1, label %land.lhs.true, label %if.end56
49
50land.lhs.true:                                    ; preds = %for.cond
51  store i32 10, i32* %a4, align 8
52  br label %dup2
53
54if.end56:                                         ; preds = %for.cond
55  br i1 %a2, label %if.then64, label %if.end70
56
57if.then64:                                        ; preds = %if.end56
58  store i8 1, i8* %a6, align 1
59  br label %dup1
60
61if.end70:                                         ; preds = %if.end56
62  store i32 12, i32* %a4, align 8
63  br label %dup2
64
65dup2:                                             ; preds = %if.end70, %land.lhs.true
66  store i32 2, i32* %a5, align 4
67  br label %dup1
68
69dup1:                                             ; preds = %dup2, %if.then64
70  %val = load i32, i32* %a4, align 8
71  %switch = icmp ult i32 %a7, 1
72  br i1 %switch, label %for.cond, label %for.end
73
74for.end:                                          ; preds = %dup1
75  ret void
76}
77
78attributes #0 = { uwtable }
79