diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2023-06-14 12:13:25 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2023-06-18 17:05:17 +0200 |
commit | 47fa3cef59a031f1b0fdce309ff634fab717606d (patch) | |
tree | 80280aaa71b46492063b7a4e5abd472b2ff8e711 /gcc/rtl.h | |
parent | 8a96f240d71d367a2955ab9e0f0fef3a0b0e2a74 (diff) | |
download | gcc-47fa3cef59a031f1b0fdce309ff634fab717606d.zip gcc-47fa3cef59a031f1b0fdce309ff634fab717606d.tar.gz gcc-47fa3cef59a031f1b0fdce309ff634fab717606d.tar.bz2 |
RTL: Merge rtx_equal_p and hash_rtx functions with their callback variants
Use default argument when callback function is not required to merge
rtx_equal_p and hash_rtx functions with their callback variants.
gcc/ChangeLog:
* cse.cc (hash_rtx_cb): Rename to hash_rtx.
(hash_rtx): Remove.
* early-remat.cc (remat_candidate_hasher::equal): Update
to call rtx_equal_p with rtx_equal_p_callback_function argument.
* rtl.cc (rtx_equal_p_cb): Rename to rtx_equal_p.
(rtx_equal_p): Remove.
* rtl.h (rtx_equal_p): Add rtx_equal_p_callback_function
argument with NULL default value.
(rtx_equal_p_cb): Remove function declaration.
(hash_rtx_cb): Ditto.
(hash_rtx): Add hash_rtx_callback_function argument
with NULL default value.
* sel-sched-ir.cc (free_nop_pool): Update function comment.
(skip_unspecs_callback): Ditto.
(vinsn_init): Update to call hash_rtx with
hash_rtx_callback_function argument.
(vinsn_equal_p): Ditto.
Diffstat (limited to 'gcc/rtl.h')
-rw-r--r-- | gcc/rtl.h | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -3008,7 +3008,12 @@ extern rtx copy_rtx_if_shared (rtx); /* In rtl.cc */ extern unsigned int rtx_size (const_rtx); extern rtx shallow_copy_rtx (const_rtx CXX_MEM_STAT_INFO); -extern int rtx_equal_p (const_rtx, const_rtx); + +typedef int (*rtx_equal_p_callback_function) (const_rtx *, const_rtx *, + rtx *, rtx *); +extern int rtx_equal_p (const_rtx, const_rtx, + rtx_equal_p_callback_function = NULL); + extern bool rtvec_all_equal_p (const_rtvec); extern bool rtvec_series_p (rtvec, int); @@ -3710,16 +3715,6 @@ typedef int (*for_each_inc_dec_fn) (rtx mem, rtx op, rtx dest, rtx src, rtx srcoff, void *arg); extern int for_each_inc_dec (rtx, for_each_inc_dec_fn, void *arg); -typedef int (*rtx_equal_p_callback_function) (const_rtx *, const_rtx *, - rtx *, rtx *); -extern int rtx_equal_p_cb (const_rtx, const_rtx, - rtx_equal_p_callback_function); - -typedef int (*hash_rtx_callback_function) (const_rtx, machine_mode, rtx *, - machine_mode *); -extern unsigned hash_rtx_cb (const_rtx, machine_mode, int *, int *, - bool, hash_rtx_callback_function); - extern rtx regno_use_in (unsigned int, rtx); extern bool auto_inc_p (const_rtx); extern bool in_insn_list_p (const rtx_insn_list *, const rtx_insn *); @@ -4142,7 +4137,11 @@ extern int rtx_to_tree_code (enum rtx_code); /* In cse.cc */ extern int delete_trivially_dead_insns (rtx_insn *, int); extern bool exp_equiv_p (const_rtx, const_rtx, int, bool); -extern unsigned hash_rtx (const_rtx x, machine_mode, int *, int *, bool); + +typedef int (*hash_rtx_callback_function) (const_rtx, machine_mode, rtx *, + machine_mode *); +extern unsigned hash_rtx (const_rtx, machine_mode, int *, int *, + bool, hash_rtx_callback_function = NULL); /* In dse.cc */ extern bool check_for_inc_dec (rtx_insn *insn); |