From f228ca7961a2feeb1c22c390659462753286ab11 Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi <18193363+elad335@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:43:20 +0300 Subject: [PATCH] SPU LLVM: Avoid sinking stores out of non-loops --- rpcs3/Emu/Cell/SPULLVMRecompiler.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp index b18ef1b122..4868ed3d0f 100644 --- a/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp @@ -2340,6 +2340,7 @@ public: } bool has_gpr_barriers_in_the_way = false; + bool potential_loop = false; for (auto [a2, b2] : sucs) { @@ -2351,6 +2352,7 @@ public: break; } + potential_loop = true; continue; } @@ -2390,6 +2392,7 @@ public: break; } + potential_loop = true; continue; } @@ -2424,6 +2427,12 @@ public: continue; } + if (!potential_loop) + { + spu_log.trace("Avoided postponing r%u store from block 0x%x (not loop)", i, block_q[bi].first); + continue; + } + for (auto [a2, b2] : sucs) { if (b2 != bqbi)