diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-09-26 23:25:17 +0000 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2025-05-07 14:33:06 +0000 |
commit | d884e9c5c746a41b069905f990fa72b9e550cccc (patch) | |
tree | ad5743e371edcb3eb5c0c909541e973fb9574f18 /libjava | |
parent | 8335fd561fa823d32556512c09dfce44463e8eaa (diff) | |
download | gcc-d884e9c5c746a41b069905f990fa72b9e550cccc.zip gcc-d884e9c5c746a41b069905f990fa72b9e550cccc.tar.gz gcc-d884e9c5c746a41b069905f990fa72b9e550cccc.tar.bz2 |
gimple: Add gimple_with_undefined_signed_overflow and use it [PR111276]
While looking into the ifcombine, I noticed that rewrite_to_defined_overflow
was rewriting already defined code. In the previous attempt at fixing this,
the review mentioned we should not be calling rewrite_to_defined_overflow
in those cases. The places which called rewrite_to_defined_overflow didn't
always check the lhs of the assignment. This fixes the problem by
introducing a helper function which is to be used before calling
rewrite_to_defined_overflow.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
PR tree-optimization/111276
* gimple-fold.cc (arith_code_with_undefined_signed_overflow): Make static.
(gimple_with_undefined_signed_overflow): New function.
* gimple-fold.h (arith_code_with_undefined_signed_overflow): Remove.
(gimple_with_undefined_signed_overflow): Add declaration.
* tree-if-conv.cc (if_convertible_gimple_assign_stmt_p): Use
gimple_with_undefined_signed_overflow instead of manually
checking lhs and the code of the stmt.
(predicate_statements): Likewise.
* tree-ssa-ifcombine.cc (ifcombine_rewrite_to_defined_overflow): Likewise.
* tree-ssa-loop-im.cc (move_computations_worker): Likewise.
* tree-ssa-reassoc.cc (update_range_test): Likewise. Reformat.
* tree-scalar-evolution.cc (final_value_replacement_loop): Use
gimple_with_undefined_signed_overflow instead of
arith_code_with_undefined_signed_overflow.
* tree-ssa-loop-split.cc (split_loop): Likewise.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'libjava')
0 files changed, 0 insertions, 0 deletions