This is the mail archive of the
mailing list for the GCC project.
Re: [RFC][PR89245] Check REG_CALL_DECL note during the tail-merging
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Dragan Mladjenovic <dmladjenovic at wavecomp dot com>
- Cc: "gcc-patches\@gcc.gnu.org" <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>, Jeff Law <law at redhat dot com>
- Date: Mon, 08 Jul 2019 21:38:22 +0100
- Subject: Re: [RFC][PR89245] Check REG_CALL_DECL note during the tail-merging
- References: <firstname.lastname@example.org>
Dragan Mladjenovic <email@example.com> writes:
> From: "Dragan Mladjenovic" <firstname.lastname@example.org>
> This patch prevents merging of CALL instructions that that have different
> REG_CALL_DECL notes attached to them.
> On most architectures this is not an important distinction. Usually instruction patterns
> for calls to different functions reference different SYMBOL_REF-s, so they won't match.
> On MIPS PIC calls get split into an got_load/*call_internal pair where the latter represents
> indirect register call w/o SYMBOL_REF attached (until machine_reorg pass). The bugzilla issue
> had such two internal_call-s merged despite the fact that they had different register usage
> information assigned by ipa-ra.
> The check could be improved by checking if ipa-ra has actually assigned two different
> register sets for two functions involved, but I chose to only do a quick rtx_equal check.
Yeah, I think doing it that would be better (and maybe simpler?).
It should just be a case of:
get_call_reg_set_usage (i1, &i1_used_regs, call_used_reg_set);
get_call_reg_set_usage (i2, &i2_used_regs, call_used_reg_set);
and then checking that i1_used_regs and i2_used_regs are equal.