[PATCH] D92897: Set legacy pass manager OptBisect to same as NPM OptBisect

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 11 19:15:23 PST 2020


aeubanks added inline comments.


================
Comment at: llvm/include/llvm/IR/OptBisect.h:58
+  /// Checks the bisect limit to determine if the specified pass should run.
+  /// This calls checkPass
+  bool shouldRunPass(const Pass *P, StringRef IRDescription) override;
----------------



================
Comment at: llvm/include/llvm/IR/OptBisect.h:82
 
+/// Singleton instance of the OptBisect class.
+extern ManagedStatic<OptBisect> OptBisector;
----------------
should probably mention that this is so that multiple pass managers don't need to coordinate their uses of OptBisect


================
Comment at: llvm/lib/IR/LLVMContextImpl.cpp:222
 
-/// Singleton instance of the OptBisect class.
-///
-/// This singleton is accessed via the LLVMContext::getOptPassGate() function.
-/// It provides a mechanism to disable passes and individual optimizations at
-/// compile time based on a command line option (-opt-bisect-limit) in order to
-/// perform a bisecting search for optimization-related problems.
-///
-/// Even if multiple LLVMContext objects are created, they will all return the
-/// same instance of OptBisect in order to provide a single bisect count.  Any
-/// code that uses the OptBisect object should be serialized when bisection is
-/// enabled in order to enable a consistent bisect count.
-static ManagedStatic<OptBisect> OptBisector;
-
+/// Gets the singleton instance OptBisect if not already set
 OptPassGate &LLVMContextImpl::getOptPassGate() const {
----------------



================
Comment at: llvm/lib/IR/OptBisect.cpp:58
+
+ManagedStatic<OptBisect> llvm::OptBisector;
----------------
newline at end of file?


================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:28
 #include "llvm/IR/Verifier.h"
+#include "llvm/Support/Casting.h"
 #include "llvm/Support/CommandLine.h"
----------------
is this include necessary?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92897/new/

https://reviews.llvm.org/D92897



More information about the cfe-commits mailing list