This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Don't reorder subvector/binop sequences when the resulting binop is not legal.
ClosedPublic

Authored by paulwalker-arm on Aug 24 2020, 5:59 AM.

Details

Summary

When lowering fixed length vector operations for SVE the subvector
operations are used extensively to marshel data between scalable
and fixed-length vectors. This means that sequences like:

extract_subvec(binop(insert_subvec(a), insert_subvec(b)))

are very common. DAGCombine only checks if the resulting binop is
legal or can be custom lowered when undoing such sequences. When
it's custom lowering that is introducing them the result is an
infinite legalise->combine->legalise loop.

This patch extends the isOperationLegalOr... functions to include
a "LegalOnly" parameter to restrict the check to legal operations
only. Although isOperationLegal could be used it's common for
the affected code paths to be visited pre and post legalisation,
so the extra parameter keeps the code tidy.

Diff Detail