This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Fix shift-by-imm patterns used by asr, lsl & lsr intrinsics.
ClosedPublic

Authored by paulwalker-arm on Aug 17 2020, 8:39 AM.

Details

Summary

Right shift patterns will no longer incorrectly accept a shift
amount of zero. At the same time they will allow larger shift
amounts that are now saturated to their upper bound.

Patterns have been extended to enable immediate forms for shifts
taking an arbitrary predicate.

This patch also unifies the code path for immediate parsing so the
i64 based shifts are no longer treated specially.

Diff Detail

Event Timeline

paulwalker-arm created this revision.Aug 17 2020, 8:39 AM
paulwalker-arm requested review of this revision.Aug 17 2020, 8:39 AM

This is something that has fallen out from my work to use immediate forms for fixed length vector shifts, which I thought worth doing first. I also plan to build upon it to clean up some of the sve2 intrinsics like the rounding shifts.

Clearly the lsl by #0 and lsr by >#bitwidth cases should not actually result in shift instructions but at least it's providing a route to better test the today's patterns.

efriedma accepted this revision.Aug 17 2020, 4:52 PM

Maybe add a testcase for lsl by zero, for completeness?

Otherwise LGTM. I like the way the patterns are structured.

This revision is now accepted and ready to land.Aug 17 2020, 4:52 PM
This revision was landed with ongoing or failed builds.Aug 18 2020, 3:43 AM
This revision was automatically updated to reflect the committed changes.