[RegionPass] Fix forgotten "!".
authorMichael Kruse <llvm@meinersbur.de>
Fri, 8 Mar 2019 21:03:06 +0000 (21:03 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Fri, 8 Mar 2019 21:03:06 +0000 (21:03 +0000)
Commit r355068 "Fix IR/Analysis layering issue with OptBisect" uses the
template

   return Gate.isEnabled() && !Gate.shouldRunPass(this, getDescription(...));

for all pass kinds. For the RegionPass, it left out the not operator,
causing region passes to be skipped as soon as a pass gate is used.

llvm-svn: 355733

llvm/lib/Analysis/RegionPass.cpp

index 901adbf..f2bb104 100644 (file)
@@ -285,7 +285,7 @@ static std::string getDescription(const Region &R) {
 bool RegionPass::skipRegion(Region &R) const {
   Function &F = *R.getEntry()->getParent();
   OptPassGate &Gate = F.getContext().getOptPassGate();
-  if (Gate.isEnabled() && Gate.shouldRunPass(this, getDescription(R)))
+  if (Gate.isEnabled() && !Gate.shouldRunPass(this, getDescription(R)))
     return true;
 
   if (F.hasFnAttribute(Attribute::OptimizeNone)) {