This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] adjust first sp size to use c.addi16sp.
ClosedPublic

Authored by lcvon007 on Sep 4 2023, 6:26 AM.

Details

Summary

addi sp, sp, 512 may be used to recover the sp in the epilogue
when stack size is larger than 2047(2^11 - 1), however, it can
not be compressed using C extension, and addi sp, sp, 496 is
able to be compressed, so try to use 496 as the ajust amount of
the fisrt sp if function doesn't need extra instructions after
adjust.

Diff Detail

Event Timeline

lcvon007 created this revision.Sep 4 2023, 6:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2023, 6:26 AM
lcvon007 requested review of this revision.Sep 4 2023, 6:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2023, 6:26 AM
lcvon007 updated this revision to Diff 555786.Sep 4 2023, 7:00 PM

rebase master

wangpc accepted this revision.Sep 5 2023, 9:17 PM

LGTM.

This revision is now accepted and ready to land.Sep 5 2023, 9:17 PM
This revision was landed with ongoing or failed builds.Sep 5 2023, 11:32 PM
This revision was automatically updated to reflect the committed changes.