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

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 05:59:03 PDT 2020


paulwalker-arm created this revision.
Herald added subscribers: llvm-commits, steven.zhang, psnobl, hiraditya, tschuett.
Herald added a reviewer: rengolin.
Herald added a reviewer: efriedma.
Herald added a project: LLVM.
paulwalker-arm requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86450

Files:
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AArch64/sve-fixed-length-subvector.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86450.287362.patch
Type: text/x-patch
Size: 7002 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200824/d9d440e0/attachment.bin>


More information about the llvm-commits mailing list