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