summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ShrinkWrap.cpp
diff options
context:
space:
mode:
authorKit Barton <kbarton@ca.ibm.com>2015-08-14 16:54:32 +0000
committerKit Barton <kbarton@ca.ibm.com>2015-08-14 16:54:32 +0000
commitae78d53aebddf837e71ee6714d5d83901dadb72e (patch)
tree9353f39a19b281fef2d903e311634008d081c805 /llvm/lib/CodeGen/ShrinkWrap.cpp
parentd7a568fc4ff3553115ca0b33c90f36d925c92f97 (diff)
downloadbcm5719-llvm-ae78d53aebddf837e71ee6714d5d83901dadb72e.tar.gz
bcm5719-llvm-ae78d53aebddf837e71ee6714d5d83901dadb72e.zip
Reverting patch r244235.
This patch will be redone in a different way. See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/292978.html for more details. llvm-svn: 245071
Diffstat (limited to 'llvm/lib/CodeGen/ShrinkWrap.cpp')
-rw-r--r--llvm/lib/CodeGen/ShrinkWrap.cpp48
1 files changed, 1 insertions, 47 deletions
diff --git a/llvm/lib/CodeGen/ShrinkWrap.cpp b/llvm/lib/CodeGen/ShrinkWrap.cpp
index 43b39e934c4..8af859f6bc7 100644
--- a/llvm/lib/CodeGen/ShrinkWrap.cpp
+++ b/llvm/lib/CodeGen/ShrinkWrap.cpp
@@ -68,16 +68,11 @@
#include "llvm/Target/TargetInstrInfo.h"
// To access TargetInstrInfo.
#include "llvm/Target/TargetSubtargetInfo.h"
-#include "llvm/Support/CommandLine.h"
#define DEBUG_TYPE "shrink-wrap"
using namespace llvm;
-static cl::opt<cl::boolOrDefault>
- EnableShrinkWrapOpt("enable-shrink-wrap", cl::Hidden,
- cl::desc("enable the shrink-wrapping pass"));
-
STATISTIC(NumFunc, "Number of functions");
STATISTIC(NumCandidates, "Number of shrink-wrapping candidates");
STATISTIC(NumCandidatesDropped,
@@ -159,11 +154,6 @@ public:
ShrinkWrap() : MachineFunctionPass(ID) {
initializeShrinkWrapPass(*PassRegistry::getPassRegistry());
}
-
- ShrinkWrap(std::function<bool(const MachineFunction &)> Ftor) :
- MachineFunctionPass(ID), PredicateFtor(Ftor) {
- initializeShrinkWrapPass(*PassRegistry::getPassRegistry());
- }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
@@ -181,15 +171,6 @@ public:
/// \brief Perform the shrink-wrapping analysis and update
/// the MachineFrameInfo attached to \p MF with the results.
bool runOnMachineFunction(MachineFunction &MF) override;
-
-private:
- /// \brief Predicate function to determine if shrink wrapping should run.
- ///
- /// This function will be run at the beginning of shrink wrapping and
- /// determine whether shrink wrapping should run on the given MachineFunction.
- /// \arg MF The MachineFunction to run shrink wrapping on.
- /// It returns true if shrink wrapping should be run, false otherwise.
- std::function<bool(const MachineFunction &MF)> PredicateFtor;
};
} // End anonymous namespace.
@@ -338,12 +319,8 @@ void ShrinkWrap::updateSaveRestorePoints(MachineBasicBlock &MBB) {
}
bool ShrinkWrap::runOnMachineFunction(MachineFunction &MF) {
- if (PredicateFtor && !PredicateFtor(MF))
+ if (MF.empty())
return false;
-
- if (MF.empty() || skipOptnoneFunction(*MF.getFunction()))
- return false;
-
DEBUG(dbgs() << "**** Analysing " << MF.getName() << '\n');
init(MF);
@@ -427,26 +404,3 @@ bool ShrinkWrap::runOnMachineFunction(MachineFunction &MF) {
++NumCandidates;
return false;
}
-
-/// If EnableShrinkWrap is set run shrink wrapping on the given Machine
-/// Function. Otherwise, shrink wrapping is disabled.
-/// This function can be overridden in each target-specific TargetPassConfig
-/// class to allow different predicate logic for each target.
-bool TargetPassConfig::runShrinkWrap(const MachineFunction &Fn) const {
- switch (EnableShrinkWrapOpt) {
- case cl::BOU_TRUE:
- return true;
- case cl::BOU_UNSET:
- case cl::BOU_FALSE:
- return false;
- }
- llvm_unreachable("Invalid shrink-wrapping state");
-}
-
-/// Create a ShrinkWrap FunctionPass using the runShrinkWrap predicate
-/// function.
-FunctionPass *TargetPassConfig::createShrinkWrapPass() {
- std::function<bool(const MachineFunction &Fn)> Ftor =
- std::bind(&TargetPassConfig::runShrinkWrap, this, std::placeholders::_1);
- return new ShrinkWrap(Ftor);
-}
OpenPOWER on IntegriCloud