]> granicus.if.org Git - clang/commitdiff
Add a mno-outline flag to disable the MachineOutliner
authorJessica Paquette <jpaquette@apple.com>
Tue, 8 May 2018 20:58:32 +0000 (20:58 +0000)
committerJessica Paquette <jpaquette@apple.com>
Tue, 8 May 2018 20:58:32 +0000 (20:58 +0000)
Since we're working on turning the MachineOutliner by default under -Oz for
AArch64, it makes sense to have an -mno-outline flag available. This currently
doesn't do much (it basically just undoes -moutline).

When the MachineOutliner is on by default under AArch64, this flag should
set -mllvm -enable-machine-outliner=never.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331810 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.td
lib/Driver/ToolChains/Clang.cpp
test/Driver/aarch64-outliner.c

index eec6adc3e8e2b5066810b46fc485b8d54fb96d61..5f6fbccd4cff7cffb6454f185d3b682e32fb55c0 100644 (file)
@@ -1908,6 +1908,8 @@ def mms_bitfields : Flag<["-"], "mms-bitfields">, Group<m_Group>, Flags<[CC1Opti
   HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard">;
 def moutline : Flag<["-"], "moutline">, Group<f_clang_Group>, Flags<[CC1Option]>,
     HelpText<"Enable function outlining (AArch64 only)">;
+def mno_outline : Flag<["-"], "mno-outline">, Group<f_clang_Group>, Flags<[CC1Option]>,
+    HelpText<"Disable function outlining (AArch64 only)">;
 def mno_ms_bitfields : Flag<["-"], "mno-ms-bitfields">, Group<m_Group>,
   HelpText<"Do not set the default structure layout to be compatible with the Microsoft compiler standard">;
 def mstackrealign : Flag<["-"], "mstackrealign">, Group<m_Group>, Flags<[CC1Option]>,
index 762b5bdcdfb9d7141c4ef0b593cd591aa2db1198..c72c69d144991e20ba25e5899f46ea4c5c5ede01 100644 (file)
@@ -1485,7 +1485,8 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
       CmdArgs.push_back("-aarch64-enable-global-merge=true");
   }
 
-  if (Args.getLastArg(options::OPT_moutline)) {
+  if (!Args.hasArg(options::OPT_mno_outline) &&
+       Args.getLastArg(options::OPT_moutline)) {
     CmdArgs.push_back("-mllvm");
     CmdArgs.push_back("-enable-machine-outliner");
   }
index bd41e8dcaed9cf6c8f1ed881cc5890423f896439..94034566b353ba96f6eb05c3c8a0e68ba08a53be 100644 (file)
@@ -1,4 +1,9 @@
 // REQUIRES: aarch64-registered-target
 
-// RUN: %clang -target aarch64 -moutline -S %s -### 2>&1 | FileCheck %s
-// CHECK: "-mllvm" "-enable-machine-outliner"
+// RUN: %clang -target aarch64 -moutline -S %s -### 2>&1 | FileCheck %s -check-prefix=ON
+// ON: "-mllvm" "-enable-machine-outliner"
+
+// RUN: %clang -target aarch64 -moutline -mno-outline -S %s -### 2>&1 | FileCheck %s -check-prefix=OFF1
+// RUN: %clang -target aarch64 -mno-outline -moutline -S %s -### 2>&1 | FileCheck %s -check-prefix=OFF2
+// OFF1-NOT: "-mllvm" "-enable-machine-outliner"
+// OFF2-NOT: "-mllvm" "-enable-machine-outliner"