diff options
author | Jessica Paquette <jpaquette@apple.com> | 2018-06-28 16:39:42 +0000 |
---|---|---|
committer | Jessica Paquette <jpaquette@apple.com> | 2018-06-28 16:39:42 +0000 |
commit | 1ccb66c5fb6f61fee8ea9dfcc99cca828c587bdb (patch) | |
tree | ab55fa10578c23d87aa875c56166e6aa3245c6ac /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | 2103990e63a31e53a32434231b4faf4a00b6469b (diff) | |
download | bcm5719-llvm-1ccb66c5fb6f61fee8ea9dfcc99cca828c587bdb.tar.gz bcm5719-llvm-1ccb66c5fb6f61fee8ea9dfcc99cca828c587bdb.zip |
[MachineOutliner] Add always and never options to -enable-machine-outliner
To enable the MachineOutliner by default on AArch64, we need to be able to
disable the MachineOutliner and also provide an option to "always" enable the
outliner.
This adds that capability. It allows the user to still use the old
-enable-machine-outliner option, which defaults to "always". This is building
up to allowing the user to specify "always" versus the target-default
outlining behaviour.
llvm-svn: 335872
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 8c5bdde888e..20771eef620 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -111,9 +111,17 @@ static cl::opt<bool> VerifyMachineCode("verify-machineinstrs", cl::Hidden, cl::desc("Verify generated machine code"), cl::init(false), cl::ZeroOrMore); -static cl::opt<bool> EnableMachineOutliner("enable-machine-outliner", - cl::Hidden, - cl::desc("Enable machine outliner")); +enum RunOutliner { AlwaysOutline, NeverOutline }; +// Enable or disable the MachineOutliner. +static cl::opt<RunOutliner> EnableMachineOutliner( + "enable-machine-outliner", cl::desc("Enable the machine outliner"), + cl::Hidden, cl::ValueOptional, cl::init(NeverOutline), + cl::values(clEnumValN(AlwaysOutline, "always", + "Run on all functions guaranteed to be beneficial " + "(pass -enable-linkonceodr-outlining for more)"), + clEnumValN(NeverOutline, "never", "Disable all outlining"), + // Sentinel value for unspecified option. + clEnumValN(AlwaysOutline, "", ""))); // Enable or disable FastISel. Both options are needed, because // FastISel is enabled by default with -fast, and we wish to be // able to enable or disable fast-isel independently from -O0. @@ -906,7 +914,7 @@ void TargetPassConfig::addMachinePasses() { addPass(&XRayInstrumentationID, false); addPass(&PatchableFunctionID, false); - if (EnableMachineOutliner) + if (EnableMachineOutliner == AlwaysOutline) addPass(createMachineOutlinerPass()); // Add passes that directly emit MI after all other MI passes. |