diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 93f1382c2d..e51781480c 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -92,6 +92,8 @@ cfg::map_entry g_cfg_ppu_decoder(cfg::root.core, "PPU Decoder" { "Recompiler (LLVM)", ppu_decoder_type::llvm }, }); +cfg::bool_entry g_cfg_llvm_logs(cfg::root.core, "Save LLVM logs"); + const ppu_decoder s_ppu_interpreter_precise; const ppu_decoder s_ppu_interpreter_fast; @@ -1142,16 +1144,17 @@ extern void ppu_initialize(const ppu_module& info) std::string result; raw_string_ostream out(result); - out << *module; // print IR - fs::file(fs::get_config_dir() + "LLVM.log", fs::rewrite) - .write(out.str()); - - result.clear(); + if (g_cfg_llvm_logs) + { + out << *module; // print IR + fs::file(Emu.GetCachePath() + obj_name + ".log", fs::rewrite).write(out.str()); + result.clear(); + } if (verifyModule(*module, &out)) { out.flush(); - LOG_ERROR(PPU, "LLVM: Translation failed:\n%s", result); + LOG_ERROR(PPU, "LLVM: Verification failed for %s:\n%s", obj_name, result); return; }