harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Fursov" <mike.fur...@gmail.com>
Subject Re: [drlvm][opt] How to get object access sequence during runtime.
Date Wed, 24 Jan 2007 09:36:40 GMT
On 1/24/07, zouqiong <ustczz@gmail.com> wrote:
>
> En, I don't know whether OPT can eliminate such code:
>   aload_0
>   getfield 5              aload_0
>   aload_0           ==>    getfield 5
>   getfield 5              dup
>
> If it can eliminate them; I add tracing code as follows:
>
>   aload_0                  aload_0
>   getfield 5              call ObjectRecord
>   aload_0           ==>    getfield 5
>   getfield 5              aload_0
>                           call ObjectRecord
>                           getfield 5
>
> I am afraid the instrumented "Call ObjectRecord" will cause the redundant
> code can't be eliminated.
>

You are right. If the only change you do is a new extra call in translator
it will limit optimizations. The best place to add tracing calls could be
hir2lir conversion, after all HLO optimizations were finished, but in this
case your helper can't be inlined.

If you want your helper to be inlined try to add additional 'getfield'
instrumentation pass into the middle of optimizer's pipeline: after inliner
and memopt.

-- 
Mikhail Fursov

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message