[ARM] Extra MVE select(binop) patterns
authorDavid Green <david.green@arm.com>
Wed, 22 Jul 2020 13:08:29 +0000 (14:08 +0100)
committerDavid Green <david.green@arm.com>
Wed, 22 Jul 2020 13:08:29 +0000 (14:08 +0100)
commitf8abecf3379de841c436f353f060929722af8602
tree807c4de4f68d5d2962ba5ca0525b5109e136dad5
parent98b56c09be002855df18dada7debdb1322aad7d9
[ARM] Extra MVE select(binop) patterns

This is very similar to 243970d03cace2, but handling a slightly
different form of predicated operations. When starting with a pattern of
the form select(p, BinOp(x, y), x), Instcombine will often transform
this to BinOp(x, select(p, y, 0)), where 0 is the identity value of the
binop (0 for adds/subs, 1 for muls, -1 for ands etc). This adds the
patterns that transforms those back into predicated binary operations.

There is also a very minor adjustment to tablegen null_frag in here, to
allow it to also be recognized as a PatLeaf node, so that it can be used
in MVE_TwoOpPattern to easily exclude the cases where we do not need the
alternate transform.

Differential Revision: https://reviews.llvm.org/D84091
llvm/lib/Target/ARM/ARMInstrInfo.td
llvm/lib/Target/ARM/ARMInstrMVE.td
llvm/lib/Target/ARM/ARMInstrNEON.td
llvm/test/CodeGen/Thumb2/mve-pred-selectop3.ll
llvm/test/CodeGen/Thumb2/mve-vecreduce-addpred.ll
llvm/test/CodeGen/Thumb2/mve-vecreduce-mlapred.ll
llvm/utils/TableGen/CodeGenDAGPatterns.cpp