[llvm] 0d2ba65 - Fix compilation breakage introduced by 8404aeb56a73ab24f9b295111de3b37a37f0b841.

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 14 08:17:53 PST 2020


Author: Alexandre Ganea
Date: 2020-02-14T11:17:18-05:00
New Revision: 0d2ba6577d877a421e91f037c1d9a4cd4d4ade8c

URL: https://github.com/llvm/llvm-project/commit/0d2ba6577d877a421e91f037c1d9a4cd4d4ade8c
DIFF: https://github.com/llvm/llvm-project/commit/0d2ba6577d877a421e91f037c1d9a4cd4d4ade8c.diff

LOG: Fix compilation breakage introduced by 8404aeb56a73ab24f9b295111de3b37a37f0b841.

Also fix BitVector unittest failure when DLLVM_ENABLE_ASSERTIONS are OFF, introduced by d110c3a9f5253c4d94c10299c61fbbb33edab7db.

Added: 
    

Modified: 
    llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp
    llvm/examples/ThinLtoJIT/ThinLtoJIT.cpp
    llvm/examples/ThinLtoJIT/ThinLtoModuleIndex.h
    llvm/unittests/ADT/BitVectorTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp b/llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp
index 3828e0a5f82b..0c986d5a3f1c 100644
--- a/llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp
+++ b/llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp
@@ -131,7 +131,7 @@ class SpeculativeJIT {
   std::unique_ptr<ExecutionSession> ES;
   DataLayout DL;
   MangleAndInterner Mangle{*ES, DL};
-  ThreadPool CompileThreads{NumThreads};
+  ThreadPool CompileThreads{llvm::hardware_concurrency(NumThreads)};
 
   JITDylib &MainJD;
 

diff  --git a/llvm/examples/ThinLtoJIT/ThinLtoJIT.cpp b/llvm/examples/ThinLtoJIT/ThinLtoJIT.cpp
index 394c1308fd6f..b920bee6ad14 100644
--- a/llvm/examples/ThinLtoJIT/ThinLtoJIT.cpp
+++ b/llvm/examples/ThinLtoJIT/ThinLtoJIT.cpp
@@ -262,7 +262,8 @@ void ThinLtoJIT::setupLayers(JITTargetMachineBuilder JTMB,
   OnDemandLayer->setPartitionFunction(CompileOnDemandLayer::compileWholeModule);
 
   // Delegate compilation to the thread pool.
-  CompileThreads = std::make_unique<ThreadPool>(NumCompileThreads);
+  CompileThreads = std::make_unique<ThreadPool>(
+      llvm::hardware_concurrency(NumCompileThreads));
   ES.setDispatchMaterialization(
       [this](JITDylib &JD, std::unique_ptr<MaterializationUnit> MU) {
         if (IsTrivialModule(MU.get())) {

diff  --git a/llvm/examples/ThinLtoJIT/ThinLtoModuleIndex.h b/llvm/examples/ThinLtoJIT/ThinLtoModuleIndex.h
index a6574be5c397..29a24a0c5e14 100644
--- a/llvm/examples/ThinLtoJIT/ThinLtoModuleIndex.h
+++ b/llvm/examples/ThinLtoJIT/ThinLtoModuleIndex.h
@@ -26,7 +26,7 @@ class ThinLtoModuleIndex {
 public:
   ThinLtoModuleIndex(ExecutionSession &ES, unsigned ParseModuleThreads)
       : ES(ES), CombinedSummaryIndex(HaveGVs),
-        ParseModuleWorkers(ParseModuleThreads),
+        ParseModuleWorkers(llvm::hardware_concurrency(ParseModuleThreads)),
         NumParseModuleThreads(ParseModuleThreads) {}
 
   Error add(StringRef InputPath);

diff  --git a/llvm/unittests/ADT/BitVectorTest.cpp b/llvm/unittests/ADT/BitVectorTest.cpp
index 3fa81846b135..c93338836141 100644
--- a/llvm/unittests/ADT/BitVectorTest.cpp
+++ b/llvm/unittests/ADT/BitVectorTest.cpp
@@ -1166,9 +1166,11 @@ TYPED_TEST(BitVectorTest, DenseSet) {
   I = Set.insert(C);
   EXPECT_EQ(true, I.second);
 
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
   TypeParam D;
   EXPECT_DEATH(Set.insert(D),
                "Empty/Tombstone value shouldn't be inserted into map!");
+#endif
 
   EXPECT_EQ(3U, Set.size());
   EXPECT_EQ(1U, Set.count(A));


        


More information about the llvm-commits mailing list