forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PowerPC] Support -fpatchable-function-entry
For now only PPC big endian Linux is supported. PPC little endian Linux has XRAY support for 64-bit. PPC AIX has different patchable function entry implementations. Fixes llvm#63220 Fixes llvm#57031
- Loading branch information
Chen Zheng
committed
May 22, 2024
1 parent
203232f
commit 7bbd096
Showing
10 changed files
with
96 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fsyntax-only -verify %s | ||
|
||
// expected-error@+1 {{'patchable_function_entry' attribute is not yet supported on AIX}} | ||
__attribute__((patchable_function_entry(0))) void f(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
; RUN: llc -mtriple=powerpc-unknown-linux-gnu %s -o - | FileCheck %s --check-prefixes=CHECK,PPC32 | ||
; RUN: llc -mtriple=powerpc64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefixes=CHECK,PPC64 | ||
|
||
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 void @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 | ||
; CHECK-NEXT: blr | ||
; CHECK: .section __patchable_function_entries | ||
; PPC32: .p2align 2, 0x0 | ||
; PPC64: .p2align 3, 0x0 | ||
; PPC32-NEXT: .long .Ltmp0 | ||
; PPC64-NEXT: .quad .Ltmp0 | ||
ret void | ||
} |