aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2025-04-14 14:21:15 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2025-04-14 14:39:39 +0200
commit4f19487f2606d25516d31f0279101deea9772da4 (patch)
tree05e9b8ff2fb1652288261cb045e7ec85a233e520 /gcc
parent044d0d1ee1a61c21670068485d4a250edfbb695a (diff)
downloadgcc-4f19487f2606d25516d31f0279101deea9772da4.zip
gcc-4f19487f2606d25516d31f0279101deea9772da4.tar.gz
gcc-4f19487f2606d25516d31f0279101deea9772da4.tar.bz2
ipa-cp: Use the stored and streamed pass-through types in ipa-vr (PR118785)
This patch revisits the fix for PR 118785 and intead of deducing the necessary operation type it just uses the value collected and streamed by an earlier patch. The main advantage is that we do not rely on expr_type_first_operand_type_p enumarating all operations. gcc/ChangeLog: 2025-03-20 Martin Jambor <mjambor@suse.cz> PR ipa/118785 * ipa-cp.cc (ipa_vr_intersect_with_arith_jfunc): Use the stored and streamed type of arithmetic pass-through functions.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ipa-cp.cc28
1 files changed, 2 insertions, 26 deletions
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index 637bc49..21033c6 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -1735,24 +1735,7 @@ ipa_vr_intersect_with_arith_jfunc (vrange &vr,
const value_range *inter_vr;
if (operation != NOP_EXPR)
{
- /* Since we construct arithmetic jump functions even when there is a
- type conversion in between the operation encoded in the jump
- function and when it is passed in a call argument, the IPA
- propagation phase must also perform the operation and conversion
- in two separate steps.
-
- TODO: In order to remove the use of expr_type_first_operand_type_p
- predicate we would need to stream the operation type, ideally
- encoding the whole jump function as a series of expr_eval_op
- structures. */
-
- tree operation_type;
- if (expr_type_first_operand_type_p (operation))
- operation_type = src_type;
- else if (operation == ABSU_EXPR)
- operation_type = unsigned_type_for (src_type);
- else
- return;
+ tree operation_type = ipa_get_jf_pass_through_op_type (jfunc);
op_res.set_varying (operation_type);
if (!ipa_vr_operation_and_type_effects (op_res, src_vr, operation,
operation_type, src_type))
@@ -1782,14 +1765,7 @@ ipa_vr_intersect_with_arith_jfunc (vrange &vr,
value_range op_vr (TREE_TYPE (operand));
ipa_get_range_from_ip_invariant (op_vr, operand, context_node);
- tree operation_type;
- if (TREE_CODE_CLASS (operation) == tcc_comparison)
- operation_type = boolean_type_node;
- else if (expr_type_first_operand_type_p (operation))
- operation_type = src_type;
- else
- return;
-
+ tree operation_type = ipa_get_jf_pass_through_op_type (jfunc);
value_range op_res (operation_type);
if (!ipa_vr_supported_type_p (operation_type)
|| !handler.operand_check_p (operation_type, src_type, op_vr.type ())