@@ -272,8 +272,12 @@ std::map<std::string, std::string> get_device_parameters(bool cpu_only) {
272
272
273
273
result.insert (std::make_pair (" cpu_name" , llvm::sys::getHostCPUName ()));
274
274
result.insert (std::make_pair (" cpu_triple" , llvm::sys::getProcessTriple ()));
275
+ #if LLVM_VERSION_MAJOR > 15
276
+ result.insert (std::make_pair (" cpu_cores" , std::to_string (llvm::get_physical_cores ())));
277
+ #else
275
278
result.insert (
276
279
std::make_pair (" cpu_cores" , std::to_string (llvm::sys::getHostNumPhysicalCores ())));
280
+ #endif
277
281
result.insert (std::make_pair (" cpu_threads" , std::to_string (cpu_threads ())));
278
282
279
283
// https://en.cppreference.com/w/cpp/language/types
@@ -1222,12 +1226,17 @@ std::vector<llvm::Value*> Executor::inlineHoistedLiterals() {
1222
1226
query_func_literal_loads_function_arguments2[element.first ] = argument_values2;
1223
1227
}
1224
1228
1225
- // copy the row_func function body over
1226
- // see
1227
- // https://stackoverflow.com/questions/12864106/move-function-body-avoiding-full-cloning/18751365
1229
+ // copy the row_func function body over
1230
+ // see
1231
+ // https://stackoverflow.com/questions/12864106/move-function-body-avoiding-full-cloning/18751365
1232
+ #if LLVM_VERSION_MAJOR > 15
1233
+ row_func_with_hoisted_literals->splice (row_func_with_hoisted_literals->begin (),
1234
+ cgen_state_->row_func_ );
1235
+ #else
1228
1236
row_func_with_hoisted_literals->getBasicBlockList ().splice (
1229
1237
row_func_with_hoisted_literals->begin (),
1230
1238
cgen_state_->row_func_ ->getBasicBlockList ());
1239
+ #endif
1231
1240
1232
1241
// also replace row_func arguments with the arguments from row_func_hoisted_literals
1233
1242
for (llvm::Function::arg_iterator I = cgen_state_->row_func_ ->arg_begin (),
@@ -1271,10 +1280,14 @@ std::vector<llvm::Value*> Executor::inlineHoistedLiterals() {
1271
1280
// copy the filter_func function body over
1272
1281
// see
1273
1282
// https://stackoverflow.com/questions/12864106/move-function-body-avoiding-full-cloning/18751365
1283
+ #if LLVM_VERSION_MAJOR > 15
1284
+ filter_func_with_hoisted_literals->splice (filter_func_with_hoisted_literals->begin (),
1285
+ cgen_state_->filter_func_ );
1286
+ #else
1274
1287
filter_func_with_hoisted_literals->getBasicBlockList ().splice (
1275
1288
filter_func_with_hoisted_literals->begin (),
1276
1289
cgen_state_->filter_func_ ->getBasicBlockList ());
1277
-
1290
+ # endif
1278
1291
// also replace filter_func arguments with the arguments from
1279
1292
// filter_func_hoisted_literals
1280
1293
for (llvm::Function::arg_iterator I = cgen_state_->filter_func_ ->arg_begin (),
0 commit comments