48 lines · plain
1; The code in this test is very similar to vector-bonus.ll except for2; the fact that the call to bar is cold thereby preventing the application of3; the vector bonus.4; RUN: opt < %s -passes=inline -inline-threshold=35 -S | FileCheck %s5; RUN: opt < %s -passes='cgscc(inline)' -inline-threshold=35 -S | FileCheck %s6 7define i32 @bar(<4 x i32> %v, i32 %i) #0 {8entry:9 %cmp = icmp sgt i32 %i, 410 br i1 %cmp, label %if.then, label %if.else11 12if.then: ; preds = %entry13 %mul1 = mul nsw i32 %i, %i14 br label %return15 16if.else: ; preds = %entry17 %add1 = add nsw i32 %i, %i18 %add2 = add nsw i32 %i, %i19 %add3 = add nsw i32 %i, %i20 %add4 = add nsw i32 %i, %i21 %add5 = add nsw i32 %i, %i22 %add6 = add nsw i32 %i, %i23 %vecext = extractelement <4 x i32> %v, i32 024 %vecext7 = extractelement <4 x i32> %v, i32 125 %add7 = add nsw i32 %vecext, %vecext726 br label %return27 28return: ; preds = %if.else, %if.then29 %retval.0 = phi i32 [ %mul1, %if.then ], [ %add7, %if.else ]30 ret i32 %retval.031}32 33define i32 @foo(<4 x i32> %v, i32 %a) #1 {34; CHECK-LABEL: @foo(35; CHECK-NOT: call i32 @bar36; CHECK: ret37entry:38 %cmp = icmp eq i32 %a, 039 br i1 %cmp, label %callbb, label %ret40callbb:41 %call = call i32 @bar(<4 x i32> %v, i32 %a)42 br label %ret43ret:44 %call1 = phi i32 [%call, %callbb], [0, %entry]45 ret i32 %call146}47 48