This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix finding reg-sets of call insn in collect_fn_hard_reg_usage


On 19-06-14 18:40, Richard Henderson wrote:
On 06/19/2014 09:07 AM, Tom de Vries wrote:

2014-06-19  Tom de Vries  <tom@codesourcery.com>

	* final.c (collect_fn_hard_reg_usage): Add separate IOR_HARD_REG_SET for
	get_call_reg_set_usage.

Ok, as far as it goes, but...

It seems like there should be quite a bit of overlap with regs_ever_live here.
  How much of that previous computation can we leverage?

It appears that regs_ever_live includes any register mentioned explicitly, and
thus the only registers it doesn't contain are those killed by the callees.
That should be an easier scan than the rtl, since we have those already
collected in the cgraph.

Sorry I wasn't paying much attention earlier when this was first posted, when
questions like this may have been answered.


Richard,

At the moment, collect_fn_hard_reg_usage is run in pass_final, after final (), that is, after the final splitting of insns. The idea is that we use the most final representation available, to be on the safe side.

AFAIU, the regs_ever_live information is computed using the df infrastructure, which requires the cfg, which is available only until pass_free_cfg for all targets (more details in this discussion: https://gcc.gnu.org/ml/gcc-patches/2013-05/msg01060.html ). I don't think regs_ever_live is guaranteed to be up to date afterwards.

So in order to known whether it's safe and optimal to use regs_ever_live instead, the question is whether the passes after pass_free_cfg (are allowed to) add or remove sets or clobbers of call_really_used_regs. I don't know the full answer there.

Eric, can you comment?

Thanks,
- Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]