[PATCH] D91921: [ARM] Introduce MVETRUNC ISel lowering

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 21 12:17:47 PST 2020


dmgreen created this revision.
dmgreen added reviewers: SjoerdMeijer, samtebbs, simon_tatham, efriedma, ostannard.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
Herald added a project: LLVM.
dmgreen requested review of this revision.

Currently, when encountering store(trunc(..)) where the trunc is double a legal vector in MVE, we spilt the node into two different stores each performing half of the trunc from the wider type.  This works well for efficiently lowering widen than legal types (else the trunc becomes a series of individual lane moves). Unfortunately this splitting is currently one of the first combines attempted, so can happen before any other combines, which might be more preferable.

This patch instead introduces the concept of a MVETRUNC ISel node that the trunk is initially lowered to, to keep it intact as a single item as opposed to splitting it up. This allows us to push the store(trunc(..)) combine later, allowing other optimisations to potentially happen on the trunc first. The store(trunc(..)) splitting can then be done later in the legalisation period if needed, or else fall back to a buildvector as before.

Some extra combines are added to keep all the existing tests happy. This is perhaps not the most elegant thing in the world, but does help as can be seen some of the tests. It can also possibly be extended in the future to lower to a stack load/store, which may be more efficient than the expanding at the expense of a stack slot.


https://reviews.llvm.org/D91921

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMISelLowering.h
  llvm/test/CodeGen/Thumb2/mve-vhadd.ll
  llvm/test/CodeGen/Thumb2/mve-vmovn.ll
  llvm/test/CodeGen/Thumb2/mve-vmulh.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91921.306868.patch
Type: text/x-patch
Size: 31677 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201121/da1d62d3/attachment-0001.bin>


More information about the llvm-commits mailing list