• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -inline -S | FileCheck %s
2; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s
3
4define internal i32 @callee1(i32 %A, i32 %B) {
5; CHECK-NOT: @callee1
6entry:
7  %cond = icmp eq i32 %A, 123
8  br i1 %cond, label %T, label %F
9
10T:
11  %C = mul i32 %B, %B
12  ret i32 %C
13
14F:
15  ret i32 0
16}
17
18define internal i32 @callee2(i32 %A, i32 %B) {
19; CHECK-NOT: @callee2
20entry:
21  switch i32 %A, label %T [
22           i32 10, label %F
23           i32 1234, label %G
24  ]
25
26dead:
27  %cond = icmp eq i32 %A, 123
28  br i1 %cond, label %T, label %F
29
30T:
31  %C = mul i32 %B, %B
32  ret i32 %C
33
34F:
35  ret i32 0
36
37G:
38  %D = mul i32 %B, %B
39  %E = mul i32 %D, %B
40  ret i32 %E
41}
42
43define i32 @test(i32 %A) {
44; CHECK-LABEL: define i32 @test(i32 %A)
45entry:
46  %X = call i32 @callee1( i32 10, i32 %A )
47  %Y = call i32 @callee2( i32 10, i32 %A )
48; CHECK-NOT: call
49; CHECK-NOT: mul
50
51  %Z = add i32 %X, %Y
52  ret i32 %Z
53}
54
55