This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Widen G_ADD/G_MUL/G_OR/... element types if size < 8b
ClosedPublic

Authored by dzhidzhoev on Feb 1 2023, 12:13 PM.

Details

Summary

Widen element types of vector arguments of G_ADD, G_SUB, G_MUL, G_AND,
G_OR, G_XOR to the minumum supported size, in order to support vectors
of narrow types.

Diff Detail

Event Timeline

dzhidzhoev created this revision.Feb 1 2023, 12:13 PM
Herald added a project: Restricted Project. · View Herald Transcript
dzhidzhoev requested review of this revision.Feb 1 2023, 12:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2023, 12:13 PM
dzhidzhoev updated this revision to Diff 494282.Feb 2 2023, 6:15 AM

Clang-format'ted.

arsenm accepted this revision.Feb 2 2023, 1:28 PM
arsenm added inline comments.
llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir
317

Adding 3-vector cases always finds something broken, probably should add those for each of these

This revision is now accepted and ready to land.Feb 2 2023, 1:28 PM
dzhidzhoev updated this revision to Diff 495273.Feb 6 2023, 2:24 PM

Added tests for v3s1 type.
Put 'minScalarOrEltIf' legalization rules before 'moreElementsToNextPow2' rule
to avoid creation of vector operations with unclamped types that are not supported yet.

aemerson accepted this revision.Feb 6 2023, 2:32 PM

LGTM. It would be nice if we could refactor the legalizer to allow better re-use of these rule patterns but that's for another patch.

This revision was landed with ongoing or failed builds.Feb 6 2023, 2:34 PM
This revision was automatically updated to reflect the committed changes.

Fixed unnoticed error in legalize-or.mir CHECK lines.