This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Convert neon_ushl and neon_sshl with positive constants to VSHL.
ClosedPublic

Authored by fhahn on Sep 24 2019, 3:09 AM.

Details

Summary

I think we should be able to use shl instead of sshl and ushl for
positive constant shift values, unless I am missing something.

We already have the machinery in place to ensure we only replace
nodes, if the shift value is positive and <= the element width.

This is a generalization of an earlier patch rL372565.

Event Timeline

fhahn created this revision.Sep 24 2019, 3:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2019, 3:10 AM
anemet added inline comments.Sep 24 2019, 2:50 PM
llvm/test/CodeGen/AArch64/arm64-vshift.ll
1341–1351

This does not seem like a good case for the transformation.

anemet added inline comments.Sep 24 2019, 2:52 PM
llvm/test/CodeGen/AArch64/arm64-vshift.ll
1341–1351

Or are you just checking a larger sequence than before?

fhahn marked an inline comment as done.Sep 24 2019, 3:09 PM
fhahn added inline comments.
llvm/test/CodeGen/AArch64/arm64-vshift.ll
1341–1351

Yep, it’s checking a larger sequence, to make sure the extends actually happen. Without this patch, we have to do the extend in a similar fashion.

anemet accepted this revision.Sep 24 2019, 3:13 PM

LGTM

This revision is now accepted and ready to land.Sep 24 2019, 3:13 PM
This revision was automatically updated to reflect the committed changes.