Skip to content

Commit 0d2ba65

Browse files
committed
Fix compilation breakage introduced by 8404aeb.
Also fix BitVector unittest failure when DLLVM_ENABLE_ASSERTIONS are OFF, introduced by d110c3a.
1 parent 597dfb3 commit 0d2ba65

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class SpeculativeJIT {
131131
std::unique_ptr<ExecutionSession> ES;
132132
DataLayout DL;
133133
MangleAndInterner Mangle{*ES, DL};
134-
ThreadPool CompileThreads{NumThreads};
134+
ThreadPool CompileThreads{llvm::hardware_concurrency(NumThreads)};
135135

136136
JITDylib &MainJD;
137137

llvm/examples/ThinLtoJIT/ThinLtoJIT.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ void ThinLtoJIT::setupLayers(JITTargetMachineBuilder JTMB,
262262
OnDemandLayer->setPartitionFunction(CompileOnDemandLayer::compileWholeModule);
263263

264264
// Delegate compilation to the thread pool.
265-
CompileThreads = std::make_unique<ThreadPool>(NumCompileThreads);
265+
CompileThreads = std::make_unique<ThreadPool>(
266+
llvm::hardware_concurrency(NumCompileThreads));
266267
ES.setDispatchMaterialization(
267268
[this](JITDylib &JD, std::unique_ptr<MaterializationUnit> MU) {
268269
if (IsTrivialModule(MU.get())) {

llvm/examples/ThinLtoJIT/ThinLtoModuleIndex.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ThinLtoModuleIndex {
2626
public:
2727
ThinLtoModuleIndex(ExecutionSession &ES, unsigned ParseModuleThreads)
2828
: ES(ES), CombinedSummaryIndex(HaveGVs),
29-
ParseModuleWorkers(ParseModuleThreads),
29+
ParseModuleWorkers(llvm::hardware_concurrency(ParseModuleThreads)),
3030
NumParseModuleThreads(ParseModuleThreads) {}
3131

3232
Error add(StringRef InputPath);

llvm/unittests/ADT/BitVectorTest.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1166,9 +1166,11 @@ TYPED_TEST(BitVectorTest, DenseSet) {
11661166
I = Set.insert(C);
11671167
EXPECT_EQ(true, I.second);
11681168

1169+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
11691170
TypeParam D;
11701171
EXPECT_DEATH(Set.insert(D),
11711172
"Empty/Tombstone value shouldn't be inserted into map!");
1173+
#endif
11721174

11731175
EXPECT_EQ(3U, Set.size());
11741176
EXPECT_EQ(1U, Set.count(A));

0 commit comments

Comments
 (0)