This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fix condition for "high-vector" DUP optimizations.
ClosedPublic

Authored by efriedma on Feb 6 2019, 4:13 PM.

Details

Summary

AArch64 NEON has a bunch of instructions with a "2" suffix that extract the top half of the source vectors, instead of the bottom half. We have some DAGCombines to try to take advantage of that. However, they assumed that any EXTRACT_VECTOR was extracting the high half of the vector in question.

This issue has apparently existed since the AArch64 backend was merged.

Fixes https://bugs.llvm.org/show_bug.cgi?id=40632 .

Diff Detail

Repository
rL LLVM

Event Timeline

efriedma created this revision.Feb 6 2019, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2019, 4:13 PM
fhahn accepted this revision.Feb 7 2019, 10:11 AM

LGTM, thanks!

This revision is now accepted and ready to land.Feb 7 2019, 10:11 AM
fhahn added a comment.Feb 7 2019, 1:14 PM

I think all those cases should also be covered by my recent sinking patch. I'll prepare a patch.

This revision was automatically updated to reflect the committed changes.

Yes, it probably makes sense to high vector extracts in some cases. Actually, for some loops, it might even make sense to introduce an extra shuffle outside the loop to avoid a high-vector extract inside the loop.