[llvm] [OptBisect] Add opt-bisect-skip option for skipping passes during bisection (PR #152393)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 10:57:46 PDT 2025


================
@@ -67,7 +68,13 @@ class LLVM_ABI OptBisect : public OptPassGate {
                      StringRef IRDescription) const override;
 
   /// isEnabled() should return true before calling shouldRunPass().
-  bool isEnabled() const override { return BisectLimit != Disabled; }
+  bool isEnabled() const override {
+    return BisectLimit != Disabled || !BisectSkipNumbers.empty();
----------------
Artem-B wrote:

It's looks very odd. 
Imagine a user sets bisect limit to disable all passes, and also passes an option to disable a few specific passes.

My mental model is that `BisectLimit == Disabled` should be functionally equivalent to `BisectSkipNumbers` containing complete set of passes, and when it's in effect `BisectSkipNumbers` should effectively become a no-op.

Right now we'll end up running the passes, despite the user asking for the *opposite*.


https://github.com/llvm/llvm-project/pull/152393


More information about the llvm-commits mailing list