[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-07-21 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 closed https://github.com/llvm/llvm-project/pull/92997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-26 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/92997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Maryam Moghadas via cfe-commits
maryammo wrote: > > So PPC64 can use ELFv2 for Triple::OpenBSD. We probably want to diagnose > > this OS for PPC64, since with ELFv2 we might emit separate local and global > > entry points which means only certain values can be passed to > > -fpatchable-function-entry option. > > For targets

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Maryam Moghadas via cfe-commits
maryammo wrote: > > So PPC64 can use ELFv2 for `Triple::OpenBSD`. We probably want to diagnose > > this OS for PPC64, since with ELFv2 we might emit separate local and global > > entry points which means only certain values can be passed to > > `-fpatchable-function-entry` option. > > This pa

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/92997 >From 7c1e44455a343cef3c5ab0da22c9971888cf Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 22 May 2024 02:37:04 -0400 Subject: [PATCH 1/3] [PowerPC] Support -fpatchable-function-entry For now only

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
@@ -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

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
@@ -6,15 +6,20 @@ // RUN: %clang -target loongarch64 %s -fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s // RUN: %clang -target riscv32 %s -fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s // RUN: %clang -target riscv64 %s -fpatchable-function-entry=1,0 -c

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
@@ -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(); chenzheng1030 wrote:

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/92997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
@@ -6681,7 +6681,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, StringRef S0 = A->getValue(), S = S0; unsigned Size, Offset = 0; if (!Triple.isAArch64() && !Triple.isLoongArch() && !Triple.isRISCV() && -!Triple.isX86()) +!Triple.

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,49 @@ +; RUN: llc -mtriple=powerpc-unknown-linux-gnu %s -o - | FileCheck %s --check-prefixes=CHECK,PPC32 chenzheng1030 wrote: Thank you, changed the triple. Little endian is not going to be supported in this patch. https://github.com/llvm/llvm-proje

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 commented: > So PPC64 can use ELFv2 for Triple::OpenBSD. We probably want to diagnose this > OS for PPC64, since with ELFv2 we might emit separate local and global entry > points which means only certain values can be passed to > -fpatchable-function-entry opti

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/92997 >From 751d80c61f0e42daa3796a8270e186153dd9413f Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 22 May 2024 02:37:04 -0400 Subject: [PATCH 1/3] [PowerPC] Support -fpatchable-function-entry For now only

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-23 Thread Fangrui Song via cfe-commits
MaskRay wrote: > So PPC64 can use ELFv2 for `Triple::OpenBSD`. We probably want to diagnose > this OS for PPC64, since with ELFv2 we might emit separate local and global > entry points which means only certain values can be passed to > `-fpatchable-function-entry` option. This patch matches t

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-23 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. https://github.com/llvm/llvm-project/pull/92997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-23 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,49 @@ +; RUN: llc -mtriple=powerpc-unknown-linux-gnu %s -o - | FileCheck %s --check-prefixes=CHECK,PPC32 MaskRay wrote: `-mtriple=powerpc`. Prefer a generic ELF triple to a Linux specific one. Suggest 2 RUN lines, `powerpc` and `powerpc64le`, to catc

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-23 Thread Fangrui Song via cfe-commits
@@ -6681,7 +6681,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, StringRef S0 = A->getValue(), S = S0; unsigned Size, Offset = 0; if (!Triple.isAArch64() && !Triple.isLoongArch() && !Triple.isRISCV() && -!Triple.isX86()) +!Triple.

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-23 Thread Fangrui Song via cfe-commits
@@ -6,15 +6,20 @@ // RUN: %clang -target loongarch64 %s -fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s // RUN: %clang -target riscv32 %s -fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s // RUN: %clang -target riscv64 %s -fpatchable-function-entry=1,0 -c

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-23 Thread Fangrui Song via cfe-commits
@@ -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

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-23 Thread Fangrui Song via cfe-commits
@@ -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(); MaskRay wrote: Some

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-23 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/92997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-23 Thread Maryam Moghadas via cfe-commits
maryammo wrote: In `PPCTargetMachine::PPCABI computeTargetABI` it specifies the ABI with this ``` switch (TT.getArch()) { case Triple::ppc64le: return PPCTargetMachine::PPC_ABI_ELFv2; case Triple::ppc64: if (TT.isPPC64ELFv2ABI()) return PPCTargetMachine::PPC_ABI_ELFv2; else return

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-22 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/92997 >From 751d80c61f0e42daa3796a8270e186153dd9413f Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 22 May 2024 02:37:04 -0400 Subject: [PATCH 1/2] [PowerPC] Support -fpatchable-function-entry For now only

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-22 Thread Chen Zheng via cfe-commits
@@ -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(); chenzheng1030 wrote:

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-22 Thread Nick Desaulniers via cfe-commits
@@ -909,6 +909,24 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) { // Lower multi-instruction pseudo operations. switch (MI->getOpcode()) { default: break; + case TargetOpcode::PATCHABLE_FUNCTION_ENTER: { +assert(!Subtarget->isAIXABI() && +

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-22 Thread Nick Desaulniers via cfe-commits
@@ -909,6 +909,24 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) { // Lower multi-instruction pseudo operations. switch (MI->getOpcode()) { default: break; + case TargetOpcode::PATCHABLE_FUNCTION_ENTER: { +assert(!Subtarget->isAIXABI() && +

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-22 Thread Nick Desaulniers via cfe-commits
@@ -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(); nickdesaulniers wrote

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Chen Zheng (chenzheng1030) Changes For now only PPC big endian Linux 32 and 64 bit are supported. PPC little endian Linux has XRAY support for 64-bit. PPC AIX has different patchable function entry implementations. Fixes #63220 Fix

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-powerpc Author: Chen Zheng (chenzheng1030) Changes For now only PPC big endian Linux 32 and 64 bit are supported. PPC little endian Linux has XRAY support for 64-bit. PPC AIX has different patchable function entry implementations. Fixes #63220

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-21 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 created https://github.com/llvm/llvm-project/pull/92997 For now only PPC big endian Linux 32 and 64 bit are supported. PPC little endian Linux has XRAY support for 64-bit. PPC AIX has different patchable function entry implementations. Fixes #63220 Fixes #57031