[llvm] [NewPM] Fix OptBisect Functionality for disabled gate (PR #225437)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 08:53:12 PDT 2026


https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/225437

We were never actually checking if the gate was enabled. This patch
fixes it to match the behavior of the LegacyPM.


>From bfd6645c581977ba2fd33e3ca528f43722333e07 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 22 Sep 2026 15:52:52 +0000
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.7
---
 llvm/lib/IR/PassManager.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/IR/PassManager.cpp b/llvm/lib/IR/PassManager.cpp
index dca3c0e8fbc9f8..8307906cc39a40 100644
--- a/llvm/lib/IR/PassManager.cpp
+++ b/llvm/lib/IR/PassManager.cpp
@@ -32,7 +32,8 @@ bool detail::shouldSkipOptimizationForOptBisect(IRUnitRef IR,
   } else {
     llvm_unreachable("Tried to check skipping for an invalid IR type");
   }
-  return Ctx->getOptPassGate().shouldRunPass(PassName, IRName);
+  const OptPassGate &Gate = Ctx->getOptPassGate();
+  return Gate.isEnabled() && !Gate.shouldRunPass(PassName, IRName);
 }
 
 // Explicit template instantiations and specialization defininitions for core



More information about the llvm-commits mailing list