[Thumb2][MVE] Recognise shuffle truncation patterns suitable for ARMISD::MVETRUNC
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 16 Jan 2023 17:59:38 +0000 (17:59 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 16 Jan 2023 17:59:45 +0000 (17:59 +0000)
commitf4f8f9f18590d6fdf531bb9d6981a6081a244d33
tree6b419b0648137853d00030bfe8e2146b3421ca1e
parentdedc58da49c7a9d059cc4364ce737f6c7dc15569
[Thumb2][MVE] Recognise shuffle truncation patterns suitable for ARMISD::MVETRUNC

I'm helping with the remaining regressions on D127115, and one of my candidate fixes caused some regressions with MVE interleaved shuffles due to poor handling of 'truncation' style shuffle masks (0,2,4,6,...).

This patch attempts to use the ARMISD::MVETRUNC node to handle these cases, based off existing code in LowerTruncate.

It handles both (0,2,4,6,...) and (1,3,5,7,....) 'top' style patterns (assuming no endian problems). I shift down the 'top' patterns - a basic search of ARM docs suggests MVE has some top/bottom truncation/narrowing instructions but I don't seem to be able to get them to be used.

Differential Revision: https://reviews.llvm.org/D141791
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/Thumb2/LowOverheadLoops/mve-float-loops.ll
llvm/test/CodeGen/Thumb2/mve-shuffle.ll
llvm/test/CodeGen/Thumb2/mve-vld2.ll
llvm/test/CodeGen/Thumb2/mve-vld4.ll
llvm/test/CodeGen/Thumb2/mve-vqdmulh-minmax.ll
llvm/test/CodeGen/Thumb2/mve-vqdmulh.ll
llvm/test/CodeGen/Thumb2/mve-widen-narrow.ll