diff options
author | Martin Jambor <mjambor@suse.cz> | 2025-04-14 14:21:15 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2025-04-14 14:39:47 +0200 |
commit | 6b6611f81476b6375c90859d85331c2981a2ce51 (patch) | |
tree | 5406aaccae7a5abe0df85a6efe0ab16b16efd78b /gcc/rust/rust-gcc.cc | |
parent | 4f19487f2606d25516d31f0279101deea9772da4 (diff) | |
download | gcc-6b6611f81476b6375c90859d85331c2981a2ce51.zip gcc-6b6611f81476b6375c90859d85331c2981a2ce51.tar.gz gcc-6b6611f81476b6375c90859d85331c2981a2ce51.tar.bz2 |
ipa-cp: Use the collected pass-through types to propgate constants (PR118097)
This patch revisits the fix for PR 118097 and instead of deducing the
necessary operation type it just uses the value collected and streamed
by an earlier patch.
It is bigger than the ones for propagating value ranges and known bits
because we track constants both in parameters themselves and also in
memory they point to or within aggregates, we clone functions for them
and we do fancy things for some types of recursive calls.
In the case of constants in aggregates or passed by reference, the
situation should not change because the code creating jump functions
for them does not allow type-casts, unlike for the plain ones.
However, this patch changes how we handle them for the sake of
consistency and also so that we can try and eliminate this limitation
in the next stage 1.
gcc/ChangeLog:
2025-03-20 Martin Jambor <mjambor@suse.cz>
PR ipa/118097
* ipa-cp.cc (ipa_get_jf_arith_result): Require res_operand for
anything except NOP_EXPR or ADDR_EXPR, document it and remove the code
trying to deduce it.
(ipa_value_from_jfunc): Use the stored and streamed type of arithmetic
pass-through functions.
(ipa_agg_value_from_jfunc): Use the stored and streamed type of
arithmetic pass-through functions, convert to the type used to store
the value if necessary.
(get_val_across_arith_op): New parameter op_type, pass it to
ipa_get_jf_arith_result.
(propagate_vals_across_arith_jfunc): New parameter op_type, pass it to
get_val_across_arith_op.
(propagate_vals_across_pass_through): Use the stored and streamed type
of arithmetic pass-through functions.
(propagate_aggregate_lattice): Likewise.
(push_agg_values_for_index_from_edge): Use the stored and streamed
type of arithmetic pass-through functions, convert to the type used to
store the value if necessary.
Diffstat (limited to 'gcc/rust/rust-gcc.cc')
0 files changed, 0 insertions, 0 deletions