[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 10 22:19:27 PDT 2020
MaskRay added inline comments.
================
Comment at: clang/docs/ClangCommandLineReference.rst:2131
+.. option:: -fsplit-machine-functions, -fno-split-machine-functions
+
----------------
You don't need to edit this file. It is auto-generated from Options.td
================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4917
+ if (Triple.isX86() && Triple.isOSBinFormatELF())
+ A->render(Args, CmdArgs);
+ else
----------------
OPT_fno_split_machine_functions is a driver option but not a CC1 option. Rendering OPT_fno_split_machine_functions will error when processing CC1 options.
================
Comment at: clang/test/CodeGen/split-machine-functions.c:1
+// clang-format off
+// REQUIRES: x86-registered-target
----------------
You can ignore clang-format/clang-tidy issues in test/ and there is no need to annotate the tests (otherwise we will annotate essentially every file)
================
Comment at: clang/test/CodeGen/split-machine-functions.c:5
+// RUN: llvm-profdata merge -o %t/default.profdata %t/proftext
+// RUN: %clang_cc1 -triple x86_64 -O3 -S -fprofile-instrument-use-path=%t/default.profdata -fsplit-machine-functions -o - < %t/code | FileCheck %s
+
----------------
See https://reviews.llvm.org/D85408#2266559
It feels wrong that the assembly+llvm-profdata test is in clang/test
================
Comment at: clang/test/Driver/fsplit-machine-functions.c:1
+// RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
+// RUN: %clang -### -target x86_64 -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-NOOPT %s
----------------
Add `-fprofile-use` to the canonical usage line
================
Comment at: clang/test/Driver/fsplit-machine-functions.c:3
+// RUN: %clang -### -target x86_64 -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-NOOPT %s
+// RUN: %clang -c -target x86_64 -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-WARN %s
+// RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
----------------
Two -c?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87047/new/
https://reviews.llvm.org/D87047
More information about the cfe-commits
mailing list