aboutsummaryrefslogtreecommitdiff
path: root/libcpp/include/cpplib.h
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2020-11-12 19:56:07 +0100
committerMartin Jambor <mjambor@suse.cz>2020-11-12 19:56:07 +0100
commitb86aedb0cc083efe712e530a723f1237051a6b56 (patch)
tree20275824dd3a397b3b5839f6a2a70bc550ea921d /libcpp/include/cpplib.h
parent876b45db81a708616d70b1ab66b71bd503809c21 (diff)
downloadgcc-b86aedb0cc083efe712e530a723f1237051a6b56.zip
gcc-b86aedb0cc083efe712e530a723f1237051a6b56.tar.gz
gcc-b86aedb0cc083efe712e530a723f1237051a6b56.tar.bz2
ipa-cp: Work with time benefits and frequencies in sreals
This patch converts the variables that hold time benefits and frequencies in IPA-CP from plain integers to sreals, avoiding the need to cap them to avoid overflows and also fixing a potential underflows. Size costs corresponding to individual constants are left as ints so that they do not take up too much space. Care must be taken that adding it up does not overflow, especially in the case of prop_size_cost, because in cases of extremely long chains of lattice dependencies it can overflow (e.g. in testsuite/gcc.dg/ipa/pr50744.c). The overall size is already tracked in long ints. gcc/ChangeLog: 2020-11-11 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (class ipcp_value_base): Change the type of local_time_benefit and prop_time_benefit to sreal. Adjust the constructor initializer. (ipcp_lattice::print): Dump sreals. (struct caller_statistics): Change the type of freq_sum to sreal. (gather_caller_stats): Work with sreal freq_sum. (incorporate_penalties): Work with sreal evaluation. (good_cloning_opportunity_p): Adjusted for sreal sreal time_benefit and freq_sum. Bail out if size_cost is INT_MAX. (perform_estimation_of_a_value): Work with sreal time_benefit. Avoid unnecessary capping. (estimate_local_effects): Pass sreal time benefit to good_cloning_opportunity_p without capping it. Adjust dumping. (safe_add): If there can be overflow, return INT_MAX. (propagate_effects): Work with sreal times. (get_info_about_necessary_edges): Work with sreal frequencies. (decide_about_value): Likewise and with sreal time benefits.
Diffstat (limited to 'libcpp/include/cpplib.h')
0 files changed, 0 insertions, 0 deletions