From c9d675266e213ff9311e8b66160781135f0d6971 Mon Sep 17 00:00:00 2001 From: Jessica Paquette Date: Thu, 28 Jun 2018 17:05:57 +0000 Subject: [MachineOutliner] Never add the outliner in -O0 We shouldn't add the outliner when compiling at -O0 even if -enable-machine-outliner is passed in. This makes sure that we don't add it in this case. This also updates machine-outliner-flags to reflect the change and improves the comment describing what that test does. llvm-svn: 335879 --- llvm/lib/CodeGen/TargetPassConfig.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 20771eef620..74cd56b40a7 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -914,7 +914,8 @@ void TargetPassConfig::addMachinePasses() { addPass(&XRayInstrumentationID, false); addPass(&PatchableFunctionID, false); - if (EnableMachineOutliner == AlwaysOutline) + if (getOptLevel() != CodeGenOpt::None && + EnableMachineOutliner == AlwaysOutline) addPass(createMachineOutlinerPass()); // Add passes that directly emit MI after all other MI passes. -- cgit v1.2.3