[ARM] Recognize "double extend" reduction patterns
authorDavid Green <david.green@arm.com>
Sat, 12 Sep 2020 12:51:42 +0000 (13:51 +0100)
committerDavid Green <david.green@arm.com>
Sat, 12 Sep 2020 12:51:42 +0000 (13:51 +0100)
commitc437446d90be17c3fe8a216a90ee442222f2fe9d
tree5cde0bb35c20fd90dda5c85a5446fe0f37270d55
parent36e2e2e12efb6b02ad07f502d61b9a95937edb08
[ARM] Recognize "double extend" reduction patterns

We can sometimes get code that does:
  xe = zext i16 x to i32
  ye = zext i16 y to i32
  m = mul i32 xe, ye
  me = zext i32 m to i64
  r = vecreduce.add(me)
This "double extend" can trip up the reduction identification, but
should give identical results.

This extends the pattern matching to handle them.

Differential Revision: https://reviews.llvm.org/D87276
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/Thumb2/mve-vecreduce-mla.ll
llvm/test/CodeGen/Thumb2/mve-vecreduce-mlapred.ll