[ARM] Add predicated add reduction patterns
authorDavid Green <david.green@arm.com>
Wed, 22 Jul 2020 16:30:02 +0000 (17:30 +0100)
committerDavid Green <david.green@arm.com>
Wed, 22 Jul 2020 16:30:02 +0000 (17:30 +0100)
commit8fa824d7a36d8570b857d5a13e83a532498557ed
treef81dda0f899d8eb5f292e5137b45346fccef843d
parent89e61e782b7366083efc6a3c8c54602ddf2dfe8b
[ARM] Add predicated add reduction patterns

Given a vecreduce.add(select(p, x, 0)), we can convert that to a
predicated vaddv, as the else value for the select is the identity
value, a zero. That is what this patch does for the vaddv, vaddva,
vaddlv and vaddlva instructions, copying the existing patterns to also
handle predication through a select.

Differential Revision: https://reviews.llvm.org/D84101
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/lib/Target/ARM/ARMISelLowering.h
llvm/lib/Target/ARM/ARMInstrMVE.td
llvm/test/CodeGen/Thumb2/mve-vecreduce-addpred.ll
llvm/test/CodeGen/Thumb2/mve-vecreduce-mlapred.ll