Baffling USE in x86_64.ad

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Thu Jan 21 11:47:19 UTC 2016


Hi,

adlc scans the match rule and derives USE/DEF effects from that.
Then it adds in the effects from the effect() declaration, which are 
the same here.

So that line is superfluous.  

(I once cleaned up the effects in the ppc 
port and removed all these.  And we are expand-power-users :) )

Best regards,
  Goetz.


> -----Original Message-----
> From: hotspot-compiler-dev [mailto:hotspot-compiler-dev-
> bounces at openjdk.java.net] On Behalf Of Andrew Dinn
> Sent: Donnerstag, 21. Januar 2016 11:30
> To: Andrew Haley <aph at redhat.com>; hotspot compiler <hotspot-compiler-
> dev at openjdk.java.net>
> Subject: Re: Baffling USE in x86_64.ad
> 
> On 21/01/16 10:22, Andrew Haley wrote:
> > In this pattern:
> >
> > instruct compI_rReg(rFlagsReg cr, rRegI op1, rRegI op2)
> > %{
> >   match(Set cr (CmpI op1 op2));
> >   effect(DEF cr, USE op1, USE op2);
> >
> >   format %{ "cmpl    $op1, $op2" %}
> >   opcode(0x3B);  /* Opcode 3B /r */
> >   ins_encode(REX_reg_reg(op1, op2), OpcP, reg_reg(op1, op2));
> >   ins_pipe(ialu_cr_reg_reg);
> > %}
> >
> > why does the USE appear in the effect?  And the DEF?  The operands
> > appear in the match expression in the normal way, so I would have
> > thought the effect expression unnecessary.  It's this pattern: others
> > don't have the effect:
> 
> I am not certain of this but I note that the above rule is used for
> direct matching and also used for expansion. I believe the expansion
> process requires an effect declaration even though that effect is also
> implied by the match rule. There are many instruction definitions which
> are only used for matching and they have an effect declaration but no
> match declaration.
> 
> regards,
> 
> 
> Andrew Dinn
> -----------
> Senior Principal Software Engineer
> Red Hat UK Ltd
> Registered in UK and Wales under Company Registration No. 3798903
> Directors: Michael Cunningham (US), Michael O'Neill (Ireland), Paul
> Argiry (US)


More information about the hotspot-compiler-dev mailing list