This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Always select (and (srl X, C), Mask) as (srli (slli X, C2), C3).
ClosedPublic

Authored by craig.topper on Apr 7 2022, 1:32 PM.

Details

Summary

SLLI is always compressible to C.SLLI as long as the source and dest
register is the same.

ANDI and SRLI are only compressible if the register is x8-x15. By
using SLLI we have a better chance of generating shorter code.

I had to exclude one exclusion for the BEXTI case so that it's
pattern match could still fire.

Diff Detail

Event Timeline

craig.topper created this revision.Apr 7 2022, 1:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 1:32 PM
craig.topper requested review of this revision.Apr 7 2022, 1:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 1:32 PM
This revision is now accepted and ready to land.Apr 7 2022, 3:38 PM
This revision was landed with ongoing or failed builds.Apr 8 2022, 9:09 AM
This revision was automatically updated to reflect the committed changes.