diff options
author | Jennifer Schmitz <jschmitz@nvidia.com> | 2024-09-17 00:15:38 -0700 |
---|---|---|
committer | Jennifer Schmitz <jschmitz@nvidia.com> | 2024-09-19 09:23:24 +0200 |
commit | 08aba2dd8c9390b6131cca0aac069f97eeddc9d2 (patch) | |
tree | 2b527b57cd661c0b5035853cea04ed25c792cbb5 /gcc/fortran | |
parent | 9a99559a478111f7fbeec29bd78344df7651c707 (diff) | |
download | gcc-08aba2dd8c9390b6131cca0aac069f97eeddc9d2.zip gcc-08aba2dd8c9390b6131cca0aac069f97eeddc9d2.tar.gz gcc-08aba2dd8c9390b6131cca0aac069f97eeddc9d2.tar.bz2 |
SVE intrinsics: Fold svmul with all-zero operands to zero vector
As recently implemented for svdiv, this patch folds svmul to a zero
vector if one of the operands is a zero vector. This transformation is
applied if at least one of the following conditions is met:
- the first operand is all zeros or
- the second operand is all zeros, and the predicate is ptrue or the
predication is _x or _z.
In contrast to constant folding, which was implemented in a previous
patch, this transformation is applied as soon as one of the operands is
a zero vector, while the other operand can be a variable.
The patch was bootstrapped and regtested on aarch64-linux-gnu, no regression.
OK for mainline?
Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
gcc/
* config/aarch64/aarch64-sve-builtins-base.cc (svmul_impl::fold):
Add folding of all-zero operands to zero vector.
gcc/testsuite/
* gcc.target/aarch64/sve/const_fold_mul_1.c: Adjust expected
outcome.
* gcc.target/aarch64/sve/fold_mul_zero.c: New test.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions