[PATCH] gimple-fold: extend vector simplification to match scalar bitwise optimizations [PR119196]

2025-05-12 Thread Icen Zeyada
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 +++--

[PATCH v2 0/2] tree-optimization: extend scalar comparison folding to vectors [PR119196]

2025-05-16 Thread Icen Zeyada
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

[PATCH v2 1/2] tree-simplify: unify simple_comparison ops in vec_cond for bit and/or [PR119196]

2025-05-16 Thread Icen Zeyada
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

[PATCH v2 2/2] gimple-fold: extend vector simplification to match scalar bitwise optimizations [PR119196]

2025-05-16 Thread Icen Zeyada
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 -

[PATCH v3 1/2] tree-simplify: unify simple_comparison ops in vec_cond for bit and/or/xor [PR119196]

2025-05-21 Thread Icen Zeyada
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

[PATCH v3 0/2] tree-optimization: extend scalar comparison folding to vectors [PR119196]

2025-05-21 Thread Icen Zeyada
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

[PATCH v3 2/2] gimple-fold: extend vector simplification to match scalar bitwise optimizations [PR119196]

2025-05-21 Thread Icen Zeyada
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 ---

Re: [PATCH v3 2/2] gimple-fold: extend vector simplification to match scalar bitwise optimizations [PR119196]

2025-05-28 Thread 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 <

[PATCH v5 2/2] gimple-fold: extend vector simplification to match scalar bitwise optimizations [PR119196]

2025-07-08 Thread Icen Zeyada
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 ---

[PATCH v5 0/2] tree-optimization: extend scalar comparison folding to vectors [PR119196]

2025-07-08 Thread 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

[PATCH v5 1/2] tree-simplify: unify simple_comparison ops in vec_cond for bit and/or/xor [PR119196]

2025-07-08 Thread Icen Zeyada
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

Re: [PATCH v4 1/2] tree-simplify: unify simple_comparison ops in vec_cond for bit and/or/xor [PR119196]

2025-07-08 Thread Icen Zeyada
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

[PATCH v4 1/2] tree-simplify: unify simple_comparison ops in vec_cond for bit and/or/xor [PR119196]

2025-07-03 Thread Icen Zeyada
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

[PATCH v4 0/2] tree-optimization: extend scalar comparison folding to vectors [PR119196]

2025-07-03 Thread Icen Zeyada
. --- 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

[PATCH v4 2/2] gimple-fold: extend vector simplification to match scalar bitwise optimizations [PR119196]

2025-07-03 Thread Icen Zeyada
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 ---