SPU LLVM: avoid mirrored local-store aliases - #151
Open
makolg wants to merge 1 commit into
Open
Conversation
makolg
marked this pull request as ready for review
July 25, 2026 04:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
STQX,LQX,STQD, andLQDpaths.STQX/LQXaccesses.This is an aPS3e
main4backport/adaptation of RPCS3 commits9bf67f0and0fcb15a.Root cause and impact
The previous optimized paths could refer to the same SPU Local Store block through different mirrored host addresses. LLVM alias analysis may then treat accesses to the same guest memory as independent and optimize them incorrectly.
On Devil May Cry 4 (
BLUS30092), the failure presented as a corrupted SPU link register restored from the SPU stack. The corrupted return value resolved to zero-filled LS at PC0x34d3c, ending in:A mailbox-only test build still failed at the same PC after 7.18 seconds and again after clearing the generated SPU cache at 8.47 seconds. A later build containing this LS-address correction progressed past that fatal, loaded the intro/title and
m00_100s/m01_100sresources, and ran for four minutes until manually stopped, with noUnknown STOP, zero-op fatal, signal, or Android crash.This PR intentionally excludes unrelated mailbox synchronization, diagnostic logging, Android manifest, versioning, and game-profile changes.
Validation
git diff --checkpasses.SPULLVMRecompiler.cppcompiles successfully foraarch64-none-linux-android28using Android NDK 27 / Clang; only existing project warnings are emitted.Disclosure
Patch preparation and log analysis were AI-assisted. The implementation is a focused adaptation of the two linked upstream RPCS3 commits; validation used native aPS3e/RPCS3 logs from a user-owned REDMAGIC device and a local Android ARM64 compiler pass.