aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/LLVMContextImpl.cpp
diff options
context:
space:
mode:
authorSamuel Eubanks <swamulism@gmail.com>2020-12-20 13:47:46 -0800
committerArthur Eubanks <aeubanks@google.com>2020-12-20 13:47:56 -0800
commit47dbee6790cb813e4f4bc993585b9770c357e508 (patch)
treef73a1d93737d2249d42fb89f47809649e42da8c8 /llvm/lib/IR/LLVMContextImpl.cpp
parentf47bac5dd207c672e803e08685e084e5d66f8bce (diff)
downloadllvm-47dbee6790cb813e4f4bc993585b9770c357e508.zip
llvm-47dbee6790cb813e4f4bc993585b9770c357e508.tar.gz
llvm-47dbee6790cb813e4f4bc993585b9770c357e508.tar.bz2
Make NPM OptBisectInstrumentation use global singleton OptBisect
Currently there is an issue where the legacy pass manager uses a different OptBisect counter than the new pass manager. This fix makes the npm OptBisectInstrumentation use the global OptBisect. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D92897
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.cpp')
-rw-r--r--llvm/lib/IR/LLVMContextImpl.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.cpp b/llvm/lib/IR/LLVMContextImpl.cpp
index 875c61cd..93a0590 100644
--- a/llvm/lib/IR/LLVMContextImpl.cpp
+++ b/llvm/lib/IR/LLVMContextImpl.cpp
@@ -219,19 +219,8 @@ void LLVMContextImpl::getSyncScopeNames(
SSNs[SSE.second] = SSE.first();
}
-/// 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 OptPassGate for this LLVMContextImpl, which defaults to the
+/// singleton OptBisect if not explicitly set.
OptPassGate &LLVMContextImpl::getOptPassGate() const {
if (!OPG)
OPG = &(*OptBisector);