This is an archive of the discontinued LLVM Phabricator instance.

[RFC][WIP][RISCV] Fold ADDI of LLA + Load/Store code sequences
AbandonedPublic

Authored by luismarques on Mar 16 2022, 12:15 PM.

Details

Reviewers
asb
craig.topper
Summary

RFC: I'm not sure this is the best approach for achieving this...?

For medany code models we aren't folding the ADDI offset of the AUIPC+ADDI+Load/Store (i.e. LLA+Load/Store) into the Load/Store offset. We have a pass for that but it runs before register allocation, while the LLA pseudoinstruction expansion runs just before code emission. As an alternative to this patch, I'm not sure either of those could be changed to be able to run in the opposite order and handle this case?

(This is currently a WIP. TODO: implement stores, etc.)

Diff Detail

Event Timeline

luismarques created this revision.Mar 16 2022, 12:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2022, 12:15 PM
luismarques requested review of this revision.Mar 16 2022, 12:15 PM

This then duplicates the AUIPC though and scales as 2*N rather than N+2. If you want to do this properly you really need to have a peephole pass that runs after the pseudo has been expanded.

luismarques abandoned this revision.Mar 17 2022, 9:16 AM

Thanks for the feedback.