Graal generated assembly much larger than C2

Carl M java at rkive.org
Mon May 27 19:45:59 UTC 2019


Hi Thomas,

I retried using 13-ea+22 (previously 11.0.2)   and found that while the generated code is smaller, a lot of the Flags I passed don't seem to work anymore.  The bytecode is not interleaved in the generated assembly any more (I don't know which flag sets this) and the -XX:PrintAssemblyOptions=intel flag no longer seems to work.  I also tried this on a non-Graal benchmark run, and it had the same problem.  Perhaps something wrong in 13?

The code that was produced was a little smaller (364 -> 346 bytes).  The generated (un-annotated assembly) is here:  
https://gist.github.com/carl-mastrangelo/7f1def204ae5d6e76268cc42b8c1af45

I haven't tried limiting the benchmark to just setOpaque, since I can't see the bytecode interleaved (to confirm it's doing what I think it is).


> On May 27, 2019 at 9:09 AM Thomas Wuerthinger <thomas.wuerthinger at oracle.com> wrote:
> 
> 
> Hi Carl,
> 
> Can you further reduce this test case to one VarHandle#setOpaque call?
> 
> It is likely that there is a wrong intrinsification of either VarHandle#setOpaque, VarHandle#setRelease, or VarHandle#storeStoreFence. Not much to do for the compiler overall here as the code only consists of special case intrinsics.
> 
> Also, does this also run on the latest JDK13 EA? The version of the compiler in JDK11 is not the latest one.
> 
> 
> * thomas
> 
> 
> > On 27 May 2019, at 00:21, Carl M <java at rkive.org> wrote:
> > 
> > Hi,
> > 
> > I am new to trying out Graal, and found that it was much slower for 
> > a trivial benchmark I wrote. I was surprised that it was about 40%
> > slower, so I dumped the assembly and found it was much larger for
> > the Graal version. I collected a dump of the assembly, but I am not
> > much of a compiler person so I don't know what to do with it. 
> > 
> > Is this the right list to see if there is something wrong?
> > 
> > 
> > Assembly of each compiler (and JVM flags):
> > https://gist.github.com/carl-mastrangelo/5fe2f1f744c05ca20242cad9b5f7fb26
> > 
> > 
> > Source code inner loop:
> > https://github.com/carl-mastrangelo/perfmark/blob/b266d9494054b5a2d09bc62f7b234d693e2d5173/java9/src/main/java/io/perfmark/java9/VarHandleMarkHolder.java#L129


More information about the graal-dev mailing list