pro64-support
[Top] [All Lists]

Re: a question about the whirl node instruction.

To: Peng Zhao <pengzhao@xxxxxxxxxxxxxx>
Subject: Re: a question about the whirl node instruction.
From: Chandrasekhar Murthy <murthy@xxxxxxx>
Date: Mon, 26 Mar 2001 07:48:03 -0800
Cc: sgi <pro64-support@xxxxxxxxxxx>
References: <Pine.LNX.4.21.0103231921360.17215-100000@peers.cs.ualberta.ca>
Sender: owner-pro64-support@xxxxxxxxxxx
Peng Zhao wrote:
> 
> HI,
> 
>         I have some question about the meaning of the instructions of the
> whirl IR, e.g. following is one line taken from the result of
> "ir_b2a xxx.I", it simplements "i++"
> 

I usually use the -st2 option on ir_b2a to also get the symbol table
dump.

For <2,2,i>, the first 2 gives the nesting level of the symbol table
for the function, the second 2 gives the index of i within this symbol
table.

All types are stored in a single table.
For T<4, .predef_I4, 4>

The first 4 represents the idex for this type in the type table
.predef_I4 represents the name (we use predefined type names for
some frequently used types such as char, short, int)
The last 4 specifies the alignment for using usage of the type.

LOC gives information regarding the source line
>         ...
>       LOC 1 19
>         I4I4LDID  0  <2,2,i> T<4, .predef_I4, 4>
>         I4INTCONST 1 (0x1)
>         I4ADD
>       I4STID 0 <2,2,i> T<4, .predef_I4, 4>
>         ...
> 
>         what is the meaning of <2,2,i>, T<4, .predef_I4, 4>, I4I4 , "LOC 1
> 19"?
>         Although I can guess something, it is still not very clear to me.
> 
>         Can somebody tell me the meaning of these fields explicitly and
> the rule to diciper them? I cannot find the description of them in the
> Whirl specificatoin.
> 
> 
>         Thank you very much.
> 
>         BTW: It seems to me that there is a little bug in the LOC(source
> position information) related
> things in ir_b2a. Sometimes, the LOC appears before the other codes of the
> same whirl node, but sometimes it appears behind them. It is somewhat
> confusing.
> 

That is possible.
In WHIRL, line number information is associated with WHIRL
statement nodes and they might not match in the source language
(for example, CALL or post increment).
It might alo not be correct at higher optimization levels.
It is also possible that the frontend is not generating them
correctly.

Please send a sample example with the commandline line used.

>                                           Peng
> --
>   Peng Zhao   pengzhao@xxxxxxxxxxxxxx
>   http://www.cs.ualberta.ca/~pengzhao
>   TEL (Lab): (780)492-3725                  Lab:  CSC251

<Prev in Thread] Current Thread [Next in Thread>