This is an archive of the discontinued LLVM Phabricator instance.

[NFCI] Replace AArch64StackOffset by StackOffset.
ClosedPublic

Authored by sdesmalen on Oct 7 2020, 10:04 AM.

Details

Summary

This patch replaces the AArch64StackOffset class by the generic one
defined in TypeSize.h.

Diff Detail

Event Timeline

sdesmalen created this revision.Oct 7 2020, 10:04 AM
  • Rebased patch.

Rebased patch.

sdesmalen updated this revision to Diff 300204.Oct 23 2020, 2:55 AM

Rebased patch again (apologies for the spam).

One suggestion for a possible fold of some additions, but otherwise looks good to me!

llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
1944–1945

It's just a thought, but in cases such as this where we're initialising to a composite we could replace the addition with:

StackOffset::get(OffsetFromFPToSVEArea, ObjectOffset)

sdesmalen updated this revision to Diff 300223.Oct 23 2020, 4:24 AM
  • Use StackOffset::get(Fixed, Scalable) instead of StackOffset::getFixed(Fixed) + StackOffset::getScalable(Scalable)
sdesmalen marked an inline comment as done.Oct 23 2020, 4:25 AM
sdesmalen added inline comments.
llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
1944–1945

Good catch!

david-arm accepted this revision.Oct 23 2020, 7:24 AM

LGTM!

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
3885–3886

nit: You could change the if and else case to also use StackOffset::get().

This revision is now accepted and ready to land.Oct 23 2020, 7:24 AM
sdesmalen updated this revision to Diff 301228.Oct 28 2020, 4:03 AM
sdesmalen marked 2 inline comments as done.

Rebased patch.

This revision was automatically updated to reflect the committed changes.
llvm/unittests/Target/AArch64/DecomposeStackOffsetTest.cpp