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 2/2] PR27313 Transform conditional stores


Hi,

On Tue, 15 May 2007, Tehila Meyzels wrote:

> Hi Michael,
> 
> Do you think this patch can be extended to conditional loads as well?

I think so.  Have you found it worthwhile somewhere?

> Does it seems a reasonable extension to your patch?

Seems like a natural extension, yes.  The problem as usual is the cost 
metric, as you're going to access memory more often.  In practice it 
doesn't seem to be a problem with stores (nearly only improvevements 
in spec2006), despite that Andrew is nervous about them.  I guess that's 
because only a very limited pattern is matched (namely that only exactly 
one store is allowed in the conditional block).  For loads this might be 
different, would require some testing.

> I'd like to get some opinions and suggestions.

The pattern to match would look like so:

  if (cond) goto L2; else goto L3;
L2:
  # VUSE <SMT.something>
  x_2 = *p;
L3:
  x_3 = PHI<x_1, x_2>

which would be transformed into

  x_2 = *p;
  if (cond) goto L2; else goto L3;
L2:
L3:
  x_3 = PHI<x_1, x_2>

I.e. you don't even need a new temporary.


Ciao,
Michael.


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