From f3a44fe8338abf1574bd43a2a501cf49866bbd0e Mon Sep 17 00:00:00 2001 From: Jessica Paquette Date: Thu, 28 Jun 2018 17:26:18 +0000 Subject: [PATCH] Revert "[MachineOutliner] Never add the outliner in -O0" This reverts commit 9c7c10e4073a0bc6a759ce5cd33afbac74930091. It relies on r335872 since that introduces the machine outliner flags test. I meant to commit D48683 in that commit, but got mixed up and committed D48682 instead. So, I'm reverting this and r335872, since D48682 hasn't made it through review yet. llvm-svn: 335882 --- llvm/lib/CodeGen/TargetPassConfig.cpp | 3 +-- llvm/test/CodeGen/AArch64/machine-outliner-flags.ll | 20 ++++---------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 74cd56b..20771ee 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -914,8 +914,7 @@ void TargetPassConfig::addMachinePasses() { addPass(&XRayInstrumentationID, false); addPass(&PatchableFunctionID, false); - if (getOptLevel() != CodeGenOpt::None && - EnableMachineOutliner == AlwaysOutline) + if (EnableMachineOutliner == AlwaysOutline) addPass(createMachineOutlinerPass()); // Add passes that directly emit MI after all other MI passes. diff --git a/llvm/test/CodeGen/AArch64/machine-outliner-flags.ll b/llvm/test/CodeGen/AArch64/machine-outliner-flags.ll index b3eec9b..0f232c8 100644 --- a/llvm/test/CodeGen/AArch64/machine-outliner-flags.ll +++ b/llvm/test/CodeGen/AArch64/machine-outliner-flags.ll @@ -14,27 +14,15 @@ ; RUN: -mtriple arm64---- -o /dev/null 2>&1 \ ; RUN: | FileCheck %s -check-prefix=NOT-ADDED -; RUN: llc %s -O=0 -debug-pass=Structure -verify-machineinstrs \ -; RUN: -mtriple arm64---- -o /dev/null 2>&1 \ -; RUN: | FileCheck %s -check-prefix=OPTNONE - -; Make sure that the outliner is added to the pass pipeline only when the -; appropriate flags/settings are set. Make sure it isn't added otherwise. -; -; Cases where it should be added: -; * -enable-machine-outliner -; * -enable-machine-outliner=always -; -; Cases where it should not be added: -; * -enable-machine-outliner=never -; * -O0 or equivalent -; * -enable-machine-outliner is not passed +; Make sure that the outliner flags all work properly. If we specify +; -enable-machine-outliner with always or no argument, it should be added to the +; pass pipeline. If we specify it with never, or don't pass the flag, +; then we shouldn't add it. ; ALWAYS: Machine Outliner ; ENABLE: Machine Outliner ; NEVER-NOT: Machine Outliner ; NOT-ADDED-NOT: Machine Outliner -; OPTNONE-NOT: Machine Outliner define void @foo() { ret void; -- 2.7.4