This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fix for the pre-indexed paired load/store optimization.
ClosedPublic

Authored by stelios-arm on May 5 2021, 3:09 AM.

Details

Summary

This patch fixes an issue where a pre-indexed store e.g., STR x1, [x0, #24]! with a store like STR x0, [x0, #8] are merged into a single store: STP x1, x0, [x0, #24]!
. They shouldn’t be merged because the second store uses x0 as both the stored value and the address and so it needs to be using the updated x0. Therefore, it should not be folded into a STP <>pre.

Additionally, a new test case is added to verify this fix.

Diff Detail