tool or option for viewing LIR nodes

Doug Simon doug.simon at oracle.com
Tue May 7 02:11:06 PDT 2013


On May 7, 2013, at 2:05 AM, "Venkatachalam, Vasanth" <Vasanth.Venkatachalam at amd.com> wrote:

> Thanks Doug, that worked. It would be helpful to document this for those of us who are new to the tool.
> I'm willing to take a stab at this if you like.

Sure. Send me some text and I'll add it to the wiki[1].

-Doug

[1] https://wiki.openjdk.java.net/display/Graal/Main

> 
> Vasanth
> 
> -----Original Message-----
> From: Doug Simon [mailto:doug.simon at oracle.com] 
> Sent: Monday, May 06, 2013 10:41 AM
> To: Venkatachalam, Vasanth
> Cc: graal-dev at openjdk.java.net
> Subject: Re: tool or option for viewing LIR nodes
> 
> 
> On May 6, 2013, at 5:29 PM, "Venkatachalam, Vasanth" <Vasanth.Venkatachalam at amd.com> wrote:
> 
>> Doug and Giles,
>> 
>> Here's the command line I'm using. 
>> 
>> tester at see-anna1:~/graalcloneinternal/graal$ ./mx.sh  --vm server  --java-home /home/tester/graal/jdk1.7.0_13/debug -G:Dump= -G:+PrintCFG unittest BasicHSAILTest
>>         ...
>> mx: error: unrecognized arguments: -G:Dump= -G:+PrintCFG
>> 
>> Can someone explain what I'm doing wrong here?
> 
> You want:
> 
> ./mx.sh  --vm server  --java-home /home/tester/graal/jdk1.7.0_13/debug unittest BasicHSAILTest @-G:Dump= @-G:+PrintCFG 
> 
> That is, the VM options need to come after the 'unit test' command specifier *and* they must be prefixed with '@'. Sorry for the complexity of this command - we are planning on unifying all mx commands to use the same (or at least a more unified) interface.
> 
> If the method you are particularly interested in is com.amd.Test.myTest(), then you should also add:
> 
> @-G:MethodFilter=myTest
> 
> or:
> 
> @-G:MethodFilter=Test.*
> 
> to dump traces for all methods in the Test class.
> 
> -Doug
> 
>> 
>> -----Original Message-----
>> From: Doug Simon [mailto:doug.simon at oracle.com]
>> Sent: Saturday, May 04, 2013 4:47 PM
>> To: Venkatachalam, Vasanth
>> Cc: graal-dev at openjdk.java.net
>> Subject: Re: tool or option for viewing LIR nodes
>> 
>> As Gilles says, the -G options should work under --vm server. It helps if you post the complete command line you are using to see if we can spot a problem.
>> 
>> -Doug
>> 
>> On May 4, 2013, at 10:02 PM, Gilles Duboscq <duboscq at ssw.jku.at> wrote:
>> 
>>> The server vm that contains Graal (--vm server) should definitely 
>>> pick up all -G options including -G:Dump= and -G:+PrintCFG.
>>> Since you are talking about unit tests i suppose you are using the 
>>> GraalCompilerTest's method to explicitly trigger compilation.
>>> 
>>> I don't know how you are structuring your tests but there are some 
>>> "Debug scopes" that need to be properly set up for these flags to 
>>> work. Normally if you just make your test a subclass of 
>>> GraalCompilerTest and then use its methods if should be fine.
>>> 
>>> 
>>> On Sat, May 4, 2013 at 2:30 AM, Vasanth Venkatachalam < 
>>> Vasanth.Venkatachalam at amd.com> wrote:
>>> 
>>>> Christian,
>>>> 
>>>> Some more context to my question.
>>>> 
>>>> I've added a Graal backend for HSAIL code generation. I'm debugging 
>>>> the codegen for a test case where running with the --vm server 
>>>> option produces some incorrect results.
>>>> Thus I'd like to view the nodes that are produced when running with 
>>>> the mx --vm server option.
>>>> 
>>>> It looks like the c1visualizer tool can't be used with --vm server. 
>>>> Is there another tool that can help?
>>>> 
>>>> I had a similar issue with the IdealGraphVisualizer. The -G:Dump= 
>>>> option isn't recognized when running with --vm server.
>>>> 
>>>> Vasanth
>>>> 
>>>> -----Original Message-----
>>>> From: graal-dev-bounces at openjdk.java.net [mailto:
>>>> graal-dev-bounces at openjdk.java.net] On Behalf Of Christian Wimmer
>>>> Sent: Friday, May 03, 2013 12:22 PM
>>>> To: graal-dev at openjdk.java.net
>>>> Subject: Re: tool or option for viewing LIR nodes
>>>> 
>>>> 
>>>> On 05/03/2013 09:23 AM, Venkatachalam, Vasanth wrote:
>>>>> Is there a tool or option that would allow us to view the LIR nodes 
>>>>> that
>>>> Graal generates for a program?
>>>> 
>>>> Yes.
>>>> 
>>>> Graal can output the graph, LIR, register allocator liveness 
>>>> information, and machine code in the format required by the Client Compiler Visualizer.
>>>> As the name implies, the tool was originally written to visualize 
>>>> the data structures of the Java HotSpot client compiler.
>>>> 
>>>> You can get it here: https://java.net/projects/c1visualizer/
>>>> 
>>>> The output is controlled the same ways as the output to the Ideal 
>>>> Graph Visualizer, i.e., the -G:Dump= flag.  In addition, I think you 
>>>> have to also pass -G:+PrintCFG
>>>> 
>>>> The tool is file-based, i.e., you get .cfg files in your working 
>>>> directory that you can load with the c1visualizer.
>>>> 
>>>> -Christian
>>>> 
>>>> 
>>>> 
>> 
>> 
>> 
> 
> 
> 



More information about the graal-dev mailing list