[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-09-06 Thread Daniel Hoekwater via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG776e3b052738: [clang] Add clang support for Machine Function 
Splitting on AArch64 (authored by dhoekwater).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/fsplit-machine-functions.c


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5878,8 +5878,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5878,8 +5878,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-28 Thread Daniel Hoekwater via Phabricator via cfe-commits
dhoekwater updated this revision to Diff 554100.
dhoekwater edited the summary of this revision.
dhoekwater added a comment.

Remove the dependency again


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/fsplit-machine-functions.c


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5872,8 +5872,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5872,8 +5872,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-28 Thread Daniel Hoekwater via Phabricator via cfe-commits
dhoekwater updated this revision to Diff 554099.
dhoekwater edited the summary of this revision.
dhoekwater added a comment.

Add the old dependency to hopefully get the change to propagate when I remove it


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/fsplit-machine-functions.c


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5872,8 +5872,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5872,8 +5872,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-28 Thread Daniel Hoekwater via Phabricator via cfe-commits
dhoekwater updated this revision to Diff 554098.
dhoekwater edited the summary of this revision.
dhoekwater added a comment.

Remove a dependency to see if that fixes things.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/fsplit-machine-functions.c


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5872,8 +5872,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5872,8 +5872,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-28 Thread Daniel Hoekwater via Phabricator via cfe-commits
dhoekwater updated this revision to Diff 554094.
dhoekwater added a comment.

Hopefully get rid of a dead dependency


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/fsplit-machine-functions.c


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5872,8 +5872,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5872,8 +5872,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-28 Thread Daniel Hoekwater via Phabricator via cfe-commits
dhoekwater updated this revision to Diff 554082.
dhoekwater added a comment.

Rebase onto main


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/fsplit-machine-functions.c


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5872,8 +5872,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,4 +1,5 @@
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG
 // RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=NEG %s
 
 // CHECK:  "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5872,8 +5872,8 @@
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
 if (!A->getOption().matches(options::OPT_fno_split_machine_functions)) {
-  // This codegen pass is only available on x86-elf targets.
-  if (Triple.isX86() && Triple.isOSBinFormatELF())
+  // This codegen pass is only available on x86 and AArch64 ELF targets.
+  if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
 A->render(Args, CmdArgs);
   else
 D.Diag(diag::err_drv_unsupported_opt_for_target)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-28 Thread Daniel Hoekwater via Phabricator via cfe-commits
dhoekwater added inline comments.



Comment at: clang/lib/Driver/ToolChains/Clang.cpp:5852
options::OPT_fno_split_machine_functions)) {
-// This codegen pass is only available on x86-elf targets.
-if (Triple.isX86() && Triple.isOSBinFormatELF()) {
+// This codegen pass is only available on x86 and Arm ELF targets.
+if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {

MaskRay wrote:
> AArch64.
> 
> Arm can mean AArch32 (often written as "ARM").
Nice catch, fixed.



Comment at: clang/test/Driver/fsplit-machine-functions.c:4
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-NOOPT %s
+// RUN: %clang -### -target aarch64-unknown-linux 
-fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-AARCH64 %s
 // RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 
2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s

MaskRay wrote:
> mingmingl wrote:
> > nit: would `-target aarch64` be sufficient here? if yes it's more general.
> Use `--target=` for new tests. `--target=aarch64` is sufficient and preferred 
> for generic ELF features.
Thanks for the feedback! Fixed.



Comment at: clang/test/Driver/fsplit-machine-functions.c:9
 // CHECK-NOOPT-NOT: "-fsplit-machine-functions"
+// CHECK-AARCH64:   "-fsplit-machine-functions"
 // CHECK-TRIPLE:error: unsupported option '-fsplit-machine-functions' for 
target

MaskRay wrote:
> Just reuse CHECK-OPT
Fixed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-28 Thread Daniel Hoekwater via Phabricator via cfe-commits
dhoekwater updated this revision to Diff 554070.
dhoekwater marked 4 inline comments as done.
dhoekwater edited the summary of this revision.
dhoekwater added a comment.

Make a comment more accurate and simplify test command functions


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/fsplit-machine-functions.c


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,6 +1,7 @@
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c 2>&1 | 
FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-NOOPT %s
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 
2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
 
 // CHECK-OPT:   "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5849,8 +5849,8 @@
 
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
-// This codegen pass is only available on x86-elf targets.
-if (Triple.isX86() && Triple.isOSBinFormatELF()) {
+// This codegen pass is only available on x86 and AArch64 ELF targets.
+if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {
   if (A->getOption().matches(options::OPT_fsplit_machine_functions))
 A->render(Args, CmdArgs);
 } else {


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,6 +1,7 @@
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-NOOPT %s
+// RUN: %clang -### --target=aarch64 -fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
 
 // CHECK-OPT:   "-fsplit-machine-functions"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5849,8 +5849,8 @@
 
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
-// This codegen pass is only available on x86-elf targets.
-if (Triple.isX86() && Triple.isOSBinFormatELF()) {
+// This codegen pass is only available on x86 and AArch64 ELF targets.
+if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {
   if (A->getOption().matches(options::OPT_fsplit_machine_functions))
 A->render(Args, CmdArgs);
 } else {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-18 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments.



Comment at: clang/lib/Driver/ToolChains/Clang.cpp:5852
options::OPT_fno_split_machine_functions)) {
-// This codegen pass is only available on x86-elf targets.
-if (Triple.isX86() && Triple.isOSBinFormatELF()) {
+// This codegen pass is only available on x86 and Arm ELF targets.
+if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {

AArch64.

Arm can mean AArch32 (often written as "ARM").



Comment at: clang/test/Driver/fsplit-machine-functions.c:4
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-NOOPT %s
+// RUN: %clang -### -target aarch64-unknown-linux 
-fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-AARCH64 %s
 // RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 
2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s

mingmingl wrote:
> nit: would `-target aarch64` be sufficient here? if yes it's more general.
Use `--target=` for new tests. `--target=aarch64` is sufficient and preferred 
for generic ELF features.



Comment at: clang/test/Driver/fsplit-machine-functions.c:9
 // CHECK-NOOPT-NOT: "-fsplit-machine-functions"
+// CHECK-AARCH64:   "-fsplit-machine-functions"
 // CHECK-TRIPLE:error: unsupported option '-fsplit-machine-functions' for 
target

Just reuse CHECK-OPT


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-18 Thread Mingming Liu via Phabricator via cfe-commits
mingmingl accepted this revision.
mingmingl added inline comments.
This revision is now accepted and ready to land.



Comment at: clang/test/Driver/fsplit-machine-functions.c:4
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-NOOPT %s
+// RUN: %clang -### -target aarch64-unknown-linux 
-fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-AARCH64 %s
 // RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 
2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s

nit: would `-target aarch64` be sufficient here? if yes it's more general.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-07 Thread Daniel Hoekwater via Phabricator via cfe-commits
dhoekwater updated this revision to Diff 547884.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157157/new/

https://reviews.llvm.org/D157157

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/fsplit-machine-functions.c


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,8 +1,10 @@
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c 2>&1 | 
FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-NOOPT %s
+// RUN: %clang -### -target aarch64-unknown-linux 
-fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-AARCH64 %s
 // RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 
2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
 
 // CHECK-OPT:   "-fsplit-machine-functions"
 // CHECK-NOOPT-NOT: "-fsplit-machine-functions"
+// CHECK-AARCH64:   "-fsplit-machine-functions"
 // CHECK-TRIPLE:error: unsupported option '-fsplit-machine-functions' for 
target
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5849,8 +5849,8 @@
 
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
-// This codegen pass is only available on x86-elf targets.
-if (Triple.isX86() && Triple.isOSBinFormatELF()) {
+// This codegen pass is only available on x86 and Arm ELF targets.
+if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {
   if (A->getOption().matches(options::OPT_fsplit_machine_functions))
 A->render(Args, CmdArgs);
 } else {


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,8 +1,10 @@
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-NOOPT %s
+// RUN: %clang -### -target aarch64-unknown-linux -fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-AARCH64 %s
 // RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
 
 // CHECK-OPT:   "-fsplit-machine-functions"
 // CHECK-NOOPT-NOT: "-fsplit-machine-functions"
+// CHECK-AARCH64:   "-fsplit-machine-functions"
 // CHECK-TRIPLE:error: unsupported option '-fsplit-machine-functions' for target
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5849,8 +5849,8 @@
 
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
-// This codegen pass is only available on x86-elf targets.
-if (Triple.isX86() && Triple.isOSBinFormatELF()) {
+// This codegen pass is only available on x86 and Arm ELF targets.
+if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {
   if (A->getOption().matches(options::OPT_fsplit_machine_functions))
 A->render(Args, CmdArgs);
 } else {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157157: [clang] Add clang support for Machine Function Splitting on AArch64

2023-08-04 Thread Daniel Hoekwater via Phabricator via cfe-commits
dhoekwater created this revision.
dhoekwater added reviewers: shenhan, xur, snehasish, wenlei, mingmingl.
Herald added subscribers: pengfei, kristof.beyls.
Herald added a project: All.
dhoekwater requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

On x86 targets, -fsplit-machine-functions enables splitting of machine
functions using profile information. This patch rolls out the flag for
AArch64 targets.

Depends on D157124  and D157127 



Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157157

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/fsplit-machine-functions.c


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,8 +1,10 @@
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c 2>&1 | 
FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata 
-fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-NOOPT %s
+// RUN: %clang -### -target aarch64-unknown-linux 
-fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck 
-check-prefix=CHECK-AARCH64 %s
 // RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 
2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
 
 // CHECK-OPT:   "-fsplit-machine-functions"
 // CHECK-NOOPT-NOT: "-fsplit-machine-functions"
+// CHECK-AARCH64:   "-fsplit-machine-functions"
 // CHECK-TRIPLE:error: unsupported option '-fsplit-machine-functions' for 
target
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5859,8 +5859,8 @@
 
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
-// This codegen pass is only available on x86-elf targets.
-if (Triple.isX86() && Triple.isOSBinFormatELF()) {
+// This codegen pass is only available on x86 and Arm ELF targets.
+if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {
   if (A->getOption().matches(options::OPT_fsplit_machine_functions))
 A->render(Args, CmdArgs);
 } else {


Index: clang/test/Driver/fsplit-machine-functions.c
===
--- clang/test/Driver/fsplit-machine-functions.c
+++ clang/test/Driver/fsplit-machine-functions.c
@@ -1,8 +1,10 @@
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
 // RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-NOOPT %s
+// RUN: %clang -### -target aarch64-unknown-linux -fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-AARCH64 %s
 // RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
 
 // CHECK-OPT:   "-fsplit-machine-functions"
 // CHECK-NOOPT-NOT: "-fsplit-machine-functions"
+// CHECK-AARCH64:   "-fsplit-machine-functions"
 // CHECK-TRIPLE:error: unsupported option '-fsplit-machine-functions' for target
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5859,8 +5859,8 @@
 
   if (Arg *A = Args.getLastArg(options::OPT_fsplit_machine_functions,
options::OPT_fno_split_machine_functions)) {
-// This codegen pass is only available on x86-elf targets.
-if (Triple.isX86() && Triple.isOSBinFormatELF()) {
+// This codegen pass is only available on x86 and Arm ELF targets.
+if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {
   if (A->getOption().matches(options::OPT_fsplit_machine_functions))
 A->render(Args, CmdArgs);
 } else {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits