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/early-remat.cc | |
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/early-remat.cc')
-rw-r--r-- | gcc/early-remat.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/early-remat.cc b/gcc/early-remat.cc index 1ee63c7..93cef60 100644 --- a/gcc/early-remat.cc +++ b/gcc/early-remat.cc @@ -504,7 +504,7 @@ private: early_remat *early_remat::er; -/* rtx_equal_p_cb callback that treats any two SCRATCHes as equal. +/* rtx_equal_p callback that treats any two SCRATCHes as equal. This allows us to compare two copies of a pattern, even though their SCRATCHes are always distinct. */ @@ -534,10 +534,8 @@ remat_candidate_hasher::equal (const remat_candidate *cand1, { return (cand1->regno == cand2->regno && cand1->constant_p == cand2->constant_p - && (cand1->constant_p - ? rtx_equal_p (cand1->remat_rtx, cand2->remat_rtx) - : rtx_equal_p_cb (cand1->remat_rtx, cand2->remat_rtx, - scratch_equal)) + && rtx_equal_p (cand1->remat_rtx, cand2->remat_rtx, + cand1->constant_p ? NULL : scratch_equal) && (!cand1->uses || bitmap_equal_p (cand1->uses, cand2->uses))); } |