This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Combine G_SEXT_INREG + right shift -> G_SBFX
ClosedPublic

Authored by paquette on Mar 23 2021, 5:18 PM.

Details

Summary

Only handling the constant case right now, and no handling for truncs.

This is only done post-legalization for now. Once the legalizer knows how to decompose these back into shifts, this requirement can probably be removed.

Diff Detail

Event Timeline

paquette created this revision.Mar 23 2021, 5:18 PM
paquette requested review of this revision.Mar 23 2021, 5:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2021, 5:18 PM
Herald added a subscriber: wdng. · View Herald Transcript
This revision is now accepted and ready to land.Mar 23 2021, 10:03 PM
paquette updated this revision to Diff 333128.Mar 24 2021, 2:36 PM

I made this AArch64-specific for now.

Since G_UBFX/G_SBFX requires custom legalization, the legalization hooks in the CombinerHelper won't work for AArch64. Not sure what the best way to go about fixing that is.