git subrepo pull --force deps/lightrec
[pcsx_rearmed.git] / deps / lightrec / optimizer.c
index 5ce58ad..58d9d56 100644 (file)
@@ -1340,8 +1340,16 @@ static int lightrec_swap_load_delays(struct lightrec_state *state,
                } else if (!in_ds && opcode_is_load(c) && c.i.op != OP_LWC2) {
                        next = block->opcode_list[i + 1].c;
 
-                       if (c.i.op == OP_LWL && next.i.op == OP_LWR)
+                       switch (next.i.op) {
+                       case OP_LWL:
+                       case OP_LWR:
+                       case OP_REGIMM:
+                       case OP_BEQ:
+                       case OP_BNE:
+                       case OP_BLEZ:
+                       case OP_BGTZ:
                                continue;
+                       }
 
                        if (opcode_reads_register(next, c.i.rt)
                            && !opcode_writes_register(next, c.i.rs)) {