This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Add combine to narrow G_LSHR
ClosedPublic

Authored by arsenm on Feb 10 2020, 6:29 AM.

Details

Summary

Produce an unmerge to a narrower type and introduce a narrower shift
if needed. I wasn't sure if there was a better way to parameterize the
target's preferred shift type for the GICombineRule, so manually call
the combine helper.

Diff Detail

Event Timeline

arsenm created this revision.Feb 10 2020, 6:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2020, 6:29 AM
nhaehnle accepted this revision.Feb 16 2020, 9:54 AM

Some nits, but generally LGTM.

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
1405–1407

Please add a comment describing what this matches.

1448

This could use Narrowed instead of Unmerge.getReg(1).

This revision is now accepted and ready to land.Feb 16 2020, 9:54 AM
arsenm marked an inline comment as done.Feb 17 2020, 6:18 AM
arsenm added inline comments.
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
1405–1407

That would be redundant with the one on the declaration?