GCC Middle and Back End API Reference
|
#include <ipa-modref-tree.h>
Public Member Functions | |
bool | useful_p () const |
bool | useful_for_kill_p () const |
void | dump (FILE *out) |
bool | operator== (modref_access_node &a) const |
bool | range_info_useful_p () const |
tree | get_call_arg (const gcall *stmt) const |
bool | get_ao_ref (const gcall *stmt, class ao_ref *ref) const |
void | stream_out (struct output_block *ob) const |
Static Public Member Functions | |
static modref_access_node | stream_in (struct lto_input_block *ib) |
static int | insert (vec< modref_access_node, va_gc > *&accesses, modref_access_node a, size_t max_accesses, bool record_adjustments) |
static bool | insert_kill (vec< modref_access_node > &kills, modref_access_node &a, bool record_adjustments) |
Data Fields | |
poly_int64 | offset |
poly_int64 | size |
poly_int64 | max_size |
poly_int64 | parm_offset |
int | parm_index |
bool | parm_offset_known |
unsigned char | adjustments |
Private Member Functions | |
bool | contains (const modref_access_node &) const |
bool | contains_for_kills (const modref_access_node &) const |
void | update (poly_int64, poly_int64, poly_int64, poly_int64, bool) |
bool | update_for_kills (poly_int64, poly_int64, poly_int64, poly_int64, poly_int64, bool) |
bool | merge (const modref_access_node &, bool) |
bool | merge_for_kills (const modref_access_node &, bool) |
void | forced_merge (const modref_access_node &, bool) |
void | update2 (poly_int64, poly_int64, poly_int64, poly_int64, poly_int64, poly_int64, poly_int64, bool) |
bool | combined_offsets (const modref_access_node &, poly_int64 *, poly_int64 *, poly_int64 *) const |
Static Private Member Functions | |
static bool | closer_pair_p (const modref_access_node &, const modref_access_node &, const modref_access_node &, const modref_access_node &) |
static void | try_merge_with (vec< modref_access_node, va_gc > *&, size_t) |
Modref record accesses relative to function parameters. This is entry for single access specifying its base and access range. Accesses can be collected to boundedly sized arrays using modref_access_node::insert.
|
staticprivate |
Return true if A1 and B1 can be merged with lower information less than A2 and B2. Assume that no containment or lossless merging is possible.
References combined_offsets(), gcc_checking_assert, gcc_unreachable, known_ge, known_le, known_lt, max_size, parm_index, and parm_offset_known.
Referenced by insert().
|
private |
Given access nodes THIS and A, return true if they can be done with common parm_offsets. In this case return parm offset in new_parm_offset, new_offset which is start of range in THIS and new_aoffset that is start of range in A.
References a, gcc_checking_assert, known_le, offset, parm_offset, and parm_offset_known.
Referenced by closer_pair_p(), forced_merge(), merge(), and merge_for_kills().
|
private |
Return true A is a subaccess.
References a, known_le, max_size, MODREF_UNKNOWN_PARM, offset, parm_index, parm_offset, parm_offset_known, range_info_useful_p(), and size.
Referenced by forced_merge(), insert(), merge(), and try_merge_with().
|
private |
Return true A is a subkill.
References a, gcc_checking_assert, max_size, MODREF_UNKNOWN_PARM, offset, parm_index, parm_offset, parm_offset_known, and range_info_useful_p().
Referenced by insert_kill(), and merge_for_kills().
void modref_access_node::dump | ( | FILE * | out | ) |
Dump range to debug OUT.
References adjustments, gcc_unreachable, max_size, MODREF_GLOBAL_MEMORY_PARM, MODREF_STATIC_CHAIN_PARM, MODREF_UNKNOWN_PARM, offset, parm_index, parm_offset, parm_offset_known, print_dec(), range_info_useful_p(), SIGNED, and size.
|
private |
Merge in access A while losing precision.
References a, adjustments, combined_offsets(), contains(), gcc_checking_assert, max_size, merge(), MODREF_UNKNOWN_PARM, parm_index, parm_offset_known, range_info_useful_p(), size, and update2().
Return tree corresponding to parameter of the range in STMT.
References ao_ref_init_from_ptr_and_range(), get_call_arg(), max_size, offset, parm_offset, parm_offset_known, POINTER_TYPE_P, size, poly_int< N, C >::to_shwi(), and TREE_TYPE.
Return tree corresponding to parameter of the range in STMT.
References gcc_checking_assert, gimple_call_arg(), gimple_call_chain(), gimple_call_num_args(), MODREF_GLOBAL_MEMORY_PARM, MODREF_STATIC_CHAIN_PARM, MODREF_UNKNOWN_PARM, NULL, and parm_index.
Referenced by get_ao_ref().
|
static |
Insert access with OFFSET and SIZE. Collapse tree if it has more than MAX_ACCESSES entries. If RECORD_ADJUSTMENTs is true avoid too many interval extensions. Return true if record was changed. Return 0 if nothing changed, 1 if insert was successful and -1 if entries should be collapsed.
References a, closer_pair_p(), contains(), dump_file, FOR_EACH_VEC_SAFE_ELT, gcc_assert, gcc_checking_assert, i, i2, insert(), merge(), parm_index, parm_offset_known, try_merge_with(), update(), useful_p(), and vec_safe_push().
Referenced by modref_ref_node< T >::insert_access().
|
static |
Insert new kill A into KILLS. If RECORD_ADJUSTMENTS is true limit number of changes to each entry. Return true if something changed.
References a, contains_for_kills(), dump_file, FOR_EACH_VEC_ELT, gcc_checking_assert, i, merge(), and merge_for_kills().
|
private |
Merge in access A if it is possible to do without losing precision. Return true if successful. If RECORD_ADJUSTMENTs is true, remember how many interval was prolonged and punt when there are too many.
References a, combined_offsets(), contains(), gcc_checking_assert, known_eq, known_ge, known_le, known_lt, max_size, MODREF_UNKNOWN_PARM, parm_index, parm_offset_known, range_info_useful_p(), size, update(), and update2().
Referenced by forced_merge(), insert(), insert_kill(), and try_merge_with().
|
private |
Merge in access A if it is possible to do without losing precision. Return true if successful. Unlike merge assume that both accesses are always executed and merge size the same was as max_size.
References a, combined_offsets(), contains_for_kills(), gcc_checking_assert, known_ge, known_le, max_size, parm_index, update_for_kills(), and useful_for_kill_p().
Referenced by insert_kill().
bool modref_access_node::operator== | ( | modref_access_node & | a | ) | const |
Data structure for the modref pass. Copyright (C) 2020-2025 Free Software Foundation, Inc. Contributed by David Cepelik and Jan Hubicka This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Return true if both accesses are the same.
References a, known_eq, max_size, MODREF_GLOBAL_MEMORY_PARM, MODREF_UNKNOWN_PARM, offset, parm_index, parm_offset, parm_offset_known, range_info_useful_p(), and size.
bool modref_access_node::range_info_useful_p | ( | ) | const |
Return true if range info is useful.
References known_ge, max_size, MODREF_GLOBAL_MEMORY_PARM, MODREF_UNKNOWN_PARM, offset, parm_index, parm_offset_known, and size.
Referenced by contains(), contains_for_kills(), dump(), forced_merge(), merge(), and operator==().
|
static |
void modref_access_node::stream_out | ( | struct output_block * | ob | ) | const |
Stream out to OB.
References max_size, MODREF_UNKNOWN_PARM, offset, parm_index, parm_offset, parm_offset_known, size, streamer_write_hwi(), streamer_write_poly_int64(), and streamer_write_uhwi().
|
staticprivate |
Try to optimize the access ACCESSES list after entry INDEX was modified.
References a, contains(), gcc_checking_assert, i, and merge().
Referenced by insert().
|
private |
Update access range to new parameters. If RECORD_ADJUSTMENTS is true, record number of changes in the access and if threshold is exceeded start dropping precision so only constantly many updates are possible. This makes dataflow to converge.
References adjustments, dump_file, known_eq, max_size, offset, parm_offset, parm_offset_known, and size.
|
private |
Merge two ranges both starting at parm_offset1 and update THIS with result.
References gcc_checking_assert, gcc_unreachable, known_le, poly_int< N, C >::to_shwi(), and update().
Referenced by forced_merge(), and merge().
|
private |
Merge two ranges both starting at parm_offset1 and update THIS with result.
References adjustments, gcc_checking_assert, gcc_unreachable, known_eq, known_le, max_size, offset, parm_offset, size, and useful_for_kill_p().
Referenced by merge_for_kills().
|
inline |
References known_eq, known_gt, max_size, MODREF_GLOBAL_MEMORY_PARM, MODREF_RETSLOT_PARM, MODREF_UNKNOWN_PARM, parm_index, parm_offset_known, and size.
Referenced by merge_for_kills(), and update_for_kills().
|
inline |
References MODREF_UNKNOWN_PARM, and parm_index.
Referenced by insert().
unsigned char modref_access_node::adjustments |
Referenced by dump(), forced_merge(), update(), and update_for_kills().
poly_int64 modref_access_node::max_size |
poly_int64 modref_access_node::offset |
Referenced by combined_offsets(), contains(), contains_for_kills(), dump(), get_ao_ref(), operator==(), range_info_useful_p(), stream_in(), stream_out(), update(), and update_for_kills().
int modref_access_node::parm_index |
Referenced by closer_pair_p(), contains(), contains_for_kills(), dump(), forced_merge(), get_call_arg(), modref_tree< tree >::global_access_p(), insert(), merge(), merge_for_kills(), operator==(), range_info_useful_p(), modref_tree< tree >::remap_params(), stream_in(), stream_out(), useful_for_kill_p(), and useful_p().
poly_int64 modref_access_node::parm_offset |
Referenced by combined_offsets(), contains(), contains_for_kills(), dump(), get_ao_ref(), operator==(), stream_in(), stream_out(), update(), and update_for_kills().
bool modref_access_node::parm_offset_known |
poly_int64 modref_access_node::size |
Referenced by contains(), dump(), forced_merge(), get_ao_ref(), merge(), operator==(), range_info_useful_p(), stream_in(), stream_out(), update(), update_for_kills(), and useful_for_kill_p().