Simplify compile threads

This commit is contained in:
Megamouse 2021-01-30 23:03:20 +01:00 committed by Ivan
parent 2025f02105
commit 7bddb87306
2 changed files with 12 additions and 17 deletions

View file

@ -2783,7 +2783,6 @@ bool ppu_initialize(const ppu_module& info, bool check_only)
if (!jit && !check_only) if (!jit && !check_only)
{ {
ppu_log.success("LLVM: Module exists: %s", obj_name); ppu_log.success("LLVM: Module exists: %s", obj_name);
continue;
} }
continue; continue;
@ -2829,26 +2828,26 @@ bool ppu_initialize(const ppu_module& info, bool check_only)
// Set low priority // Set low priority
thread_ctrl::scoped_priority low_prio(-1); thread_ctrl::scoped_priority low_prio(-1);
for (u32 i = work_cv++; i < workload.size(); i = work_cv++) for (u32 i = work_cv++; i < workload.size(); i = work_cv++, g_progr_pdone++)
{ {
if (Emu.IsStopped())
{
continue;
}
// Keep allocating workload // Keep allocating workload
const auto [obj_name, part] = std::as_const(workload)[i]; const auto [obj_name, part] = std::as_const(workload)[i];
// Allocate "core" // Allocate "core"
std::lock_guard jlock(g_fxo->get<jit_core_allocator>()->sem); std::lock_guard jlock(g_fxo->get<jit_core_allocator>()->sem);
if (!Emu.IsStopped()) ppu_log.warning("LLVM: Compiling module %s%s", cache_path, obj_name);
{
ppu_log.warning("LLVM: Compiling module %s%s", cache_path, obj_name);
// Use another JIT instance // Use another JIT instance
jit_compiler jit2({}, g_cfg.core.llvm_cpu, 0x1); jit_compiler jit2({}, g_cfg.core.llvm_cpu, 0x1);
ppu_initialize2(jit2, part, cache_path, obj_name); ppu_initialize2(jit2, part, cache_path, obj_name);
ppu_log.success("LLVM: Compiled module %s", obj_name); ppu_log.success("LLVM: Compiled module %s", obj_name);
}
g_progr_pdone++;
} }
}); });

View file

@ -457,13 +457,12 @@ void spu_cache::initialize()
std::vector<be_t<u32>> ls(0x10000); std::vector<be_t<u32>> ls(0x10000);
// Build functions // Build functions
for (usz func_i = fnext++; func_i < func_list.size(); func_i = fnext++) for (usz func_i = fnext++; func_i < func_list.size(); func_i = fnext++, g_progr_pdone++)
{ {
const spu_program& func = std::as_const(func_list)[func_i]; const spu_program& func = std::as_const(func_list)[func_i];
if (Emu.IsStopped() || fail_flag) if (Emu.IsStopped() || fail_flag)
{ {
g_progr_pdone++;
continue; continue;
} }
@ -489,7 +488,6 @@ void spu_cache::initialize()
(inverse_bounds && (hash_start < g_cfg.core.spu_llvm_lower_bound && hash_start > g_cfg.core.spu_llvm_upper_bound))) (inverse_bounds && (hash_start < g_cfg.core.spu_llvm_lower_bound && hash_start > g_cfg.core.spu_llvm_upper_bound)))
{ {
spu_log.error("[Debug] Skipped function %s", fmt::base57(hash_start)); spu_log.error("[Debug] Skipped function %s", fmt::base57(hash_start));
g_progr_pdone++;
result++; result++;
continue; continue;
} }
@ -516,8 +514,6 @@ void spu_cache::initialize()
// Clear fake LS // Clear fake LS
std::memset(ls.data() + start / 4, 0, 4 * (size0 - 1)); std::memset(ls.data() + start / 4, 0, 4 * (size0 - 1));
g_progr_pdone++;
result++; result++;
} }