aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace
diff options
context:
space:
mode:
authorEikansh Gupta <quic_eikagupt@quicinc.com>2024-05-22 23:28:48 +0530
committerAndrew Pinski <quic_apinski@quicinc.com>2024-07-17 09:58:11 -0700
commit44fcc1ca11e7ea35dc9fb25a5317346bc1eaf7b2 (patch)
tree2693948e2eb5da4739d727315a7e0423a8eda56d /libbacktrace
parent7c3287f3613210d4f98c8095bc739bea6582bfbb (diff)
downloadgcc-44fcc1ca11e7ea35dc9fb25a5317346bc1eaf7b2.zip
gcc-44fcc1ca11e7ea35dc9fb25a5317346bc1eaf7b2.tar.gz
gcc-44fcc1ca11e7ea35dc9fb25a5317346bc1eaf7b2.tar.bz2
MATCH: Simplify (a ? x : y) eq/ne (b ? x : y) [PR111150]
This patch adds match pattern for `(a ? x : y) eq/ne (b ? x : y)`. In forwprop1 pass, depending on the type of `a` and `b`, GCC produces `vec_cond` or `cond_expr`. Based on the observation that `(x != y)` is TRUE, the pattern can be optimized to produce `(a^b ? TRUE : FALSE)`. The patch adds match pattern for a, b: (a ? x : y) != (b ? x : y) --> (a^b) ? TRUE : FALSE (a ? x : y) == (b ? x : y) --> (a^b) ? FALSE : TRUE (a ? x : y) != (b ? y : x) --> (a^b) ? TRUE : FALSE (a ? x : y) == (b ? y : x) --> (a^b) ? FALSE : TRUE PR tree-optimization/111150 gcc/ChangeLog: * match.pd (`(a ? x : y) eq/ne (b ? x : y)`): New pattern. (`(a ? x : y) eq/ne (b ? y : x)`): New pattern. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr111150.c: New test. * gcc.dg/tree-ssa/pr111150-1.c: New test. * g++.dg/tree-ssa/pr111150.C: New test. Signed-off-by: Eikansh Gupta <quic_eikagupt@quicinc.com>
Diffstat (limited to 'libbacktrace')
0 files changed, 0 insertions, 0 deletions