summaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
diff options
context:
space:
mode:
authorMingming Liu <mingmingl@google.com>2025-09-10 15:25:31 -0700
committerGitHub <noreply@github.com>2025-09-10 15:25:31 -0700
commit1417dafa1db9cb1b2b09438aa9f53ea5ab6e36e2 (patch)
tree57f4b1f313c8cf74eed8819870f39c36ea263c68 /llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
parent898b813bc8a6d0276bf0f4769f5f2f64b34e632d (diff)
parentb8cefcb601ddaa18482555c4ff363c01a270c2fe (diff)
Merge branch 'main' into users/mingmingl-llvm/samplefdo-profile-formatusers/mingmingl-llvm/samplefdo-profile-format
Diffstat (limited to 'llvm/test/CodeGen/PowerPC/patchable-function-entry.ll')
-rw-r--r--llvm/test/CodeGen/PowerPC/patchable-function-entry.ll49
1 files changed, 49 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll b/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
index 0c2d2829a6d4..f5977543784f 100644
--- a/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
+++ b/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
@@ -1,5 +1,6 @@
; RUN: llc -mtriple=powerpc %s -o - | FileCheck %s --check-prefixes=CHECK,PPC32
; RUN: llc -mtriple=powerpc64 %s -o - | FileCheck %s --check-prefixes=CHECK,PPC64
+; RUN: llc -mtriple=powerpc64le %s -o - | FileCheck %s --check-prefix=PPC64LE
@a = global i32 0, align 4
@@ -9,6 +10,12 @@ define void @f0() {
; CHECK: # %bb.0:
; CHECK-NEXT: blr
; CHECK-NOT: .section __patchable_function_entries
+;
+; PPC64LE-LABEL: f0:
+; PPC64LE-NOT: nop
+; PPC64LE: # %bb.0:
+; PPC64LE-NEXT: blr
+; PPC64LE-NOT: .section __patchable_function_entries
ret void
}
@@ -18,6 +25,22 @@ define void @f1() "patchable-function-entry"="0" {
; CHECK: # %bb.0:
; CHECK-NEXT: blr
; CHECK-NOT: .section __patchable_function_entries
+;
+; PPC64LE-LABEL: f1:
+; PPC64LE: # %bb.0:
+; PPC64LE-NEXT: .Ltmp0:
+; PPC64LE-NEXT: b .Ltmp1
+; PPC64LE-NEXT: nop
+; PPC64LE-NEXT: std 0, -8(1)
+; PPC64LE-NEXT: mflr 0
+; PPC64LE-NEXT: bl __xray_FunctionEntry
+; PPC64LE-NEXT: nop
+; PPC64LE-NEXT: mtlr 0
+; PPC64LE-NEXT: .Ltmp1:
+; PPC64LE-NEXT: blr
+; PPC64LE-NOT: .section __patchable_function_entries
+; PPC64LE: .section xray_instr_map
+; PPC64LE: .section xray_fn_idx
ret void
}
@@ -32,6 +55,17 @@ define void @f2() "patchable-function-entry"="1" {
; PPC64: .p2align 3, 0x0
; PPC32-NEXT: .long .Lfunc_begin2
; PPC64-NEXT: .quad .Lfunc_begin2
+;
+; PPC64LE-LABEL: f2:
+; PPC64LE-LABEL-NEXT: .Lfunc_begin2:
+; PPC64LE: # %bb.0:
+; PPC64LE-NEXT: nop
+; PPC64LE-NEXT: blr
+; PPC64LE: .section __patchable_function_entries
+; PPC64LE: .p2align 3, 0x0
+; PPC64LE-NEXT: .quad .Lfunc_begin2
+; PPC64LE-NOT: .section xray_instr_map
+; PPC64LE-NOT: .section xray_fn_idx
ret void
}
@@ -52,6 +86,21 @@ define i32 @f3() "patchable-function-entry"="1" "patchable-function-prefix"="2"
; PPC64: .p2align 3, 0x0
; PPC32-NEXT: .long .Ltmp0
; PPC64-NEXT: .quad .Ltmp0
+;
+; PC64LE-LABEL: .Ltmp3:
+; PC64LE-COUNT-2: nop
+; PC64LE-LABEL: f3:
+; PC64LE: # %bb.0:
+; PC64LE-NEXT: nop
+; PC64LE: addis 3, 2, .LC0@toc@ha
+; PC64LE-NEXT: ld 3, .LC0@toc@l(3)
+; PC64LE-NEXT: lwz 3, 0(3)
+; PC64LE: blr
+; PC64LE: .section __patchable_function_entries
+; PPC64LE: .p2align 3, 0x0
+; PPC64LE-NEXT: .quad .Ltmp3
+; PC64LE-NOT: .section xray_instr_map
+; PC64LE-NOT: .section xray_fn_idx
entry:
%0 = load i32, ptr @a, align 4
ret i32 %0