This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Extend storeRegToStackSlot to spill SVE registers.
ClosedPublic

Authored by sdesmalen on Nov 11 2019, 7:09 AM.

Details

Summary

This patch allows the register allocator to spill SVE registers to the stack.

Diff Detail

Event Timeline

sdesmalen created this revision.Nov 11 2019, 7:09 AM
efriedma added inline comments.Nov 11 2019, 12:49 PM
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
2960

I'd prefer to refactor the code so it doesn't depend on what getSpillSize returns for SVE types.

sdesmalen marked an inline comment as done.Nov 12 2019, 5:06 AM
sdesmalen added inline comments.
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
2960

The SVE case is actually outside the switch statement and is therefore independent of what getSpillSize returns. The switch statement seems to be there purely for having a quicker look-up as opposed to having a long if-elseif-elseif-[..]-elseif chain. Do you want me to change that?

efriedma accepted this revision.Nov 12 2019, 11:43 AM

LGTM

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
2960

Oh, I didn't read the code in the switch that carefully. I guess it only triggers for specific register classes, so it doesn't matter what getSpillSize() returns as long as it doesn't crash.

I guess that's okay.

3048

We'll eventually need to handle ZPR2 etc.? I guess we don't need that immediately.

This revision is now accepted and ready to land.Nov 12 2019, 11:43 AM
This revision was automatically updated to reflect the committed changes.
sdesmalen marked an inline comment as done.

Thanks for the review!

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
3048

Correct! We can implement this with Pseudos that expand to individual LDR_ZXI/STR_ZXI instructions.