atch.pd: Allow scalar optimizations with bitwise AND/OR to apply to
vectors.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/vector-compare-5.c: Add new test for vector compare
simplification.
Signed-off-by: Icen Zeyada
---
gcc/match.pd | 19 +++--
fold to `false` in vector contexts or always true comparisons like
`(x <= y) || (x > y)`to fold to `true`.
Icen Zeyada (2):
tree-simplify: unify simple_comparison ops in vec_cond for bit and/or
[PR119196]
gimple-fold: extend vector simplification to match scalar bitwise
optimizati
subsequent transformations (e.g., folding the
comparisons if possible) can take effect.
PR tree-optimization/119196
gcc/ChangeLog:
* match.pd: Merge multiple vec_cond_expr in a single one for bit_and
and bit_ior.
Signed-off-by: Icen Zeyada
---
gcc/match.pd | 10 ++
1 file changed
atch.pd: Allow scalar optimizations with bitwise AND/OR to apply to
vectors.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/vector-compare-5.c: Add new test for vector compare
simplification.
Signed-off-by: Icen Zeyada
---
gcc/match.pd | 11 -
the AST so that subsequent transformations (e.g., folding the
comparisons if possible) can take effect.
PR tree-optimization/119196
gcc/ChangeLog:
* match.pd: Merge multiple vec_cond_expr in a single one for
bit_and, bit_ior and bit_xor.
Signed-off-by: Icen Zeyada
---
gcc
also enables contradictory comparisons like
`(x < y) && (x > y)` to fold to `false` in vector contexts or always true
comparisons like `(x <= y) || (x > y)`to fold to `true`.
Icen Zeyada (2):
tree-simplify: unify simple_comparison ops in vec_cond for bit
and/or/xor [PR1
19196
gcc/ChangeLog:
* match.pd: Allow scalar optimizations with bitwise AND/OR/XOR to apply
to vectors.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/vector-compare-5.c: Add new test for vector compare
simplification.
Signed-off-by: Icen Zeyada
---
ation to match
scalar bitwise optimizations [PR119196]
On Wed, 21 May 2025, Icen Zeyada wrote:
> Generalize existing scalar gimple_fold rules to apply the same
> bitwise comparison simplifications to vector types. Previously, an
> expression like
>
> (x <
19196
gcc/ChangeLog:
* match.pd: Allow scalar optimizations with bitwise AND/OR/XOR to apply
to vectors.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/vector-compare-5.c: Add new test for vector compare
simplification.
Signed-off-by: Icen Zeyada
---
)
(cmp x y) bit_ior (cmp x y)
(cmp x y) bit_xor (cmp x y)
```
Icen Zeyada (2):
tree-simplify: unify simple_comparison ops in vec_cond for bit
and/or/xor [PR119196]
gimple-fold: extend vector simplification to match scalar bitwise
optimizations [PR119196]
gcc/match.pd
the AST so that subsequent transformations (e.g., folding the
comparisons if possible) can take effect.
PR tree-optimization/119196
gcc/ChangeLog:
* match.pd: Merge multiple vec_cond_expr in a single one for
bit_and, bit_ior and bit_xor.
Signed-off-by: Icen Zeyada
---
gcc
From: Richard Biener
Sent: 08 July 2025 10:01
To: Icen Zeyada
Cc: gcc-patches@gcc.gnu.org ; jeffreya...@gmail.com
; i...@airs.com ; Richard Earnshaw
; pins...@gmail.com ; Victor Do
Nascimento ; Tamar Christina
Subject: Re: [PATCH v4 1/2] tree-simplify
the AST so that subsequent transformations (e.g., folding the
comparisons if possible) can take effect.
PR tree-optimization/119196
gcc/ChangeLog:
* match.pd: Merge multiple vec_cond_expr in a single one for
bit_and, bit_ior and bit_xor.
Signed-off-by: Icen Zeyada
---
gcc
.
---
This patch generalizes existing scalar bitwise comparison simplifications
to vector types by matching patterns of the form
```
(cmp x y) bit_and (cmp x y)
(cmp x y) bit_ior (cmp x y)
(cmp x y) bit_xor (cmp x y)
```
Icen Zeyada (2):
tree-simplify: unify simple_comparison ops
19196
gcc/ChangeLog:
* match.pd: Allow scalar optimizations with bitwise AND/OR/XOR to apply
to vectors.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/vector-compare-5.c: Add new test for vector compare
simplification.
Signed-off-by: Icen Zeyada
---
15 matches
Mail list logo