[DAGCombiner] Extend ISD::ABDS/U combine to handle more cases.
authorPaul Walker <paul.walker@arm.com>
Fri, 10 Dec 2021 18:05:38 +0000 (18:05 +0000)
committerPaul Walker <paul.walker@arm.com>
Thu, 17 Feb 2022 13:32:20 +0000 (13:32 +0000)
commit6457f42bde82fd9a514434c946b9d3fbe92a8619
tree1f18364fb9cf1442e5a950f98139c753a61b9b82
parent1a8bdf95a3361a90e49c96c3b4eaeda6462fe878
[DAGCombiner] Extend ISD::ABDS/U combine to handle more cases.

The current ABD combine doesn't quite work for SVE because only a
single scalable vector per scalar integer type is legal (e.g. for
i32, <vscale x 4 x i32> is the only legal scalable vector type).

This patch extends the combine to also trigger for the cases when
operand extension must be retained.

Differential Revision: https://reviews.llvm.org/D115739
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/neon-abd.ll
llvm/test/CodeGen/AArch64/sve-abd.ll
llvm/test/CodeGen/Thumb2/mve-vabdus.ll