Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 22760 invoked from network); 25 Jan 2007 06:21:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jan 2007 06:21:14 -0000 Received: (qmail 54451 invoked by uid 500); 25 Jan 2007 06:21:18 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 54175 invoked by uid 500); 25 Jan 2007 06:21:17 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 54166 invoked by uid 99); 25 Jan 2007 06:21:17 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jan 2007 22:21:17 -0800 Received-SPF: pass (herse.apache.org: domain of rdasgupt@gmail.com designates 64.233.162.233 as permitted sender) Received: from [64.233.162.233] (HELO nz-out-0506.google.com) (64.233.162.233) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jan 2007 22:21:08 -0800 Received: by nz-out-0506.google.com with SMTP id j2so316330nzf for ; Wed, 24 Jan 2007 22:20:47 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=AD0TvGBPcy6C6Rc11y77+aoleoYY9l/a/xbirp91EmrxDiOBPOYUEUU+IG3CmKTX/YR4IKppPPcttE03zab1+X1BwdCuc8EMUbnhPNjr1shSDe6deFBHK4PqoHxYsJCjMadpG/iN4vN/KDnBp0HUv5KVnumMKNpc9epxQ2OhX4k= Received: by 10.64.249.18 with SMTP id w18mr2248784qbh.1169706045984; Wed, 24 Jan 2007 22:20:45 -0800 (PST) Received: by 10.64.195.1 with HTTP; Wed, 24 Jan 2007 22:20:45 -0800 (PST) Message-ID: <51d555c70701242220v7ae85a6blf5b4d1fdcb2d791b@mail.gmail.com> Date: Wed, 24 Jan 2007 23:20:45 -0700 From: "Rana Dasgupta" To: dev@harmony.apache.org Subject: Re: how to get the time used by the OPT, JET? In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_31358_14408896.1169706045599" References: <6342af3e0701161847i373474d8g42d5f744002de0e5@mail.gmail.com> <6342af3e0701170034q681b8a41t8f91343bb2e3b69a@mail.gmail.com> <6342af3e0701171728s70d85c51s9b37a0fb127621f@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_31358_14408896.1169706045599 Content-Type: multipart/alternative; boundary="----=_Part_31359_7983379.1169706045599" ------=_Part_31359_7983379.1169706045599 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, For the jit guys, I have a somewhat (?) related question. When looking at the jit logs for tight loops like: for( indx = 0; indx < 1000; indx++) { afrom[indx] = afrom[indx + 1]; } which is fairly common in Spec sequences, sorts, etc..... there are of course three checks during the assignmnet ...null check, type check and bounds check. I wanted to make sure that for the above pattern of code, the type check was being optimized away. Though is is more potent in the jet compiler which I think calls a helper for this, I wanted to check this in the opt compiler. I am quite new to jitrino's logs. In the debugger, I see that the jitrino.opt compilation does genTauCheckElementType() which finally simplifies through simplifytaucheckelementtype(). This does a subclass check and for the above generates a genTauHasExactType... In the log ( attached ) , in the HIR, after global operand analysis, the ct log shows: Block L2: Predecessors: L1 Successors: L8 UNWIND I2:L2: I11:ldci4 #1 -) t6:int32 I12:add t4, t6 -) t7:int32 I13:chknull g1 -) t8:tau GOTO L8 Block L8: Predecessors: L2 Successors: L9 UNWIND I33:L8: I14:tauhastype g1,cls:ArrayRef[] -) t9:tau I15:arraylen g1 ((t8,t9)) -) t10:int32 I16:chkbounds t7 .lt. t10 -) t11:tau GOTO L9 Block L9: Predecessors: L8 Successors: L10 UNWIND I34:L9: I17:tauand t9, t11 -) t12:tau I18:ldbase g1 -) t13:ref:cls:ArrayRef I19:addindex t13, t7 -) t14:ref:cls:ArrayRef I20:ldind.unc:o [t14] ((t8,t12)) -) t15:cls:ArrayRef I21:chkbounds t4 .lt. t10 -) t16:tau GOTO L10 Block UNWIND: Predecessors: L2 L8 L9 Successors: EXIT I31:L6: GOTO EXIT Block L10: Predecessors: L9 Successors: L1 I35:L10: I22:tauand t9, t16 -) t17:tau I23:tausafe() -) t18:tau I24:addindex t13, t4 -) t19:ref:cls:ArrayRef I25:stind.unc:o t15 ((t8,t17,t18)) -) [t19] I26:stvar t7 -) v1:int32 GOTO L1 But looking at L8, L9, L10, I am not sure that I understand that the type check is going away, or what is happening to tauhastype. Is there a manual on the tau operators that the non jitrino people can read ? I think the final code generated is fine since the only exception being checked in the generated code is the bounds check. Sorry for the long question. Rana On 1/18/07, Mikhail Fursov wrote: > > Answers: > > On 1/18/07, zouqiong wrote: > > > > Thanks. I want to know about three things: > > > > 1) the compilation time for both OPT and JET. > > > -XDjit.arg.time=on > If you need to measure total time for your code/algorithm add new timer. > See > any of existing timers (search by it's name in log) to see how it's work. > > 2) IR and compilation log for a method compiled by OPT. > > > All IR: > -Xem:opt -XDjit.arg.log=ct,irdump,dotdump > > IR for the specified method: > -Xem:opt -XDjit.CS_OPT.f.filter=Test::main -XDjit.f.arg.log=ct > ,irdump,dotdump > > > Read this doc to learn more: > http://harmony.apache.org/subcomponents/drlvm/JIT_PMF.html > > 3) some runtime metrics for managed code. > > > -Xem:opt -XDjit.arg.codegen.iprof=on - > XDjit.arg.codegen.iprof.config=iprof.cfg > Note! you can use per-method filters here too. > Read this doc to learn more: > http://harmony.apache.org/subcomponents/drlvm/internal_profiler.html > > > -- > Mikhail Fursov > > ------=_Part_31359_7983379.1169706045599 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi,
For the jit guys, I have a somewhat (?) related question.
When looking at the jit logs for tight loops like:
 
for( indx = 0; indx < 1000; indx++)
{
   afrom[indx] = afrom[indx + 1];
}
 
which is fairly common in Spec sequences, sorts, etc.....
there are of course three checks during the assignmnet ...null check, type check and bounds check. I wanted to make sure that for the above pattern of code, the type check was being optimized away. Though is is more potent in the jet compiler which I think calls a helper for this, I wanted to check this in the opt  compiler. I am quite new to jitrino's logs.
 
In the debugger, I see that the jitrino.opt compilation does  genTauCheckElementType() which finally simplifies through simplifytaucheckelementtype(). This does a subclass check and for the above generates a genTauHasExactType...
 
In the log ( attached ) , in the HIR, after global operand analysis, the ct log shows:

Block L2: 
  Predecessors: L1
  Successors: L8 UNWIND
  I2:L2:
  I11:ldci4     #1 -) t6:int32
  I12:add   t4, t6 -) t7:int32
  I13:chknull   g1 -) t8:tau
  GOTO L8

Block L8: 
  Predecessors: L2
  Successors: L9 UNWIND
  I33:L8:
  I14:tauhastype      g1,cls:ArrayRef[] -) t9:tau
  I15:arraylen  g1 ((t8,t9)) -) t10:int32
  I16:chkbounds t7 .lt. t10 -) t11:tau
  GOTO L9

Block L9: 
  Predecessors: L8
  Successors: L10 UNWIND
  I34:L9:
  I17:tauand       t9, t11 -) t12:tau
  I18:ldbase    g1 -) t13:ref:cls:ArrayRef
  I19:addindex  t13, t7 -) t14:ref:cls:ArrayRef
  I20: ldind.unc:o   [t14] ((t8,t12)) -) t15:cls:ArrayRef
  I21:chkbounds t4 .lt. t10 -) t16:tau
  GOTO L10

Block UNWIND: 
  Predecessors: L2 L8 L9
  Successors: EXIT
  I31:L6:
  GOTO EXIT

Block L10: 
  Predecessors: L9
  Successors: L1
  I35:L10:
  I22:tauand       t9, t16 -) t17:tau
  I23:tausafe() -) t18:tau
  I24:addindex  t13, t4 -) t19:ref:cls:ArrayRef
  I25:stind.unc:o   t15 ((t8,t17,t18)) -) [t19]
  I26:stvar     t7 -) v1:int32
  GOTO L1

But looking at L8, L9, L10, I am not sure that I understand that the type check is going away, or what is happening to tauhastype. Is there a manual on the tau operators that the non jitrino people can read ? I think the final code generated is fine since the only exception being checked in the generated code is the bounds check. Sorry for the long question.

Rana

 

 
 

 
On 1/18/07, Mikhail Fursov <mike.fursov@gmail.com> wrote:
Answers:

On 1/18/07, zouqiong <ustczz@gmail.com> wrote:
>
> Thanks. I want to know about three things:
>
> 1) the compilation time for both OPT and JET.


-XDjit.arg.time=on
If you need to measure total time for your code/algorithm add new timer. See
any of existing timers (search by it's name in log) to see how it's work.

2) IR and compilation log for a method compiled by OPT.


All IR:
-Xem:opt -XDjit.arg.log=ct,irdump,dotdump

IR for the specified method:
-Xem:opt -XDjit.CS_OPT.f.filter=Test::main -XDjit.f.arg.log=ct,irdump,dotdump


Read this doc to learn more:
http://harmony.apache.org/subcomponents/drlvm/JIT_PMF.html

3) some runtime metrics for managed code.


-Xem:opt -XDjit.arg.codegen.iprof=on -
XDjit.arg.codegen.iprof.config=iprof.cfg
Note! you can use per-method filters here too.
Read this doc to learn more:
http://harmony.apache.org/subcomponents/drlvm/internal_profiler.html


--
Mikhail Fursov


------=_Part_31359_7983379.1169706045599-- ------=_Part_31358_14408896.1169706045599--