aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Transforms/Inline/PowerPC/inline-target-attr.ll
blob: b7086199e6f7d2353d031456ae0561fb90e46bfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
; RUN: opt < %s -mtriple=powerpc64le-ibm-linux-gnu -S -passes=inline | FileCheck %s
; RUN: opt < %s -mtriple=powerpc64le-ibm-linux-gnu -S -passes='cgscc(inline)' | FileCheck %s

target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64le-ibm-linux-gnu"

declare void @inlined()

define void @explicit() #0 {
; CHECK-LABEL: explicit
; CHECK: entry
; CHECK-NEXT: call void @not_compatible1()
; CHECK-NEXT: call void @inlined()
entry:
    call void @not_compatible1()
    call void @compatible1()
    ret void
}

define void @not_compatible1() #1 {
entry:
    call i32 @inlined()
    ret void
}

define void @compatible1() #0 {
entry:
    call void @inlined()
    ret void 
}

define void @default() #3 {
; CHECK-LABEL: default
; CHECK: entry
; CHECK-NEXT: call void @not_compatible2()
; CHECK-NEXT: call void @inlined()
entry:
    call void @not_compatible2()
    call void @compatible2()
    ret void
}

define void @not_compatible2() #4 {
entry:
    call void @inlined()
    ret void
}

define void @compatible2() #5 {
entry:
    call void @inlined()
    ret void 
}

; explicit
attributes #0 = { "target-cpu"="pwr7" "target-features"="+allow-unaligned-fp-access" }
attributes #1 = { "target-cpu"="pwr7" "target-features"="-allow-unaligned-fp-access" }

; pwr7 by default implies +vsx
attributes #3 = { "target-cpu"="pwr7" }
attributes #4 = { "target-cpu"="pwr7" "target-features"="-vsx" }
attributes #5 = { "target-cpu"="pwr7" "target-features"="+vsx" }