Skip to content

[OptBisect][IR] Adding a new OptPassGate for disabling passes via name #145059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 16, 2025

Conversation

cristianassaiante
Copy link
Contributor

I would like to propose a new pass gate that allows selective disabling of one or more passes via the clang command line using the -opt-disable option. Passes to be disabled should be specified as a comma-separated list of their names.
The implementation resides in the same file as the bisection tool. The getGlobalPassGate() function returns the currently enabled gate.

Example: -opt-disable="PassA,PassB"

Pass names are matched using case-insensitive comparisons. However, note that special characters, including spaces, must be included exactly as they appear in the pass names.

Additionally, a -opt-disable-verbose flag has been introduced to enable verbose output when this functionality is in use. When enabled, it prints the status of all passes (either running or NOT running), similar to the default behavior of -opt-bisect-limit. This flag is disabled by default, which is the opposite of the -opt-bisect-verbose flag (which defaults to enabled).

To validate this add-on, a test file has also been provided. It reuses the same infrastructure as the opt-bisect test, but disables three specific passes and checks the output to ensure the expected behavior.

Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added clang Clang issues not falling into any other category llvm:ir labels Jun 20, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 20, 2025

@llvm/pr-subscribers-llvm-ir

Author: Cristian Assaiante (cristianassaiante)

Changes

I would like to propose a new pass gate that allows selective disabling of one or more passes via the clang command line using the -opt-disable option. Passes to be disabled should be specified as a comma-separated list of their names.
The implementation resides in the same file as the bisection tool. The getGlobalPassGate() function returns the currently enabled gate.

Example: -opt-disable="PassA,PassB"

Pass names are matched using case-insensitive comparisons. However, note that special characters, including spaces, must be included exactly as they appear in the pass names.

Additionally, a -opt-disable-verbose flag has been introduced to enable verbose output when this functionality is in use. When enabled, it prints the status of all passes (either running or NOT running), similar to the default behavior of -opt-bisect-limit. This flag is disabled by default, which is the opposite of the -opt-bisect-verbose flag (which defaults to enabled).

To validate this add-on, a test file has also been provided. It reuses the same infrastructure as the opt-bisect test, but disables three specific passes and checks the output to ensure the expected behavior.


Full diff: https://github.com/llvm/llvm-project/pull/145059.diff

3 Files Affected:

  • (added) clang/test/CodeGen/opt-disable.c (+13)
  • (modified) llvm/include/llvm/IR/OptBisect.h (+39)
  • (modified) llvm/lib/IR/OptBisect.cpp (+59-4)
diff --git a/clang/test/CodeGen/opt-disable.c b/clang/test/CodeGen/opt-disable.c
new file mode 100644
index 0000000000000..ee90fc5620d65
--- /dev/null
+++ b/clang/test/CodeGen/opt-disable.c
@@ -0,0 +1,13 @@
+// REQUIRES: x86-registered-target
+
+// Make sure opt-bisect works through both pass managers
+//
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -O1 %s -mllvm -opt-disable="inlinerpass,SROAPass,machine code sinking" -mllvm -opt-disable-verbose -emit-obj -o /dev/null 2>&1 | FileCheck %s
+
+// CHECK-NOT: DISABLE: running pass InlinerPass
+// CHECK-NOT: DISABLE: running pass SROAPass
+// CHECK-NOT: DISABLE: running pass Machine code sinking
+// Make sure that legacy pass manager is running
+// CHECK: Instruction Selection
+
+int func(int a) { return a; }
diff --git a/llvm/include/llvm/IR/OptBisect.h b/llvm/include/llvm/IR/OptBisect.h
index be6aef3298b23..51c3a8040da9b 100644
--- a/llvm/include/llvm/IR/OptBisect.h
+++ b/llvm/include/llvm/IR/OptBisect.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Compiler.h"
 #include <limits>
+#include <set>
 
 namespace llvm {
 
@@ -82,6 +83,44 @@ class LLVM_ABI OptBisect : public OptPassGate {
   int LastBisectNum = 0;
 };
 
+/// This class implements a mechanism to disable passes and individual
+/// optimizations at compile time based on a command line option
+/// (-opt-disable) in order to study how single transformations, or
+/// combinations thereof, affect the IR.
+class LLVM_ABI OptDisable : public OptPassGate {
+public:
+  /// Default constructor. Initializes the state to empty set. The disabling
+  /// will be enabled by the cl::opt call-back when the command line option
+  /// is processed.
+  /// Clients should not instantiate this class directly.  All access should go
+  /// through LLVMContext.
+  OptDisable() = default;
+
+  virtual ~OptDisable() = default;
+
+  /// Checks the pass name to determine if the specified pass should run.
+  ///
+  /// The method prints the name of the pass, and whether or not the pass
+  /// will be executed. It returns true if the pass should run, i.e. if
+  /// its name is was not provided via command line.
+  ///
+  /// Most passes should not call this routine directly. Instead, it is called
+  /// through helper routines provided by the base classes of the pass. For
+  /// instance, function passes should call FunctionPass::skipFunction().
+  bool shouldRunPass(const StringRef PassName,
+                     StringRef IRDescription) override;
+
+  /// Parses the command line argument to extract the names of the passes
+  /// to be disabled. Multiple pass names can be provided with comma separation.
+  void setDisabled(StringRef Passes);
+
+  /// isEnabled() should return true before calling shouldRunPass().
+  bool isEnabled() const override { return !DisabledPasses.empty(); }
+
+private:
+  std::set<std::string> DisabledPasses = {};
+};
+
 /// Singleton instance of the OptBisect class, so multiple pass managers don't
 /// need to coordinate their uses of OptBisect.
 LLVM_ABI OptPassGate &getGlobalPassGate();
diff --git a/llvm/lib/IR/OptBisect.cpp b/llvm/lib/IR/OptBisect.cpp
index 559b199445366..aa1dbdfdbebd4 100644
--- a/llvm/lib/IR/OptBisect.cpp
+++ b/llvm/lib/IR/OptBisect.cpp
@@ -17,6 +17,7 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cassert>
+#include <sstream>
 
 using namespace llvm;
 
@@ -37,8 +38,8 @@ static cl::opt<bool> OptBisectVerbose(
     cl::desc("Show verbose output when opt-bisect-limit is set"), cl::Hidden,
     cl::init(true), cl::Optional);
 
-static void printPassMessage(const StringRef &Name, int PassNum,
-                             StringRef TargetDesc, bool Running) {
+static void printBisectPassMessage(const StringRef &Name, int PassNum,
+                                   StringRef TargetDesc, bool Running) {
   StringRef Status = Running ? "" : "NOT ";
   errs() << "BISECT: " << Status << "running pass "
          << "(" << PassNum << ") " << Name << " on " << TargetDesc << "\n";
@@ -51,10 +52,64 @@ bool OptBisect::shouldRunPass(const StringRef PassName,
   int CurBisectNum = ++LastBisectNum;
   bool ShouldRun = (BisectLimit == -1 || CurBisectNum <= BisectLimit);
   if (OptBisectVerbose)
-    printPassMessage(PassName, CurBisectNum, IRDescription, ShouldRun);
+    printBisectPassMessage(PassName, CurBisectNum, IRDescription, ShouldRun);
   return ShouldRun;
 }
 
 const int OptBisect::Disabled;
 
-OptPassGate &llvm::getGlobalPassGate() { return getOptBisector(); }
+static OptDisable &getOptDisabler() {
+  static OptDisable OptDisabler;
+  return OptDisabler;
+}
+
+static cl::opt<std::string> OptDisablePass(
+    "opt-disable", cl::Hidden, cl::init(""), cl::Optional,
+    cl::cb<void, std::string>([](std::string Passes) {
+      getOptDisabler().setDisabled(Passes);
+    }),
+    cl::desc("Optimization pass(es) to disable (comma separated)"));
+
+static cl::opt<bool>
+    OptDisableVerbose("opt-disable-verbose",
+                      cl::desc("Show verbose output when opt-disable is set"),
+                      cl::Hidden, cl::init(false), cl::Optional);
+
+static void printDisablePassMessage(const StringRef &Name, StringRef TargetDesc,
+                                    bool Running) {
+  StringRef Status = Running ? "" : "NOT ";
+  errs() << "DISABLE: " << Status << "running pass " << Name << " on "
+         << TargetDesc << "\n";
+}
+
+void OptDisable::setDisabled(StringRef Passes) {
+  std::stringstream StrStream(Passes.str());
+  std::string Token;
+
+  while (std::getline(StrStream, Token, ',')) {
+    if (!Token.empty()) {
+      std::transform(Token.begin(), Token.end(), Token.begin(), ::tolower);
+      DisabledPasses.insert(Token);
+    }
+  }
+}
+
+bool OptDisable::shouldRunPass(const StringRef PassName,
+                               StringRef IRDescription) {
+  assert(isEnabled());
+
+  std::string LowerName = PassName.str();
+  std::transform(LowerName.begin(), LowerName.end(), LowerName.begin(),
+                 ::tolower);
+
+  bool ShouldRun = DisabledPasses.find(LowerName) == DisabledPasses.end();
+  if (OptDisableVerbose)
+    printDisablePassMessage(PassName, IRDescription, ShouldRun);
+  return ShouldRun;
+}
+
+OptPassGate &llvm::getGlobalPassGate() {
+  if (getOptDisabler().isEnabled())
+    return getOptDisabler();
+  return getOptBisector();
+}

@llvmbot
Copy link
Member

llvmbot commented Jun 20, 2025

@llvm/pr-subscribers-clang

Author: Cristian Assaiante (cristianassaiante)

Changes

I would like to propose a new pass gate that allows selective disabling of one or more passes via the clang command line using the -opt-disable option. Passes to be disabled should be specified as a comma-separated list of their names.
The implementation resides in the same file as the bisection tool. The getGlobalPassGate() function returns the currently enabled gate.

Example: -opt-disable="PassA,PassB"

Pass names are matched using case-insensitive comparisons. However, note that special characters, including spaces, must be included exactly as they appear in the pass names.

Additionally, a -opt-disable-verbose flag has been introduced to enable verbose output when this functionality is in use. When enabled, it prints the status of all passes (either running or NOT running), similar to the default behavior of -opt-bisect-limit. This flag is disabled by default, which is the opposite of the -opt-bisect-verbose flag (which defaults to enabled).

To validate this add-on, a test file has also been provided. It reuses the same infrastructure as the opt-bisect test, but disables three specific passes and checks the output to ensure the expected behavior.


Full diff: https://github.com/llvm/llvm-project/pull/145059.diff

3 Files Affected:

  • (added) clang/test/CodeGen/opt-disable.c (+13)
  • (modified) llvm/include/llvm/IR/OptBisect.h (+39)
  • (modified) llvm/lib/IR/OptBisect.cpp (+59-4)
diff --git a/clang/test/CodeGen/opt-disable.c b/clang/test/CodeGen/opt-disable.c
new file mode 100644
index 0000000000000..ee90fc5620d65
--- /dev/null
+++ b/clang/test/CodeGen/opt-disable.c
@@ -0,0 +1,13 @@
+// REQUIRES: x86-registered-target
+
+// Make sure opt-bisect works through both pass managers
+//
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -O1 %s -mllvm -opt-disable="inlinerpass,SROAPass,machine code sinking" -mllvm -opt-disable-verbose -emit-obj -o /dev/null 2>&1 | FileCheck %s
+
+// CHECK-NOT: DISABLE: running pass InlinerPass
+// CHECK-NOT: DISABLE: running pass SROAPass
+// CHECK-NOT: DISABLE: running pass Machine code sinking
+// Make sure that legacy pass manager is running
+// CHECK: Instruction Selection
+
+int func(int a) { return a; }
diff --git a/llvm/include/llvm/IR/OptBisect.h b/llvm/include/llvm/IR/OptBisect.h
index be6aef3298b23..51c3a8040da9b 100644
--- a/llvm/include/llvm/IR/OptBisect.h
+++ b/llvm/include/llvm/IR/OptBisect.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Compiler.h"
 #include <limits>
+#include <set>
 
 namespace llvm {
 
@@ -82,6 +83,44 @@ class LLVM_ABI OptBisect : public OptPassGate {
   int LastBisectNum = 0;
 };
 
+/// This class implements a mechanism to disable passes and individual
+/// optimizations at compile time based on a command line option
+/// (-opt-disable) in order to study how single transformations, or
+/// combinations thereof, affect the IR.
+class LLVM_ABI OptDisable : public OptPassGate {
+public:
+  /// Default constructor. Initializes the state to empty set. The disabling
+  /// will be enabled by the cl::opt call-back when the command line option
+  /// is processed.
+  /// Clients should not instantiate this class directly.  All access should go
+  /// through LLVMContext.
+  OptDisable() = default;
+
+  virtual ~OptDisable() = default;
+
+  /// Checks the pass name to determine if the specified pass should run.
+  ///
+  /// The method prints the name of the pass, and whether or not the pass
+  /// will be executed. It returns true if the pass should run, i.e. if
+  /// its name is was not provided via command line.
+  ///
+  /// Most passes should not call this routine directly. Instead, it is called
+  /// through helper routines provided by the base classes of the pass. For
+  /// instance, function passes should call FunctionPass::skipFunction().
+  bool shouldRunPass(const StringRef PassName,
+                     StringRef IRDescription) override;
+
+  /// Parses the command line argument to extract the names of the passes
+  /// to be disabled. Multiple pass names can be provided with comma separation.
+  void setDisabled(StringRef Passes);
+
+  /// isEnabled() should return true before calling shouldRunPass().
+  bool isEnabled() const override { return !DisabledPasses.empty(); }
+
+private:
+  std::set<std::string> DisabledPasses = {};
+};
+
 /// Singleton instance of the OptBisect class, so multiple pass managers don't
 /// need to coordinate their uses of OptBisect.
 LLVM_ABI OptPassGate &getGlobalPassGate();
diff --git a/llvm/lib/IR/OptBisect.cpp b/llvm/lib/IR/OptBisect.cpp
index 559b199445366..aa1dbdfdbebd4 100644
--- a/llvm/lib/IR/OptBisect.cpp
+++ b/llvm/lib/IR/OptBisect.cpp
@@ -17,6 +17,7 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cassert>
+#include <sstream>
 
 using namespace llvm;
 
@@ -37,8 +38,8 @@ static cl::opt<bool> OptBisectVerbose(
     cl::desc("Show verbose output when opt-bisect-limit is set"), cl::Hidden,
     cl::init(true), cl::Optional);
 
-static void printPassMessage(const StringRef &Name, int PassNum,
-                             StringRef TargetDesc, bool Running) {
+static void printBisectPassMessage(const StringRef &Name, int PassNum,
+                                   StringRef TargetDesc, bool Running) {
   StringRef Status = Running ? "" : "NOT ";
   errs() << "BISECT: " << Status << "running pass "
          << "(" << PassNum << ") " << Name << " on " << TargetDesc << "\n";
@@ -51,10 +52,64 @@ bool OptBisect::shouldRunPass(const StringRef PassName,
   int CurBisectNum = ++LastBisectNum;
   bool ShouldRun = (BisectLimit == -1 || CurBisectNum <= BisectLimit);
   if (OptBisectVerbose)
-    printPassMessage(PassName, CurBisectNum, IRDescription, ShouldRun);
+    printBisectPassMessage(PassName, CurBisectNum, IRDescription, ShouldRun);
   return ShouldRun;
 }
 
 const int OptBisect::Disabled;
 
-OptPassGate &llvm::getGlobalPassGate() { return getOptBisector(); }
+static OptDisable &getOptDisabler() {
+  static OptDisable OptDisabler;
+  return OptDisabler;
+}
+
+static cl::opt<std::string> OptDisablePass(
+    "opt-disable", cl::Hidden, cl::init(""), cl::Optional,
+    cl::cb<void, std::string>([](std::string Passes) {
+      getOptDisabler().setDisabled(Passes);
+    }),
+    cl::desc("Optimization pass(es) to disable (comma separated)"));
+
+static cl::opt<bool>
+    OptDisableVerbose("opt-disable-verbose",
+                      cl::desc("Show verbose output when opt-disable is set"),
+                      cl::Hidden, cl::init(false), cl::Optional);
+
+static void printDisablePassMessage(const StringRef &Name, StringRef TargetDesc,
+                                    bool Running) {
+  StringRef Status = Running ? "" : "NOT ";
+  errs() << "DISABLE: " << Status << "running pass " << Name << " on "
+         << TargetDesc << "\n";
+}
+
+void OptDisable::setDisabled(StringRef Passes) {
+  std::stringstream StrStream(Passes.str());
+  std::string Token;
+
+  while (std::getline(StrStream, Token, ',')) {
+    if (!Token.empty()) {
+      std::transform(Token.begin(), Token.end(), Token.begin(), ::tolower);
+      DisabledPasses.insert(Token);
+    }
+  }
+}
+
+bool OptDisable::shouldRunPass(const StringRef PassName,
+                               StringRef IRDescription) {
+  assert(isEnabled());
+
+  std::string LowerName = PassName.str();
+  std::transform(LowerName.begin(), LowerName.end(), LowerName.begin(),
+                 ::tolower);
+
+  bool ShouldRun = DisabledPasses.find(LowerName) == DisabledPasses.end();
+  if (OptDisableVerbose)
+    printDisablePassMessage(PassName, IRDescription, ShouldRun);
+  return ShouldRun;
+}
+
+OptPassGate &llvm::getGlobalPassGate() {
+  if (getOptDisabler().isEnabled())
+    return getOptDisabler();
+  return getOptBisector();
+}

@cristianassaiante
Copy link
Contributor Author

@mtrofin @snehasish

@nikic nikic requested a review from aeubanks June 20, 2025 19:14
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some drive-by notes. What is the purpose / intended use case of this functionality?

@snehasish
Copy link
Contributor

Some drive-by notes. What is the purpose / intended use case of this functionality?

Cristian has been studying the impact of optimizations on debug information and thus the impact on AutoFDO profile quality. @mtrofin and I encouraged him to put this patch up for review so that we can reproduce his findings on internal workloads and share the insights with the rest of the community.

I think this functionality will also help identify passes which drop debug information and help with the work proposed in this RFC. cc: @jmorse @SLTozer

@SLTozer
Copy link
Contributor

SLTozer commented Jun 23, 2025

I think this functionality will also help identify passes which drop debug information and help with the work proposed in this RFC.

As it happens, I have been using a downstream modification of opt-bisect as part of my triage process for bugs detected with debugify, by counting optimization passes and printing them alongside detected bugs, making it easy to create reproducers using --opt-bisect-limit. This specific change won't be useful for the first pass of the work (detecting missing locations), as Debugify already tracks which pass an error has appeared in.

It would be useful in general for determining passes responsible for dropping debug information, however - I've previously spent time working on finding pass configurations that produce better debug info than the existing O2/O3 pipelines without compromising too greatly on performance - this feature would have made that process easier, and I suspect will make it easier for others to do similar investigations in future, so I give a vote for adding this!

@mtrofin mtrofin requested review from snehasish and mtrofin June 23, 2025 17:14
Copy link

github-actions bot commented Jul 2, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Member

@mtrofin mtrofin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with some nits. There's also @nikic 's suggestion we should wait for resolution before landing this.

Copy link
Contributor

@snehasish snehasish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall lgtm.

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please undo the unrelated formatting changes? It's hard to see what actually changed, especially inside StandardInstrumentations.cpp.

@cristianassaiante
Copy link
Contributor Author

Can you please undo the unrelated formatting changes? It's hard to see what actually changed, especially inside StandardInstrumentations.cpp.

Sure, sorry about that.

@cristianassaiante
Copy link
Contributor Author

@nikic Done! You should be able to see only my changes now.

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable

Copy link
Contributor

@snehasish snehasish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikic Can you take a look again when you get a chance? Thanks!

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@snehasish snehasish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @nikic.

@cristianassaiante I'll squash and merge the changes now. Thanks for contributing this feature to LLVM.

@snehasish
Copy link
Contributor

@cristianassaiante The linux CI check is failing and it looks like it's related to this change. Raw logs for the CI run are here.

2025-07-16T17:58:59.5847693Z Failed Tests (1):
2025-07-16T17:58:59.5847917Z   Clang :: CodeGen/new-pass-manager-opt-bisect.c
2025-07-16T17:58:59.5848108Z 
2025-07-16T17:58:59.5848112Z 
2025-07-16T17:58:59.5848183Z Testing Time: 85.21s
2025-07-16T17:58:59.5848300Z 
2025-07-16T17:58:59.5848382Z Total Discovered Tests: 47733
2025-07-16T17:58:59.5848590Z   Skipped          :     4 (0.01%)
2025-07-16T17:58:59.5848853Z   Unsupported      :   418 (0.88%)
2025-07-16T17:58:59.5849066Z   Passed           : 47279 (99.05%)
2025-07-16T17:58:59.5849285Z   Expectedly Failed:    31 (0.06%)
2025-07-16T17:58:59.5849497Z   Failed           :     1 (0.00%)


... 8< ....

2025-07-16T17:58:16.7982458Z FAIL: Clang :: CodeGen/new-pass-manager-opt-bisect.c (8130 of 22135)
2025-07-16T17:58:16.7983386Z ******************** TEST 'Clang :: CodeGen/new-pass-manager-opt-bisect.c' FAILED ********************
2025-07-16T17:58:16.7984760Z Exit Code: 1
2025-07-16T17:58:16.7985078Z 
2025-07-16T17:58:16.7985332Z Command Output (stderr):
2025-07-16T17:58:16.7985812Z --
2025-07-16T17:58:16.7989099Z /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-linux-gnu -O1 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/new-pass-manager-opt-bisect.c -mllvm -opt-bisect-limit=-1 -emit-obj -o /dev/null 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/new-pass-manager-opt-bisect.c # RUN: at line 5
2025-07-16T17:58:16.7994703Z + /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-linux-gnu -O1 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/new-pass-manager-opt-bisect.c -mllvm -opt-bisect-limit=-1 -emit-obj -o /dev/null
2025-07-16T17:58:16.7998369Z + /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/new-pass-manager-opt-bisect.c
2025-07-16T17:58:16.8000885Z /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/new-pass-manager-opt-bisect.c:10:11: error: CHECK: expected string not found in input
2025-07-16T17:58:16.8002127Z // CHECK: Instruction Selection
2025-07-16T17:58:16.8004780Z           ^
2025-07-16T17:58:16.8005132Z <stdin>:1:25: note: scanning from here
2025-07-16T17:58:16.8005683Z BISECT: running pass (1) annotation2metadata on [module]
2025-07-16T17:58:16.8006335Z                         ^
2025-07-16T17:58:16.8006756Z <stdin>:82:28: note: possible intended match here
2025-07-16T17:58:16.8013703Z BISECT: running pass (82) consthoist on function (func)
2025-07-16T17:58:16.8014412Z                            ^
2025-07-16T17:58:16.8014630Z 
2025-07-16T17:58:16.8014736Z Input file: <stdin>
2025-07-16T17:58:16.8017397Z Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/new-pass-manager-opt-bisect.c
2025-07-16T17:58:16.8018145Z 
2025-07-16T17:58:16.8018340Z -dump-input=help explains the following input dump.
2025-07-16T17:58:16.8018726Z 
2025-07-16T17:58:16.8018840Z Input was:
2025-07-16T17:58:16.8019098Z <<<<<<
2025-07-16T17:58:16.8019487Z             1: BISECT: running pass (1) annotation2metadata on [module] 
2025-07-16T17:58:16.8020108Z check:10'0                             X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
2025-07-16T17:58:16.8020662Z             2: BISECT: running pass (2) forceattrs on [module] 
2025-07-16T17:58:16.8021160Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8021665Z             3: BISECT: running pass (3) declare-to-assign on [module] 
2025-07-16T17:58:16.8022238Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8022778Z             4: BISECT: running pass (4) inferattrs on [module] 
2025-07-16T17:58:16.8023321Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8024001Z             5: BISECT: running pass (5) lower-expect on func 
2025-07-16T17:58:16.8024697Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8025222Z             6: BISECT: running pass (6) simplifycfg on func 
2025-07-16T17:58:16.8025717Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8026323Z             .
2025-07-16T17:58:16.8026583Z             .
2025-07-16T17:58:16.8026851Z             .
2025-07-16T17:58:16.8027201Z            77: BISECT: running pass (77) constmerge on [module] 
2025-07-16T17:58:16.8027731Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8028217Z            78: BISECT: running pass (78) cg-profile on [module] 
2025-07-16T17:58:16.8028700Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8029259Z            79: BISECT: running pass (79) rel-lookup-table-converter on [module] 
2025-07-16T17:58:16.8029760Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8030329Z            80: BISECT: running pass (80) mergeicmps on function (func) 
2025-07-16T17:58:16.8030881Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8031462Z            81: BISECT: running pass (81) expand-memcmp on function (func) 
2025-07-16T17:58:16.8031998Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8032442Z            82: BISECT: running pass (82) consthoist on function (func) 
2025-07-16T17:58:16.8032994Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8033461Z check:10'1                                ?                             possible intended match
2025-07-16T17:58:16.8034249Z            83: BISECT: running pass (83) partially-inline-libcalls on function (func) 
2025-07-16T17:58:16.8034920Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8035557Z            84: BISECT: running pass (84) interleaved-access on function (func) 
2025-07-16T17:58:16.8036144Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8036703Z            85: BISECT: running pass (85) x86-partial-reduction on function (func) 
2025-07-16T17:58:16.8037320Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8037930Z            86: BISECT: running pass (86) codegenprepare on function (func) 
2025-07-16T17:58:16.8038474Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8038939Z            87: BISECT: running pass (87) x86-isel on function (func) 
2025-07-16T17:58:16.8039372Z check:10'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-07-16T17:58:16.8039744Z             .
2025-07-16T17:58:16.8040137Z             .
2025-07-16T17:58:16.8040400Z             .
2025-07-16T17:58:16.8040656Z >>>>>>
2025-07-16T17:58:16.8040816Z 
2025-07-16T17:58:16.8040923Z --
2025-07-16T17:58:16.8041071Z 
2025-07-16T17:58:16.8041181Z ********************

Can you take a look?

@cristianassaiante
Copy link
Contributor Author

@cristianassaiante The linux CI check is failing and it looks like it's related to this change. Raw logs for the CI run are [here]
[...]
Can you take a look?

Should be good now, one bisect test was wrongly left unchanged. Sorry.

@snehasish snehasish merged commit 81eb7de into llvm:main Jul 16, 2025
9 checks passed
Copy link

@cristianassaiante Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@cristianassaiante cristianassaiante deleted the opt-disable branch July 17, 2025 05:06
@cristianassaiante cristianassaiante restored the opt-disable branch July 17, 2025 05:08
@cristianassaiante cristianassaiante deleted the opt-disable branch July 17, 2025 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category llvm:ir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants