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: Speedup CSE by 5%


Kazu Hirata wrote:
Hi Jeff,


I understand all that.  However, if you look at the first call to
validate_change (inside an ASM_OPERANDS case) you'll see a case where
I think we can modify x without copying it first.


I think the proposed patch is actually safe. Consider
[...]
Just to make things clear, we might want to do something like this:

    case ASM_OPERANDS:
      if (insn)
	{
	  for (i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; i--)
	    validate_change (insn, &ASM_OPERANDS_INPUT (x, i),
			     fold_rtx (ASM_OPERANDS_INPUT (x, i), insn), 0);
	}
      break;

Agreed.


There are two possible reasons for the copy_rtx I can think of: either fold_rtx destructively modifies its input (which I shouldn't happen from what I can see), or we have RTL sharing issues. In the latter case, we can postpone the copy until after we found that fold_rtx has made a change.

I did a bit of archaeology; the call to copy_rtx was introduced as part of a larger change by kenner in

http://savannah.gnu.org/cgi-bin/viewcvs/gcc/old-gcc/cse.c.diff?r1=1.165&r2=1.166

Kenner, any idea what it was for?


Bernd



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