tail-dup-branch-to-fallthrough.ll
1.83 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
; RUN: llc -O2 %s -o - | FileCheck %s
target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64-unknown-linux-gnu"
; Function Attrs: nounwind
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #0
declare void @f1()
declare void @f2()
declare void @f3()
declare void @f4()
; Function Attrs: nounwind
; CHECK-LABEL: tail_dup_fallthrough_with_branch
; CHECK: # %bb.{{[0-9]+}}: # %entry
; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
; CHECK: # %bb.{{[0-9]+}}: # %entry
; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
; CHECK: # %bb.{{[0-9]+}}: # %sw.0
; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
; CHECK: # %sw.1
; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
; CHECK: # %sw.default
; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
; CHECK: # %bb.{{[0-9]+}}: # %if.then
; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
; CHECK: # %if.else
; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
; CHECK: .Lfunc_end0
define fastcc void @tail_dup_fallthrough_with_branch(i32 %a, i1 %b) unnamed_addr #0 {
entry:
switch i32 %a, label %sw.default [
i32 0, label %sw.0
i32 1, label %sw.1
]
sw.0: ; preds = %entry
call void @f1() #0
br label %dup1
sw.1: ; preds = %entry
call void @f2() #0
br label %dup1
sw.default: ; preds = %entry
br i1 %b, label %if.then, label %if.else
if.then: ; preds = %sw.default
call void @f3() #0
br label %dup2
if.else: ; preds = %sw.default
call void @f4() #0
br label %dup2
dup1: ; preds = %sw.0, %sw.1
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull undef) #0
unreachable
dup2: ; preds = %if.then, %if.else
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull undef) #0
unreachable
}
attributes #0 = { nounwind }