webrev to enable arraycopy support in hsail backend

Tom Rodriguez tom.rodriguez at oracle.com
Tue Jun 10 21:44:42 UTC 2014


On Jun 10, 2014, at 12:11 PM, Deneau, Tom <tom.deneau at amd.com> wrote:

> Christian --
> 
> Regarding the HSAIL tests being repurposed for CPU, I think with a little bit of work they could be used to compare say a server compile (C1 or C2) to a graal compile and make sure the results match.  Or is there already a framework for that kind of comparison?
> I admit I haven't spent much time looking at the non-hsail tests.

That’s a main point of running tests with a hosted version of graal vs a tiered graal.  You can compare the results of a graal compilation with a regular hotspot execution using the GraalCompiler.test* methods.  Testing array copy would be a little different since it modifies the arguments so you'd need separate copies of the arguments for the expected and actual calls and then compare them afterwards.  You might have to override some methods to perform the required checking but GraalCompilerTest is factored a bit with many of the methods being protected for just this reason.

tom

> 
> -- Tom
> 
> From: Christian Thalinger [mailto:christian.thalinger at oracle.com]
> Sent: Tuesday, June 10, 2014 12:27 PM
> To: Deneau, Tom
> Cc: graal-dev at openjdk.java.net
> Subject: Re: webrev to enable arraycopy support in hsail backend
> 
> graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotReplacementsImpl.java
> 
> 
> +        // Register the special arraycopy snippet handling
> 
> +        // This basically ignores the sense of the CallArrayCopy flag
> 
> +        // and always directs to the snippets from UnsafeArrayCopyNode
> 
> Can you change this and other comments to multi-line comments?  Otherwise it looks good.
> 
> A general question:  HSAIL has a lot of tests.  Is there any way to make them common tests so that they are executed on CPUs and GPUs?
> 
> 
> On Jun 10, 2014, at 7:47 AM, Deneau, Tom <tom.deneau at amd.com<mailto:tom.deneau at amd.com>> wrote:
> 
> 
> I placed a small webrev up at
> http://cr.openjdk.java.net/~tdeneau/graal-webrevs/webrev-hsail-arraycopy-support/webrev/
> 
> The purpose is to allow System.arraycopy (or at least most flavors of it) to be used in hsail kernels.  Note that even if kernels do not use it directly, System.arrayCopy is used in many JDK routines, for example Stringbuilder.append(), ArrayList.get, etc.  One flavor that is not supported yet is for example an Object array copy where the destination is a superclass of the source.
> 
> The changes to HSAILHotSpotReplacementsImpl.java is just a way to take the non-foreign-call path (which hsail kernels cannot handle) regardless of the sense of the global flag CallArrayCopy (default true).
> 
> The rest of the webrev is either new specific arraycopy tests, or enabling of some tests that were previously ignored because they needed arraycopy support.
> 
> -- Tom
> 



More information about the graal-dev mailing list