This is the mail archive of the 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);


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

Kenner, any idea what it was for?


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