summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2017-01-15 10:23:18 +0000
committerSerge Pavlov <sepavloff@gmail.com>2017-01-15 10:23:18 +0000
commited5eb933840f85fd3db135cc6f8d7a847c7921e4 (patch)
treec41569156aae8f23348ae6bfa6401731484348a7 /llvm/lib/IR
parentbf56ad36cb79c1912bf8bf6725b634652d462dda (diff)
downloadbcm5719-llvm-ed5eb933840f85fd3db135cc6f8d7a847c7921e4.tar.gz
bcm5719-llvm-ed5eb933840f85fd3db135cc6f8d7a847c7921e4.zip
Reverted: Track validity of pass results
Commits r291882 and related r291887. llvm-svn: 292062
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/LegacyPassManager.cpp18
-rw-r--r--llvm/lib/IR/Pass.cpp7
2 files changed, 5 insertions, 20 deletions
diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp
index 0b2c40b742a..628a67bd639 100644
--- a/llvm/lib/IR/LegacyPassManager.cpp
+++ b/llvm/lib/IR/LegacyPassManager.cpp
@@ -955,9 +955,6 @@ void PMDataManager::freePass(Pass *P, StringRef Msg,
AvailableAnalysis.erase(Pos);
}
}
-
- if (!P->getAsImmutablePass())
- P->setExecuted(false);
}
/// Add pass P into the PassVector. Update
@@ -1296,7 +1293,6 @@ bool BBPassManager::runOnFunction(Function &F) {
PassManagerPrettyStackEntry X(BP, *I);
TimeRegion PassTimer(getPassTimer(BP));
- BP->setExecuted(true);
LocalChanged |= BP->runOnBasicBlock(*I);
}
@@ -1463,9 +1459,7 @@ bool FunctionPassManagerImpl::run(Function &F) {
initializeAllAnalysisInfo();
for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {
- FPPassManager *P = getContainedManager(Index);
- P->setExecuted(true);
- Changed |= P->runOnFunction(F);
+ Changed |= getContainedManager(Index)->runOnFunction(F);
F.getContext().yield();
}
@@ -1516,7 +1510,6 @@ bool FPPassManager::runOnFunction(Function &F) {
PassManagerPrettyStackEntry X(FP, F);
TimeRegion PassTimer(getPassTimer(FP));
- FP->setExecuted(true);
LocalChanged |= FP->runOnFunction(F);
}
@@ -1537,10 +1530,8 @@ bool FPPassManager::runOnFunction(Function &F) {
bool FPPassManager::runOnModule(Module &M) {
bool Changed = false;
- for (Function &F : M) {
- setExecuted(true);
+ for (Function &F : M)
Changed |= runOnFunction(F);
- }
return Changed;
}
@@ -1596,7 +1587,6 @@ MPPassManager::runOnModule(Module &M) {
PassManagerPrettyStackEntry X(MP, M);
TimeRegion PassTimer(getPassTimer(MP));
- MP->setExecuted(true);
LocalChanged |= MP->runOnModule(M);
}
@@ -1700,9 +1690,7 @@ bool PassManagerImpl::run(Module &M) {
initializeAllAnalysisInfo();
for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {
- MPPassManager *P = getContainedManager(Index);
- P->setExecuted(true);
- Changed |= P->runOnModule(M);
+ Changed |= getContainedManager(Index)->runOnModule(M);
M.getContext().yield();
}
diff --git a/llvm/lib/IR/Pass.cpp b/llvm/lib/IR/Pass.cpp
index 6e22c1d4641..a42945ef3ff 100644
--- a/llvm/lib/IR/Pass.cpp
+++ b/llvm/lib/IR/Pass.cpp
@@ -146,16 +146,13 @@ PassManagerType FunctionPass::getPotentialPassManagerType() const {
return PMT_FunctionPassManager;
}
-bool FunctionPass::skipFunction(const Function &F) {
- if (!F.getContext().getOptBisect().shouldRunPass(this, F)) {
- setExecuted(false);
+bool FunctionPass::skipFunction(const Function &F) const {
+ if (!F.getContext().getOptBisect().shouldRunPass(this, F))
return true;
- }
if (F.hasFnAttribute(Attribute::OptimizeNone)) {
DEBUG(dbgs() << "Skipping pass '" << getPassName() << "' on function "
<< F.getName() << "\n");
- setExecuted(false);
return true;
}
return false;
OpenPOWER on IntegriCloud