This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Improve lowering of SHL_PARTS/SRL_PARTS/SRA_PARTS.
ClosedPublic

Authored by craig.topper on Feb 9 2022, 11:33 PM.

Details

Summary

Part of the shift lowering creates a (sub XLEN-1, ShAmt). When this
value is used we know that ShAmt is [0..XLEN-1]. Since XLEN is a power
of 2 we can replace the sub with an xor. This allows us to use XORI
instead of LI+SUB.

Diff Detail