This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fold (sext_inreg (fmv_x_anyexth X), i16) -> (fmv_x_signexth X).
ClosedPublic

Authored by craig.topper on Feb 3 2022, 11:42 PM.

Details

Summary

Add a new ISD opcode to represent the sign extending behavior of
vmv.x.h. Keep the previous anyext opcode to allow the existing
(fmv_x_anyexth (fmv_h_x X)) combine to keep working without needing
to generate a sign extend.

For fmv.x.w we are able to match the sext_inreg in an isel pattern,
but a 16-bit sext_inreg is lowered to a shift pair before isel. This
seemed like a larger match than we should do in isel.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 3 2022, 11:42 PM
craig.topper requested review of this revision.Feb 3 2022, 11:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2022, 11:42 PM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 5 2022, 12:50 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
craig.topper reopened this revision.Feb 5 2022, 12:51 PM

Committed by accident.

asb accepted this revision.Feb 24 2022, 4:03 AM

LGTM, thanks.

This revision is now accepted and ready to land.Feb 24 2022, 4:03 AM