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

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 18 13:08:36 PDT 2023


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



More information about the cfe-commits mailing list