-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[AArch64] Disable red-zone when lowering Q-reg copy through memory. #94962
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] Disable red-zone when lowering Q-reg copy through memory. #94962
Conversation
This was pointed out in PR llvm#93940.
@llvm/pr-subscribers-backend-aarch64 Author: Sander de Smalen (sdesmalen-arm) ChangesThis was pointed out in PR #93940. Full diff: https://github.com/llvm/llvm-project/pull/94962.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
index cd532671f5018..65e3bbf4e9c35 100644
--- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
@@ -431,8 +431,15 @@ bool AArch64FrameLowering::canUseRedZone(const MachineFunction &MF) const {
const AArch64FunctionInfo *AFI = MF.getInfo<AArch64FunctionInfo>();
uint64_t NumBytes = AFI->getLocalStackSize();
+ // If neither NEON or SVE are available, a COPY from one Q-reg to
+ // another requires a spill -> reload sequence. We can do that
+ // using a pre-decrementing store/post-decrementing load, but
+ // if we do so, we can't use the Red Zone.
+ bool LowerQRegCopyThroughMem =
+ !Subtarget.isNeonAvailable() && !Subtarget.hasSVE();
+
return !(MFI.hasCalls() || hasFP(MF) || NumBytes > RedZoneSize ||
- getSVEStackSize(MF));
+ getSVEStackSize(MF) || LowerQRegCopyThroughMem);
}
/// hasFP - Return true if the specified function should have a dedicated frame
|
// using a pre-decrementing store/post-decrementing load, but | ||
// if we do so, we can't use the Red Zone. | ||
bool LowerQRegCopyThroughMem = | ||
!Subtarget.isNeonAvailable() && !Subtarget.hasSVE(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe check for hasFPARMv8(), so this doesn't impact soft-fp code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…lvm#94962) This was pointed out in PR llvm#93940.
This was pointed out in PR #93940.