[AArch64][CodeGen] Remove redundant vector negations before concat
authorBenjamin Maxwell <benjamin.maxwell@arm.com>
Wed, 16 Nov 2022 10:45:48 +0000 (10:45 +0000)
committerCullen Rhodes <cullen.rhodes@arm.com>
Wed, 16 Nov 2022 11:17:07 +0000 (11:17 +0000)
commit18149218939774b5eac228adc5c3958fbaac9028
treeb87387adb1f7bec136243a27ba5a722ad98b3068
parent5ea7b6b78ff6c7d914e0e9279a368966be5f13df
[AArch64][CodeGen] Remove redundant vector negations before concat

This adds a new canonicalization rule to replace concats of truncated
negations with a negation of the concatenated truncates, e.g.

    (concat_vectors (v4i16 (truncate (not (v4i32)))),
                    (v4i16 (truncate (not (v4i32)))))
   ->
    (not (concat_vectors (v4i16 (truncate (v4i32))),
                         (v4i16 (truncate (v4i32)))))

Doing this allows avoiding redundant negations being emitted in
certain cases.

Reviewed By: peterwaller-arm

Differential Revision: https://reviews.llvm.org/D137433
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/illegal-floating-point-vector-compares.ll
llvm/test/CodeGen/AArch64/pull-negations-after-concat-of-truncates.ll [new file with mode: 0644]