[ARM] Remove reduce(shuffle) if all the lanes are used
authorDavid Green <david.green@arm.com>
Tue, 7 Feb 2023 10:44:35 +0000 (10:44 +0000)
committerDavid Green <david.green@arm.com>
Tue, 7 Feb 2023 10:44:35 +0000 (10:44 +0000)
commit734d113a6c88f216b9fe7b8b797006927e3167c6
treec7419bd8a142d33373e1ee09cbcd6b0534129393
parent1ae4bd83ce2ac9d8a32493bbc5612bc19c374a49
[ARM] Remove reduce(shuffle) if all the lanes are used

This looks for vaddv(shuffle) or vmlav(shuffle, shuffle), with a shuffle where
all the lanes are used once. Due to the reduction being commutative the shuffle
can be removed.

Differential Revision: https://reviews.llvm.org/D143382
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/Thumb2/mve-vecreduce-add-combine.ll