diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-06-03 15:20:36 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-06-03 15:20:36 +0000 |
| commit | d288ef4c1788d3a951a7558c68312c2d320612b1 (patch) | |
| tree | ece909a5200f95f85f0813599a9500620f4d9217 /lib/Analysis/RegionPass.cpp | |
| parent | f382538d471e38a9b98f016c4caebd24c8d60b62 (diff) | |
Notes
Diffstat (limited to 'lib/Analysis/RegionPass.cpp')
| -rw-r--r-- | lib/Analysis/RegionPass.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Analysis/RegionPass.cpp b/lib/Analysis/RegionPass.cpp index 82107cb18025..b38e6225c840 100644 --- a/lib/Analysis/RegionPass.cpp +++ b/lib/Analysis/RegionPass.cpp @@ -15,6 +15,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/RegionPass.h" #include "llvm/Analysis/RegionIterator.h" +#include "llvm/IR/OptBisect.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Timer.h" #include "llvm/Support/raw_ostream.h" @@ -280,3 +281,18 @@ Pass *RegionPass::createPrinterPass(raw_ostream &O, const std::string &Banner) const { return new PrintRegionPass(Banner, O); } + +bool RegionPass::skipRegion(Region &R) const { + Function &F = *R.getEntry()->getParent(); + if (!F.getContext().getOptBisect().shouldRunPass(this, R)) + return true; + + if (F.hasFnAttribute(Attribute::OptimizeNone)) { + // Report this only once per function. + if (R.getEntry() == &F.getEntryBlock()) + DEBUG(dbgs() << "Skipping pass '" << getPassName() + << "' on function " << F.getName() << "\n"); + return true; + } + return false; +} |
