1 ; RUN: opt < %s -partial-inliner -skip-partial-inlining-cost-analysis | llc -filetype=null
2 ; RUN: opt < %s -partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
3 ; This testcase checks to see if CodeExtractor properly inherits
4 ; target specific attributes for the extracted function. This can
5 ; cause certain instructions that depend on the attributes to not
6 ; be lowered. Like in this test where we try to 'select' the blendvps
7 ; intrinsic on x86 that requires the +sse4.1 target feature.
9 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
10 target triple = "x86_64-unknown-linux-gnu"
12 ; Function Attrs: nounwind readnone
13 declare <4 x float> @llvm.x86.sse41.blendvps(<4 x float>, <4 x float>, <4 x float>) #0
15 ; Function Attrs: nounwind uwtable
16 define <4 x float> @inlinedFunc(i1, <4 x float>, <4 x float>, <4 x float>) #1 {
18 br i1 %0, label %if.then, label %return
20 ; Target intrinsic that requires sse4.1
21 %target.call = call <4 x float> @llvm.x86.sse41.blendvps(<4 x float> %1, <4 x float> %2, <4 x float> %3)
23 return: ; preds = %entry
24 %retval = phi <4 x float> [ zeroinitializer, %entry ], [ %target.call, %if.then ]
25 ret <4 x float> %retval
28 ; Function Attrs: nounwind uwtable
29 define <4 x float> @dummyCaller(i1, <4 x float>, <4 x float>, <4 x float>) #1 {
31 %val = call <4 x float> @inlinedFunc(i1 %0, <4 x float> %1, <4 x float> %2, <4 x float> %3)
36 attributes #0 = { nounwind readnone }
37 attributes #1 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+sse4.1" }
39 ; CHECK: define {{.*}} @inlinedFunc.1.if.then{{.*}} [[COUNT1:#[0-9]+]]
40 ; CHECK: [[COUNT1]] = { {{.*}} "target-cpu"="x86-64" "target-features"="+sse4.1" }