[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
Mon Sep 14 20:25:11 PDT 2020


MaskRay added inline comments.


================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:518
 
+  if (CodeGenOpts.SplitMachineFunctions) {
+    if (CodeGenOpts.getProfileUse() != CodeGenOptions::ProfileNone)
----------------
I did not pay attention. Such compatibility checks should be added in lib/Driver, instead of lib/CodeGen. 


================
Comment at: clang/test/Driver/fsplit-machine-functions.c:3
+// 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 -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 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
----------------
MaskRay wrote:
> snehasish wrote:
> > MaskRay wrote:
> > > There are two -c on this line.
> > > 
> > > Testing warnings can use `-###` as well.
> > Removed the extra -c. 
> > The warning is emitted when CreateTargetMachine (and its children) are called. So using `-###` instead of `-c` for the CHECK-WARN test is not sufficient as far as I can tell.
> If you make a compile action, this may need x86-registered-target.
I did not pay attention. If you added checks to lib/Driver,  x86-registered-target would not be needed and you could use `-###`


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