This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] narrowFunnelShift - fold trunc/zext or(shl(a,x),lshr(b,sub(bw,x))) -> fshl(a,b,x) (PR35155)
ClosedPublic

Authored by RKSimon on Oct 16 2020, 4:31 AM.

Details

Summary

As discussed on PR35155, this extends narrowFunnelShift (recently renamed from narrowRotate) to support basic funnel shift patterns.

Unlike matchFunnelShift we don't include the computeKnownBits limitation as extracting the pattern from the zext/trunc layers should be a indicator of reasonable funnel shift codegen, in D89139 we demonstrated how to efficiently promote funnel shifts to wider types.

Diff Detail

Event Timeline

RKSimon created this revision.Oct 16 2020, 4:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 16 2020, 4:31 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon requested review of this revision.Oct 16 2020, 4:31 AM
spatel accepted this revision.Oct 23 2020, 11:14 AM

LGTM

llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
592

shifted value -> shifted values

This revision is now accepted and ready to land.Oct 23 2020, 11:14 AM
This revision was landed with ongoing or failed builds.Oct 24 2020, 4:43 AM
This revision was automatically updated to reflect the committed changes.