[AArch64] Reassociate sub(x, add(m1, m2)) to sub(sub(x, m1), m2)
authorDavid Green <david.green@arm.com>
Fri, 10 Feb 2023 18:09:11 +0000 (18:09 +0000)
committerDavid Green <david.green@arm.com>
Fri, 10 Feb 2023 18:09:11 +0000 (18:09 +0000)
commitc52255d26a23df6ecf09f60ca3e3615467f16bbe
treefd4eb57e6922e783018f4e8bd7806d96c99cde29
parentd37a31cf237cb4f8a18b12c91a9204feca5900ef
[AArch64] Reassociate sub(x, add(m1, m2)) to sub(sub(x, m1), m2)

The mid end will reassociate sub(sub(x, m1), m2) to sub(x, add(m1, m2)). This
reassociates it back to allow the creation of more mls instructions.

Differential Revision: https://reviews.llvm.org/D143143
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/arm64-vmul.ll
llvm/test/CodeGen/AArch64/reassocmls.ll