New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AArch64][SVE] Failed to reserve a spill slot for an address of an SVE load/store #60918
Comments
@llvm/issue-subscribers-backend-aarch64 |
Hi @ytmukai thanks for reporting. I've created https://reviews.llvm.org/D145497 to address this. |
This is an alternative fix to D145497, which also addresses #60918 In D124457 which added the original code for this, @efriedma pointed out that it wasn't safe to assume that FI #0 would be allocated at offset 0, but that part of the patch went in without any changes. The downside of this solution is that any access to an object on the stack that has been allocated at SP + 0, still gets moved to a separate register first, which degrades performance. Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D146056
This is an alternative fix to D145497, which also addresses llvm/llvm-project#60918 In D124457 which added the original code for this, @efriedma pointed out that it wasn't safe to assume that FI #0 would be allocated at offset 0, but that part of the patch went in without any changes. The downside of this solution is that any access to an object on the stack that has been allocated at SP + 0, still gets moved to a separate register first, which degrades performance. Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D146056
This is an alternative fix to D145497, which also addresses llvm/llvm-project#60918 In D124457 which added the original code for this, @efriedma pointed out that it wasn't safe to assume that FI #0 would be allocated at offset 0, but that part of the patch went in without any changes. The downside of this solution is that any access to an object on the stack that has been allocated at SP + 0, still gets moved to a separate register first, which degrades performance. Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D146056
Sorry for the late reply. Thanks for the fix! |
https://llvm.godbolt.org/z/E394ec4r3
A spill slot for a scratch register for an address of an SVE load/store may not be reserved, resulting in the following crash:
Detailed conditions are as follows:
The instruction
LD1W_IMM
in the code below met the above conditions.In this case, a spill slot is required, but since the
BigStack
in the following code is set tofalse
, the slot is not allocated.llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
Lines 3086 to 3098 in 7aec47a
The problem can be solved by ensuring that
BigStack
istrue
in the presence of such an SVE load/store.However, I am not familiar with these codes and have no idea how to correct them properly.
Initially, this bug was reported by @ggouaillardet:
https://reviews.llvm.org/rG3f561996bf7193091bc6670a2e7804b0cb0bb936#1173798
The machine model modifications in that patch made scheduling more aggressive and thus more prone to problems.
At the source code level, the problem may occur when a small trip count loop is vectorized and fully unrolled with the
-msve-vector-bits=
option, as in the following case:https://reviews.llvm.org/rG68469a80cb74#1173363
The text was updated successfully, but these errors were encountered: