1 ; The code in this test is very similar to vector-bonus.ll except for
2 ; the fact that the call to bar is cold thereby preventing the application of
4 ; RUN: opt < %s -inline -inline-threshold=35 -S | FileCheck %s
5 ; RUN: opt < %s -passes='cgscc(inline)' -inline-threshold=35 -S | FileCheck %s
7 define i32 @bar(<4 x i32> %v, i32 %i) #0 {
9 %cmp = icmp sgt i32 %i, 4
10 br i1 %cmp, label %if.then, label %if.else
12 if.then: ; preds = %entry
13 %mul1 = mul nsw i32 %i, %i
16 if.else: ; preds = %entry
17 %add1 = add nsw i32 %i, %i
18 %add2 = add nsw i32 %i, %i
19 %add3 = add nsw i32 %i, %i
20 %add4 = add nsw i32 %i, %i
21 %add5 = add nsw i32 %i, %i
22 %add6 = add nsw i32 %i, %i
23 %vecext = extractelement <4 x i32> %v, i32 0
24 %vecext7 = extractelement <4 x i32> %v, i32 1
25 %add7 = add nsw i32 %vecext, %vecext7
28 return: ; preds = %if.else, %if.then
29 %retval.0 = phi i32 [ %mul1, %if.then ], [ %add7, %if.else ]
33 define i32 @foo(<4 x i32> %v, i32 %a) #1 {
35 ; CHECK-NOT: call i32 @bar
38 %cmp = icmp eq i32 %a, 0
39 br i1 %cmp, label %callbb, label %ret
41 %call = call i32 @bar(<4 x i32> %v, i32 %a)
44 %call1 = phi i32 [%call, %callbb], [0, %entry]