This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Prefer ADDI over ORI if the known bits are disjoint.
ClosedPublic

Authored by craig.topper on Dec 26 2022, 1:32 PM.

Details

Summary

There is no compressed form of ORI but there is a compressed form
for ADDI.

This also works for XORI since DAGCombine will turn Xor with disjoint
bits in Or.

Note: The compressed forms require a simm6 immediate, but I'm doing
this for the full simm12 range.

Diff Detail

Event Timeline

craig.topper created this revision.Dec 26 2022, 1:32 PM
craig.topper requested review of this revision.Dec 26 2022, 1:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 26 2022, 1:32 PM
This revision is now accepted and ready to land.Dec 28 2022, 5:36 PM