File: patchable-function-entry.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (58 lines) | stat: -rw-r--r-- 1,569 bytes parent folder | download | duplicates (7)
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
; RUN: llc -mtriple=powerpc %s -o - | FileCheck %s --check-prefixes=CHECK,PPC32
; RUN: llc -mtriple=powerpc64 %s -o - | FileCheck %s --check-prefixes=CHECK,PPC64

@a = global i32 0, align 4

define void @f0() {
; CHECK-LABEL: f0:
; CHECK-NOT:   nop
; CHECK:       # %bb.0:
; CHECK-NEXT:    blr
; CHECK-NOT:   .section    __patchable_function_entries
  ret void
}

define void @f1() "patchable-function-entry"="0" {
; CHECK-LABEL: f1:
; CHECK-NOT:   nop
; CHECK:       # %bb.0:
; CHECK-NEXT:    blr
; CHECK-NOT:   .section    __patchable_function_entries
  ret void
}

define void @f2() "patchable-function-entry"="1" {
; CHECK-LABEL: f2:
; CHECK-LABEL-NEXT:  .Lfunc_begin2:
; CHECK:       # %bb.0:
; CHECK-NEXT:    nop
; CHECK-NEXT:    blr
; CHECK:       .section    __patchable_function_entries
; PPC32:       .p2align    2, 0x0
; PPC64:       .p2align    3, 0x0
; PPC32-NEXT:  .long   .Lfunc_begin2
; PPC64-NEXT:  .quad   .Lfunc_begin2
  ret void
}

define i32 @f3() "patchable-function-entry"="1" "patchable-function-prefix"="2" {
; CHECK-LABEL: .Ltmp0:
; CHECK-COUNT-2: nop
; CHECK-LABEL: f3:
; CHECK:       # %bb.0:
; CHECK-NEXT:    nop
; PPC32:         lis 3, a@ha
; PPC32-NEXT:    lwz 3, a@l(3)
; PPC64:         addis 3, 2, .LC0@toc@ha
; PPC64-NEXT:    ld 3, .LC0@toc@l(3)
; PPC64-NEXT:    lwz 3, 0(3)
; CHECK:         blr
; CHECK:       .section    __patchable_function_entries
; PPC32:       .p2align    2, 0x0
; PPC64:       .p2align    3, 0x0
; PPC32-NEXT:  .long   .Ltmp0
; PPC64-NEXT:  .quad   .Ltmp0
entry:
  %0 = load i32, ptr @a, align 4
  ret i32 %0
}