-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AArch64] Don't emit Neon in streaming[-compatible] functions with -fzero-call-used-regs #116995
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9694,19 +9694,26 @@ void AArch64InstrInfo::buildClearRegister(Register Reg, MachineBasicBlock &MBB, | |
| MachineBasicBlock::iterator Iter, | ||
| DebugLoc &DL, | ||
| bool AllowSideEffects) const { | ||
| const MachineFunction &MF = *MBB.getParent(); | ||
| MachineFunction &MF = *MBB.getParent(); | ||
| const AArch64Subtarget &STI = MF.getSubtarget<AArch64Subtarget>(); | ||
| const AArch64RegisterInfo &TRI = *STI.getRegisterInfo(); | ||
|
|
||
| if (TRI.isGeneralPurposeRegister(MF, Reg)) { | ||
| BuildMI(MBB, Iter, DL, get(AArch64::MOVZXi), Reg).addImm(0).addImm(0); | ||
| } else if (STI.hasSVE()) { | ||
| } else if (STI.isSVEorStreamingSVEAvailable()) { | ||
| BuildMI(MBB, Iter, DL, get(AArch64::DUP_ZI_D), Reg) | ||
| .addImm(0) | ||
| .addImm(0); | ||
| } else { | ||
| } else if (STI.isNeonAvailable()) { | ||
| BuildMI(MBB, Iter, DL, get(AArch64::MOVIv2d_ns), Reg) | ||
| .addImm(0); | ||
| } else { | ||
| // This is a streaming-compatible function without SVE. We don't have full | ||
| // Neon (just FPRs), so we can at most use the first 64-bit sub-register. | ||
| // So given `movi v..` would be illegal use `fmov d..` instead. | ||
|
Comment on lines
+9711
to
+9713
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure this is correct. I don't think there's a way to zero the full 128 bits without Neon or SVE in a streaming-compatible function (we at most have the D registers).
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fmovd (and all other instructions that set a |
||
| assert(STI.hasNEON() && "Expected to have NEON."); | ||
| Register Reg64 = TRI.getSubReg(Reg, AArch64::dsub); | ||
| BuildMI(MBB, Iter, DL, get(AArch64::FMOVD0), Reg64); | ||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.