This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Move the custom isel for (add X, imm) into SelectAddrRegImm.
ClosedPublic

Authored by craig.topper on Jul 10 2022, 11:11 AM.

Details

Summary

This custom isel was used to split the lo12 bits of the imm so that
they could be folded into load/store addresses via a post-isel
peephole.

This patch instead splits the immediate during isel and folds the
lo12 removing the need for the post-isel peephole to do anything.

After this we'll be able to remove the post-isel peephole.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 10 2022, 11:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2022, 11:12 AM
craig.topper requested review of this revision.Jul 10 2022, 11:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2022, 11:12 AM
luismarques accepted this revision.Jul 10 2022, 3:43 PM
This revision is now accepted and ready to land.Jul 10 2022, 3:43 PM
asb accepted this revision.Jul 11 2022, 7:35 AM

LGTM, but could you please add a brief comment before isWorthFoldingAdd to provide some narrative explanation of why this transformation is done.

Add explanatory comments

asb added a comment.Jul 11 2022, 10:33 AM

Add explanatory comments

Thanks, that's great!

This revision was landed with ongoing or failed builds.Jul 11 2022, 10:44 AM
This revision was automatically updated to reflect the committed changes.