• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
8
9target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
10target triple = "x86_64-unknown-linux-gnu"
11
12; Function Attrs: nounwind readnone
13declare <4 x float> @llvm.x86.sse41.blendvps(<4 x float>, <4 x float>, <4 x float>) #0
14
15; Function Attrs: nounwind uwtable
16define <4 x float> @inlinedFunc(i1, <4 x float>, <4 x float>, <4 x float>) #1 {
17entry:
18  br i1 %0, label %if.then, label %return
19if.then:
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)
22  br label %return
23return:             ; preds = %entry
24  %retval = phi <4 x float> [ zeroinitializer, %entry ], [ %target.call, %if.then ]
25  ret <4 x float> %retval
26}
27
28; Function Attrs: nounwind uwtable
29define <4 x float> @dummyCaller(i1, <4 x float>, <4 x float>, <4 x float>) #1 {
30entry:
31  %val = call <4 x float> @inlinedFunc(i1 %0, <4 x float> %1, <4 x float> %2, <4 x float> %3)
32  ret <4 x float> %val
33}
34
35
36attributes #0 = { nounwind readnone }
37attributes #1 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+sse4.1" }
38
39; CHECK: define {{.*}} @inlinedFunc.1.if.then{{.*}} [[COUNT1:#[0-9]+]]
40; CHECK: [[COUNT1]] = { {{.*}} "target-cpu"="x86-64" "target-features"="+sse4.1" }
41