[all-commits] [llvm/llvm-project] 8f623f: [AArch64][SVE] Restore SP from FP when SVE CSRs an...
Bradley Smith via All-commits
all-commits at lists.llvm.org
Wed May 4 05:57:45 PDT 2022
Author: Bradley Smith <bradley.smith at arm.com>
Date: 2022-05-04 (Wed, 04 May 2022)
[AArch64][SVE] Restore SP from FP when SVE CSRs and variable sized objects are present
Without SVE, after a dynamic stack allocation has modified the SP, it is
presumed that a frame pointer restoration will revert the SP back to
it's correct value prior to any caller stack being restored. However the
SVE frame is restored using the stack pointer directly, as it is located
after the frame pointer. This means that in the presence of a dynamic
stack allocation, any SVE callee state gets corrupted as SP has the
incorrect value when the SVE state is restored.
To address this issue, when variable sized objects and SVE CSRs are
present, treat the stack as having been realigned, hence restoring the
stack pointer from the frame pointerr prior to restoring the SVE state.
Differential Revision: https://reviews.llvm.org/D124615
More information about the All-commits