]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Remove redundant zeroing/merging in SVE intrinsics [PR106326]
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 27 Nov 2023 14:44:02 +0000 (14:44 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 27 Nov 2023 14:44:02 +0000 (14:44 +0000)
commite09007308c96a036a4a4e6fd4d6c09442b4c4420
treeb2ad14b739bf91c0627b1f0ea0a3bed98d8d1b1c
parent31e9074977bb7de83fa5d28d286323987d5d87f2
aarch64: Remove redundant zeroing/merging in SVE intrinsics [PR106326]

Many predicated SVE intrinsics provide three forms of predication:
zeroing, merging, and any/dont-care.  All three are equivalent when
the predicate is all-true, so this patch drops the zeroing and
merging in that case.

gcc/
PR target/106326
* config/aarch64/aarch64-sve-builtins.h (is_ptrue): Declare.
* config/aarch64/aarch64-sve-builtins.cc (is_ptrue): New function.
(gimple_folder::redirect_pred_x): Likewise.
(gimple_folder::fold): Use it.

gcc/testsuite/
PR target/106326
* gcc.target/aarch64/sve/acle/general/pr106326_1.c: New test.
gcc/config/aarch64/aarch64-sve-builtins.cc
gcc/config/aarch64/aarch64-sve-builtins.h
gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr106326_1.c [new file with mode: 0644]