This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Change how we isel (add X, [-4096, -2049]) or (add X, [2048,4095]).
ClosedPublic

Authored by craig.topper on Jun 24 2022, 12:26 AM.

Details

Summary

We currently split the immediate almost equally between two addis.
If the immediate is odd, it won't be split exactly equal.

This patch instead gives one addi an immediate of 2047 or -2048 and the
other getsthe remainder. If the original immediate is near -2049 or 2048,
this might allow the use of c.addi for the addi that receives the
smaller immediate.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 24 2022, 12:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2022, 12:26 AM
craig.topper requested review of this revision.Jun 24 2022, 12:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2022, 12:26 AM
This revision is now accepted and ready to land.Jun 24 2022, 1:48 AM
asb accepted this revision.Jun 24 2022, 6:16 AM
This revision was landed with ongoing or failed builds.Jun 24 2022, 8:33 AM
This revision was automatically updated to reflect the committed changes.