From: Michael Kruse Date: Fri, 8 Mar 2019 21:03:06 +0000 (+0000) Subject: [RegionPass] Fix forgotten "!". X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=391dc8001fd6c08006f017a683325ac6d19f16c3;p=llvm [RegionPass] Fix forgotten "!". 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355733 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/RegionPass.cpp b/lib/Analysis/RegionPass.cpp index 901adbf27d9..f2bb1044abd 100644 --- a/lib/Analysis/RegionPass.cpp +++ b/lib/Analysis/RegionPass.cpp @@ -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)) {