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: [PATCH] Rename/export combine_insn_cost as insn_rtx_cost


On Fri, 16 Jul 2004, Zack Weinberg wrote:
> Unfortunately, p6 *is* call-clobbered on ia64.

I've just thought of an even cleverer work-around.

Instead we transform

	if (cond)
	{
	  call foo();
	  r1 = r35;
	}

into the equivalent.

	if (cond)
	  call foo ();
	else
	  r35 = r1;
	r1 = r35;

which we'd expand as

	(!cond).r35 = r1
	(cond).call foo()
	r1 = r35

i.e. we attempt to compensate for any instructions after a conditional
instruction that clobbers the condition codes, by inserting additional
code in the else clause (using the negated/inverted conditional earlier).


Not sure how general this is, or if its even valid with the IA64 ABI
(is r35 dead in this example?), but it would work around problems with
register allocation.  It might even be implementable in the ia64 backend
using the apppropriate splitters, peephole2s or composite patterns.

Roger
--


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