r331810 - Add a mno-outline flag to disable the MachineOutliner
Jessica Paquette via cfe-commits
cfe-commits at lists.llvm.org
Tue May 8 13:58:32 PDT 2018
Author: paquette
Date: Tue May 8 13:58:32 2018
New Revision: 331810
URL: http://llvm.org/viewvc/llvm-project?rev=331810&view=rev
Log:
Add a mno-outline flag to disable the MachineOutliner
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.
Modified:
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/test/Driver/aarch64-outliner.c
Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=331810&r1=331809&r2=331810&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Tue May 8 13:58:32 2018
@@ -1908,6 +1908,8 @@ def mms_bitfields : Flag<["-"], "mms-bit
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]>,
Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=331810&r1=331809&r2=331810&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Tue May 8 13:58:32 2018
@@ -1485,7 +1485,8 @@ void Clang::AddAArch64TargetArgs(const A
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");
}
Modified: cfe/trunk/test/Driver/aarch64-outliner.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/aarch64-outliner.c?rev=331810&r1=331809&r2=331810&view=diff
==============================================================================
--- cfe/trunk/test/Driver/aarch64-outliner.c (original)
+++ cfe/trunk/test/Driver/aarch64-outliner.c Tue May 8 13:58:32 2018
@@ -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"
More information about the cfe-commits
mailing list