You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Maksim Ananjev <ma...@gmail.com> on 2007/04/16 19:39:50 UTC

[drvm][jit] ABCD does not eliminate upper bound check

Hi!

I tried to apply new ABCD optimization path to the following code:

int[] array = new int[10];
int l = array.length;
for(int i =0; i<l; i++)
{
       array[i] = i;
}

However the bounds check on the assignment inside the loop was not eliminated.

I used the patches from here:
https://issues.apache.org/jira/browse/HARMONY-1788

I unzipped files in vm.zip and added them in
jitrino/src/optimizer/abcd/ folder. Then I applied
abcd_update_1_full.patch. Then I added "classic_abcd" to opt.emconf

But according to log file upper bound check cannot be proved
redundant. That's strange because this case looks rather obvious.

May be I did something wrong in applying the patch? Or ABCD really
cannot deal with such case?

-- 
Maksim

Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Egor Pasko <eg...@gmail.com>.
On the 0x2BA day of Apache Harmony Maksim Ananjev wrote:
> Hi!
> 
> I tried to apply new ABCD optimization path to the following code:
> 
> int[] array = new int[10];
> int l = array.length;
> for(int i =0; i<l; i++)
> {
>        array[i] = i;
> }
> 
> However the bounds check on the assignment inside the loop was not eliminated.
> 
> I used the patches from here:
> https://issues.apache.org/jira/browse/HARMONY-1788
> 
> I unzipped files in vm.zip and added them in
> jitrino/src/optimizer/abcd/ folder. Then I applied
> abcd_update_1_full.patch. Then I added "classic_abcd" to opt.emconf
> 
> But according to log file upper bound check cannot be proved
> redundant. That's strange because this case looks rather obvious.
> 
> May be I did something wrong in applying the patch? Or ABCD really
> cannot deal with such case?

Maksim, I managed to your test with Naveens patch over the latest HEAD
and it *did* eliminate the chkbounds instruction!

The path I used was:
-XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,uce,lazyexc,memopt,simplify,dce,uce,classic_abcd,dce,uce,lower,dessa,statprof,markglobals

-- 
Egor Pasko


Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Naveen Neelakantam <ne...@uiuc.edu>.
On Apr 17, 2007, at 12:34 AM, Mikhail Fursov wrote:

> On 4/17/07, Naveen Neelakantam <ne...@uiuc.edu> wrote:
>>
>> But in general, other optimization passes can perform transformations
>> that break important dataflow relationships between variables.  This
>> sometimes makes it impossible for ABCD to prove that a particular
>> bounds check is redundant (ABCD uses "constraints", which are derived
>> from dataflow).
>>
>>
> Naveen, if any of optimizations we have can break ABCD with Maxim's  
> example,
> it worth to be analyzed. I hope there are no such optimizations in JIT
> today. If you know one we can proceed and check it: it may lead to
> additional improvements in ABCD algorithm.

I could not find a pass order that break's ABCD with Maxim's  
example.  However, I found a pass order using loop peeling that  
prevents bounds checks from being proven redundant with the  
BidirectionalBubbleSort example in HARMONY-1564.  The following pass  
order in opt.emconf will prevent 2 bounds checks from being proven  
redundant:
- 
XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,uce 
,lazyexc,memopt,simplify,dce,uce,dessa,statprof,peel,ssa,classic_abcd,lo 
wer,dessa,statprof,markglobals

Whereas these pass orders both work (and both use loop peeling):
- 
XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,uce 
,lazyexc,memopt,simplify,dce,uce,dessa,statprof,peel,ssa,memopt,classic_ 
abcd,lower,dessa,statprof,markglobals
- 
XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,uce 
,lazyexc,memopt,simplify,dce,uce,classic_abcd,dessa,statprof,peel,ssa,lo 
wer,dessa,statprof,markglobals

The takeaway is that classic_abcd should either be run before loop  
peeling, or if it runs after loop peeling, memopt should be run  
between it and loop peeling.

Naveen

>
> -- 
> Mikhail Fursov


Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Naveen Neelakantam <ne...@uiuc.edu>.

On Apr 17, 2007, at 12:34 AM, Mikhail Fursov wrote:

> On 4/17/07, Naveen Neelakantam <ne...@uiuc.edu> wrote:
>>
>> But in general, other optimization passes can perform transformations
>> that break important dataflow relationships between variables.  This
>> sometimes makes it impossible for ABCD to prove that a particular
>> bounds check is redundant (ABCD uses "constraints", which are derived
>> from dataflow).
>>
>>
> Naveen, if any of optimizations we have can break ABCD with Maxim's  
> example,
> it worth to be analyzed. I hope there are no such optimizations in JIT
> today. If you know one we can proceed and check it: it may lead to
> additional improvements in ABCD algorithm.

I think that this is indeed the case.  I'll look into it and get back  
to you.

Naveen

> -- 
> Mikhail Fursov


Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Mikhail Fursov <mi...@gmail.com>.
On 4/17/07, Naveen Neelakantam <ne...@uiuc.edu> wrote:
>
> But in general, other optimization passes can perform transformations
> that break important dataflow relationships between variables.  This
> sometimes makes it impossible for ABCD to prove that a particular
> bounds check is redundant (ABCD uses "constraints", which are derived
> from dataflow).
>
>
Naveen, if any of optimizations we have can break ABCD with Maxim's example,
it worth to be analyzed. I hope there are no such optimizations in JIT
today. If you know one we can proceed and check it: it may lead to
additional improvements in ABCD algorithm.

-- 
Mikhail Fursov

Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Naveen Neelakantam <ne...@uiuc.edu>.
Actually, I retract that statement.  I just looked at opt.emconf and  
the loop peeling pass isn't run...  :-)

But in general, other optimization passes can perform transformations  
that break important dataflow relationships between variables.  This  
sometimes makes it impossible for ABCD to prove that a particular  
bounds check is redundant (ABCD uses "constraints", which are derived  
from dataflow).

Naveen

On Apr 16, 2007, at 12:48 PM, Mikhail Fursov wrote:

> On 4/17/07, Naveen Neelakantam <ne...@uiuc.edu> wrote:
>>
>> I can take a look, but I suspect that the problem is caused by the
>> loop peeling pass.
>>
>>
>> Why do you think loop-peeling can do something bad here?
>
>
> -- 
> Mikhail Fursov


Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Mikhail Fursov <mi...@gmail.com>.
On 4/17/07, Naveen Neelakantam <ne...@uiuc.edu> wrote:
>
> I can take a look, but I suspect that the problem is caused by the
> loop peeling pass.
>
>
> Why do you think loop-peeling can do something bad here?


-- 
Mikhail Fursov

Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Tim Ellison <t....@gmail.com>.
Danese Cooper wrote:
> We have a one-issue call scheduled for 8:30 on Wednesday the 18th.

Cool, can we all join in <g> ?  Only teasing, good to see you are
reading this stuff.

Tim

Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Danese Cooper <da...@gmail.com>.
We decided to wait on these two applications.  We have a one-issue  
call scheduled for 8:30 on Wednesday the 18th.

Danese

On Apr 16, 2007, at 10:48 AM, Naveen Neelakantam wrote:

> I can take a look, but I suspect that the problem is caused by the  
> loop peeling pass.
>
> Can you post your modified emconf file?  Or can you tell me which  
> passes you inserted classic_abcd between?
>
> Thanks,
> Naveen
>
> On Apr 16, 2007, at 12:39 PM, Maksim Ananjev wrote:
>
>> Hi!
>>
>> I tried to apply new ABCD optimization path to the following code:
>>
>> int[] array = new int[10];
>> int l = array.length;
>> for(int i =0; i<l; i++)
>> {
>>       array[i] = i;
>> }
>>
>> However the bounds check on the assignment inside the loop was not  
>> eliminated.
>>
>> I used the patches from here:
>> https://issues.apache.org/jira/browse/HARMONY-1788
>>
>> I unzipped files in vm.zip and added them in
>> jitrino/src/optimizer/abcd/ folder. Then I applied
>> abcd_update_1_full.patch. Then I added "classic_abcd" to opt.emconf
>>
>> But according to log file upper bound check cannot be proved
>> redundant. That's strange because this case looks rather obvious.
>>
>> May be I did something wrong in applying the patch? Or ABCD really
>> cannot deal with such case?
>>
>> -- 
>> Maksim
>


Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Naveen Neelakantam <ne...@uiuc.edu>.
Thanks for the information.

I'll take a look shortly.  I'll report back with what I find.

Naveen

On Apr 16, 2007, at 1:25 PM, Maksim Ananjev wrote:

> I've placed "classic_abcd" after the ssa construction:
>
> - 
> XDjit.CS_OPT.path.optimizer=ssa,classic_abcd,devirt,inline,uce,purge,s 
> implify,dce,uce,
> lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals
>
> Nothing changed :-(
>
>
>
> 2007/4/17, Maksim Ananjev <ma...@gmail.com>:
>> Naveen,
>>
>> Here is a part of my opt.emconf file which states an order of
>> optimization passes on HIR:
>>
>> - 
>> XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce, 
>> uce,
>> classic_abcd,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,mar 
>> kglobals
>>
>>
>> 2007/4/17, Naveen Neelakantam <ne...@uiuc.edu>:
>> > I can take a look, but I suspect that the problem is caused by the
>> > loop peeling pass.
>> >
>> > Can you post your modified emconf file?  Or can you tell me which
>> > passes you inserted classic_abcd between?
>> >
>> > Thanks,
>> > Naveen
>> >
>> > On Apr 16, 2007, at 12:39 PM, Maksim Ananjev wrote:
>> >
>> > > Hi!
>> > >
>> > > I tried to apply new ABCD optimization path to the following  
>> code:
>> > >
>> > > int[] array = new int[10];
>> > > int l = array.length;
>> > > for(int i =0; i<l; i++)
>> > > {
>> > >       array[i] = i;
>> > > }
>> > >
>> > > However the bounds check on the assignment inside the loop was  
>> not
>> > > eliminated.
>> > >
>> > > I used the patches from here:
>> > > https://issues.apache.org/jira/browse/HARMONY-1788
>> > >
>> > > I unzipped files in vm.zip and added them in
>> > > jitrino/src/optimizer/abcd/ folder. Then I applied
>> > > abcd_update_1_full.patch. Then I added "classic_abcd" to  
>> opt.emconf
>> > >
>> > > But according to log file upper bound check cannot be proved
>> > > redundant. That's strange because this case looks rather obvious.
>> > >
>> > > May be I did something wrong in applying the patch? Or ABCD  
>> really
>> > > cannot deal with such case?
>> > >
>> > > --
>> > > Maksim
>> >
>> >
>>
>>
>> --
>> Maksim
>>
>
>
> -- 
> Maksim


Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Mikhail Fursov <mi...@gmail.com>.
Some advices:
1) update and rebuild classlib first (ant clean/svn update/ant
fetch-depends/ant)
2) run 'build clean' before building updated drlvm to be sure that there are
no object files left for removed sources.

On 4/17/07, Maksim Ananjev <ma...@gmail.com> wrote:
>
> I am now fully convinced that there is a problem on my side. I tried
> applying the patch as you had described - got segmentation fault on my
> test execution. I suppose, that's because i have rather old build.
>
> I tried to make "svn up" - but got compilation errors in the porting
> layer.
>
> Maybe i need some time to claw through these troubles :)
>
>
> 2007/4/17, Naveen Neelakantam <ne...@uiuc.edu>:
> > The new ABCD implementation works on the example code you posted.
> >
> > Perhaps the patch did not apply correctly?  I noticed that you said
> > you unzipped vm.zip before applying abcd_update_1_full.patch, which
> > isn't the way that the patch is intended to be used (sorry for the
> > confusion, my fault).
> >
> > All you need to do is apply the abcd_update_1_full.patch, you should
> > not unzip vm.zip.  This command should do the trick (from the svn root):
> >  >patch -p0 < abcd_update_1_full.patch
> >
> > If you are still having problems, please tar (or zip) up the
> > following: your log files, the java test source, your emconf file.
> > Then post the tar (or zip) on the HARMONY-1788 jira along with the
> > svn revision you are using, OS, etc.
> >
> > Naveen
> >
> > On Apr 16, 2007, at 1:25 PM, Maksim Ananjev wrote:
> >
> > > I've placed "classic_abcd" after the ssa construction:
> > >
> > > -
> > > XDjit.CS_OPT.path.optimizer=ssa,classic_abcd,devirt,inline,uce,purge,s
> > > implify,dce,uce,
> > > lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals
> > >
> > > Nothing changed :-(
> > >
> > >
> > >
> > > 2007/4/17, Maksim Ananjev <ma...@gmail.com>:
> > >> Naveen,
> > >>
> > >> Here is a part of my opt.emconf file which states an order of
> > >> optimization passes on HIR:
> > >>
> > >> -
> > >> XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,
> > >> uce,
> > >> classic_abcd,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,mar
> > >> kglobals
> > >>
> > >>
> > >> 2007/4/17, Naveen Neelakantam <ne...@uiuc.edu>:
> > >> > I can take a look, but I suspect that the problem is caused by the
> > >> > loop peeling pass.
> > >> >
> > >> > Can you post your modified emconf file?  Or can you tell me which
> > >> > passes you inserted classic_abcd between?
> > >> >
> > >> > Thanks,
> > >> > Naveen
> > >> >
> > >> > On Apr 16, 2007, at 12:39 PM, Maksim Ananjev wrote:
> > >> >
> > >> > > Hi!
> > >> > >
> > >> > > I tried to apply new ABCD optimization path to the following
> > >> code:
> > >> > >
> > >> > > int[] array = new int[10];
> > >> > > int l = array.length;
> > >> > > for(int i =0; i<l; i++)
> > >> > > {
> > >> > >       array[i] = i;
> > >> > > }
> > >> > >
> > >> > > However the bounds check on the assignment inside the loop was
> > >> not
> > >> > > eliminated.
> > >> > >
> > >> > > I used the patches from here:
> > >> > > https://issues.apache.org/jira/browse/HARMONY-1788
> > >> > >
> > >> > > I unzipped files in vm.zip and added them in
> > >> > > jitrino/src/optimizer/abcd/ folder. Then I applied
> > >> > > abcd_update_1_full.patch. Then I added "classic_abcd" to
> > >> opt.emconf
> > >> > >
> > >> > > But according to log file upper bound check cannot be proved
> > >> > > redundant. That's strange because this case looks rather obvious.
> > >> > >
> > >> > > May be I did something wrong in applying the patch? Or ABCD
> > >> really
> > >> > > cannot deal with such case?
> > >> > >
> > >> > > --
> > >> > > Maksim
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >> Maksim
> > >>
> > >
> > >
> > > --
> > > Maksim
> >
> >
>
>
> --
> Maksim
>



-- 
Mikhail Fursov

Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Mikhail Fursov <mi...@gmail.com>.
On 4/18/07, Maksim Ananjev <ma...@gmail.com> wrote:
>
> Mikhail, thanks! Your guidelines helped.
>
> Now I see that ABCD fully eliminates the check in my example if placed
> between uce and lower:
>
> -XX:jit.CS_OPT.path.optimizer=ssa
> ,devirt,inline,uce,purge,simplify,dce,uce,lazyexc,
> memopt,simplify,dce,uce,classic_abcd,lower,dessa,statprof,markglobals
>
> I tried to place classic_abcd earlier in the optimization path, but
> got segmentation fault or upper bound was not eliminated. That looks a
> bit strange for me, because  I thought that ABCD relies only on ssa.
> But if classic_abcd is placed just after ssa, check won't be
> eliminated
>
Be careful with dead and unreachable
code. Not all algorithms know how to work with it.
So the most simple advice is
to append 'simplify,dce,uce' sequence after any optimiation that modifies IR.



-- 
Mikhail Fursov

Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Maksim Ananjev <ma...@gmail.com>.
Mikhail, thanks! Your guidelines helped.

Now I see that ABCD fully eliminates the check in my example if placed
between uce and lower:

-XX:jit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,uce,lazyexc,
memopt,simplify,dce,uce,classic_abcd,lower,dessa,statprof,markglobals

I tried to place classic_abcd earlier in the optimization path, but
got segmentation fault or upper bound was not eliminated. That looks a
bit strange for me, because  I thought that ABCD relies only on ssa.
But if classic_abcd is placed just after ssa, check won't be
eliminated

However - as I mentioned - ABCD being put into right place does
eliminate upper check.

So I retract the title of current thread :)

2007/4/17, Mikhail Fursov <mi...@gmail.com>:
> Some advices:
> 1) update and rebuild classlib first (ant clean/svn update/ant
> fetch-depends/ant)
> 2) run 'build clean' before building updated drlvm to be sure that there are
> no object files left for removed sources.
>
> On 4/17/07, Maksim Ananjev <ma...@gmail.com> wrote:
> >
> > I am now fully convinced that there is a problem on my side. I tried
> > applying the patch as you had described - got segmentation fault on my
> > test execution. I suppose, that's because i have rather old build.
> >
> > I tried to make "svn up" - but got compilation errors in the porting
> > layer.
> >
> > Maybe i need some time to claw through these troubles :)
> >
> >
> > 2007/4/17, Naveen Neelakantam <ne...@uiuc.edu>:
> > > The new ABCD implementation works on the example code you posted.
> > >
> > > Perhaps the patch did not apply correctly?  I noticed that you said
> > > you unzipped vm.zip before applying abcd_update_1_full.patch, which
> > > isn't the way that the patch is intended to be used (sorry for the
> > > confusion, my fault).
> > >
> > > All you need to do is apply the abcd_update_1_full.patch, you should
> > > not unzip vm.zip.  This command should do the trick (from the svn root):
> > >  >patch -p0 < abcd_update_1_full.patch
> > >
> > > If you are still having problems, please tar (or zip) up the
> > > following: your log files, the java test source, your emconf file.
> > > Then post the tar (or zip) on the HARMONY-1788 jira along with the
> > > svn revision you are using, OS, etc.
> > >
> > > Naveen
> > >
> > > On Apr 16, 2007, at 1:25 PM, Maksim Ananjev wrote:
> > >
> > > > I've placed "classic_abcd" after the ssa construction:
> > > >
> > > > -
> > > > XDjit.CS_OPT.path.optimizer=ssa,classic_abcd,devirt,inline,uce,purge,s
> > > > implify,dce,uce,
> > > > lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals
> > > >
> > > > Nothing changed :-(
> > > >
> > > >
> > > >
> > > > 2007/4/17, Maksim Ananjev <ma...@gmail.com>:
> > > >> Naveen,
> > > >>
> > > >> Here is a part of my opt.emconf file which states an order of
> > > >> optimization passes on HIR:
> > > >>
> > > >> -
> > > >> XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,
> > > >> uce,
> > > >> classic_abcd,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,mar
> > > >> kglobals
> > > >>
> > > >>
> > > >> 2007/4/17, Naveen Neelakantam <ne...@uiuc.edu>:
> > > >> > I can take a look, but I suspect that the problem is caused by the
> > > >> > loop peeling pass.
> > > >> >
> > > >> > Can you post your modified emconf file?  Or can you tell me which
> > > >> > passes you inserted classic_abcd between?
> > > >> >
> > > >> > Thanks,
> > > >> > Naveen
> > > >> >
> > > >> > On Apr 16, 2007, at 12:39 PM, Maksim Ananjev wrote:
> > > >> >
> > > >> > > Hi!
> > > >> > >
> > > >> > > I tried to apply new ABCD optimization path to the following
> > > >> code:
> > > >> > >
> > > >> > > int[] array = new int[10];
> > > >> > > int l = array.length;
> > > >> > > for(int i =0; i<l; i++)
> > > >> > > {
> > > >> > >       array[i] = i;
> > > >> > > }
> > > >> > >
> > > >> > > However the bounds check on the assignment inside the loop was
> > > >> not
> > > >> > > eliminated.
> > > >> > >
> > > >> > > I used the patches from here:
> > > >> > > https://issues.apache.org/jira/browse/HARMONY-1788
> > > >> > >
> > > >> > > I unzipped files in vm.zip and added them in
> > > >> > > jitrino/src/optimizer/abcd/ folder. Then I applied
> > > >> > > abcd_update_1_full.patch. Then I added "classic_abcd" to
> > > >> opt.emconf
> > > >> > >
> > > >> > > But according to log file upper bound check cannot be proved
> > > >> > > redundant. That's strange because this case looks rather obvious.
> > > >> > >
> > > >> > > May be I did something wrong in applying the patch? Or ABCD
> > > >> really
> > > >> > > cannot deal with such case?
> > > >> > >
> > > >> > > --
> > > >> > > Maksim
> > > >> >
> > > >> >
> > > >>
> > > >>
> > > >> --
> > > >> Maksim
> > > >>
> > > >
> > > >
> > > > --
> > > > Maksim
> > >
> > >
> >
> >
> > --
> > Maksim
> >
>
>
>
> --
> Mikhail Fursov
>


-- 
Maksim

Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Maksim Ananjev <ma...@gmail.com>.
I am now fully convinced that there is a problem on my side. I tried
applying the patch as you had described - got segmentation fault on my
test execution. I suppose, that's because i have rather old build.

I tried to make "svn up" - but got compilation errors in the porting layer.

Maybe i need some time to claw through these troubles :)


2007/4/17, Naveen Neelakantam <ne...@uiuc.edu>:
> The new ABCD implementation works on the example code you posted.
>
> Perhaps the patch did not apply correctly?  I noticed that you said
> you unzipped vm.zip before applying abcd_update_1_full.patch, which
> isn't the way that the patch is intended to be used (sorry for the
> confusion, my fault).
>
> All you need to do is apply the abcd_update_1_full.patch, you should
> not unzip vm.zip.  This command should do the trick (from the svn root):
>  >patch -p0 < abcd_update_1_full.patch
>
> If you are still having problems, please tar (or zip) up the
> following: your log files, the java test source, your emconf file.
> Then post the tar (or zip) on the HARMONY-1788 jira along with the
> svn revision you are using, OS, etc.
>
> Naveen
>
> On Apr 16, 2007, at 1:25 PM, Maksim Ananjev wrote:
>
> > I've placed "classic_abcd" after the ssa construction:
> >
> > -
> > XDjit.CS_OPT.path.optimizer=ssa,classic_abcd,devirt,inline,uce,purge,s
> > implify,dce,uce,
> > lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals
> >
> > Nothing changed :-(
> >
> >
> >
> > 2007/4/17, Maksim Ananjev <ma...@gmail.com>:
> >> Naveen,
> >>
> >> Here is a part of my opt.emconf file which states an order of
> >> optimization passes on HIR:
> >>
> >> -
> >> XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,
> >> uce,
> >> classic_abcd,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,mar
> >> kglobals
> >>
> >>
> >> 2007/4/17, Naveen Neelakantam <ne...@uiuc.edu>:
> >> > I can take a look, but I suspect that the problem is caused by the
> >> > loop peeling pass.
> >> >
> >> > Can you post your modified emconf file?  Or can you tell me which
> >> > passes you inserted classic_abcd between?
> >> >
> >> > Thanks,
> >> > Naveen
> >> >
> >> > On Apr 16, 2007, at 12:39 PM, Maksim Ananjev wrote:
> >> >
> >> > > Hi!
> >> > >
> >> > > I tried to apply new ABCD optimization path to the following
> >> code:
> >> > >
> >> > > int[] array = new int[10];
> >> > > int l = array.length;
> >> > > for(int i =0; i<l; i++)
> >> > > {
> >> > >       array[i] = i;
> >> > > }
> >> > >
> >> > > However the bounds check on the assignment inside the loop was
> >> not
> >> > > eliminated.
> >> > >
> >> > > I used the patches from here:
> >> > > https://issues.apache.org/jira/browse/HARMONY-1788
> >> > >
> >> > > I unzipped files in vm.zip and added them in
> >> > > jitrino/src/optimizer/abcd/ folder. Then I applied
> >> > > abcd_update_1_full.patch. Then I added "classic_abcd" to
> >> opt.emconf
> >> > >
> >> > > But according to log file upper bound check cannot be proved
> >> > > redundant. That's strange because this case looks rather obvious.
> >> > >
> >> > > May be I did something wrong in applying the patch? Or ABCD
> >> really
> >> > > cannot deal with such case?
> >> > >
> >> > > --
> >> > > Maksim
> >> >
> >> >
> >>
> >>
> >> --
> >> Maksim
> >>
> >
> >
> > --
> > Maksim
>
>


-- 
Maksim

Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Naveen Neelakantam <ne...@uiuc.edu>.
The new ABCD implementation works on the example code you posted.

Perhaps the patch did not apply correctly?  I noticed that you said  
you unzipped vm.zip before applying abcd_update_1_full.patch, which  
isn't the way that the patch is intended to be used (sorry for the  
confusion, my fault).

All you need to do is apply the abcd_update_1_full.patch, you should  
not unzip vm.zip.  This command should do the trick (from the svn root):
 >patch -p0 < abcd_update_1_full.patch

If you are still having problems, please tar (or zip) up the  
following: your log files, the java test source, your emconf file.   
Then post the tar (or zip) on the HARMONY-1788 jira along with the  
svn revision you are using, OS, etc.

Naveen

On Apr 16, 2007, at 1:25 PM, Maksim Ananjev wrote:

> I've placed "classic_abcd" after the ssa construction:
>
> - 
> XDjit.CS_OPT.path.optimizer=ssa,classic_abcd,devirt,inline,uce,purge,s 
> implify,dce,uce,
> lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals
>
> Nothing changed :-(
>
>
>
> 2007/4/17, Maksim Ananjev <ma...@gmail.com>:
>> Naveen,
>>
>> Here is a part of my opt.emconf file which states an order of
>> optimization passes on HIR:
>>
>> - 
>> XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce, 
>> uce,
>> classic_abcd,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,mar 
>> kglobals
>>
>>
>> 2007/4/17, Naveen Neelakantam <ne...@uiuc.edu>:
>> > I can take a look, but I suspect that the problem is caused by the
>> > loop peeling pass.
>> >
>> > Can you post your modified emconf file?  Or can you tell me which
>> > passes you inserted classic_abcd between?
>> >
>> > Thanks,
>> > Naveen
>> >
>> > On Apr 16, 2007, at 12:39 PM, Maksim Ananjev wrote:
>> >
>> > > Hi!
>> > >
>> > > I tried to apply new ABCD optimization path to the following  
>> code:
>> > >
>> > > int[] array = new int[10];
>> > > int l = array.length;
>> > > for(int i =0; i<l; i++)
>> > > {
>> > >       array[i] = i;
>> > > }
>> > >
>> > > However the bounds check on the assignment inside the loop was  
>> not
>> > > eliminated.
>> > >
>> > > I used the patches from here:
>> > > https://issues.apache.org/jira/browse/HARMONY-1788
>> > >
>> > > I unzipped files in vm.zip and added them in
>> > > jitrino/src/optimizer/abcd/ folder. Then I applied
>> > > abcd_update_1_full.patch. Then I added "classic_abcd" to  
>> opt.emconf
>> > >
>> > > But according to log file upper bound check cannot be proved
>> > > redundant. That's strange because this case looks rather obvious.
>> > >
>> > > May be I did something wrong in applying the patch? Or ABCD  
>> really
>> > > cannot deal with such case?
>> > >
>> > > --
>> > > Maksim
>> >
>> >
>>
>>
>> --
>> Maksim
>>
>
>
> -- 
> Maksim


Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Maksim Ananjev <ma...@gmail.com>.
I've placed "classic_abcd" after the ssa construction:

-XDjit.CS_OPT.path.optimizer=ssa,classic_abcd,devirt,inline,uce,purge,simplify,dce,uce,
lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals

Nothing changed :-(



2007/4/17, Maksim Ananjev <ma...@gmail.com>:
> Naveen,
>
> Here is a part of my opt.emconf file which states an order of
> optimization passes on HIR:
>
> -XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,uce,
> classic_abcd,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals
>
>
> 2007/4/17, Naveen Neelakantam <ne...@uiuc.edu>:
> > I can take a look, but I suspect that the problem is caused by the
> > loop peeling pass.
> >
> > Can you post your modified emconf file?  Or can you tell me which
> > passes you inserted classic_abcd between?
> >
> > Thanks,
> > Naveen
> >
> > On Apr 16, 2007, at 12:39 PM, Maksim Ananjev wrote:
> >
> > > Hi!
> > >
> > > I tried to apply new ABCD optimization path to the following code:
> > >
> > > int[] array = new int[10];
> > > int l = array.length;
> > > for(int i =0; i<l; i++)
> > > {
> > >       array[i] = i;
> > > }
> > >
> > > However the bounds check on the assignment inside the loop was not
> > > eliminated.
> > >
> > > I used the patches from here:
> > > https://issues.apache.org/jira/browse/HARMONY-1788
> > >
> > > I unzipped files in vm.zip and added them in
> > > jitrino/src/optimizer/abcd/ folder. Then I applied
> > > abcd_update_1_full.patch. Then I added "classic_abcd" to opt.emconf
> > >
> > > But according to log file upper bound check cannot be proved
> > > redundant. That's strange because this case looks rather obvious.
> > >
> > > May be I did something wrong in applying the patch? Or ABCD really
> > > cannot deal with such case?
> > >
> > > --
> > > Maksim
> >
> >
>
>
> --
> Maksim
>


-- 
Maksim

Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Maksim Ananjev <ma...@gmail.com>.
Naveen,

Here is a part of my opt.emconf file which states an order of
optimization passes on HIR:

-XDjit.CS_OPT.path.optimizer=ssa,devirt,inline,uce,purge,simplify,dce,uce,
classic_abcd,lazyexc,memopt,simplify,dce,uce,lower,dessa,statprof,markglobals


2007/4/17, Naveen Neelakantam <ne...@uiuc.edu>:
> I can take a look, but I suspect that the problem is caused by the
> loop peeling pass.
>
> Can you post your modified emconf file?  Or can you tell me which
> passes you inserted classic_abcd between?
>
> Thanks,
> Naveen
>
> On Apr 16, 2007, at 12:39 PM, Maksim Ananjev wrote:
>
> > Hi!
> >
> > I tried to apply new ABCD optimization path to the following code:
> >
> > int[] array = new int[10];
> > int l = array.length;
> > for(int i =0; i<l; i++)
> > {
> >       array[i] = i;
> > }
> >
> > However the bounds check on the assignment inside the loop was not
> > eliminated.
> >
> > I used the patches from here:
> > https://issues.apache.org/jira/browse/HARMONY-1788
> >
> > I unzipped files in vm.zip and added them in
> > jitrino/src/optimizer/abcd/ folder. Then I applied
> > abcd_update_1_full.patch. Then I added "classic_abcd" to opt.emconf
> >
> > But according to log file upper bound check cannot be proved
> > redundant. That's strange because this case looks rather obvious.
> >
> > May be I did something wrong in applying the patch? Or ABCD really
> > cannot deal with such case?
> >
> > --
> > Maksim
>
>


-- 
Maksim

Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Naveen Neelakantam <ne...@uiuc.edu>.
I can take a look, but I suspect that the problem is caused by the  
loop peeling pass.

Can you post your modified emconf file?  Or can you tell me which  
passes you inserted classic_abcd between?

Thanks,
Naveen

On Apr 16, 2007, at 12:39 PM, Maksim Ananjev wrote:

> Hi!
>
> I tried to apply new ABCD optimization path to the following code:
>
> int[] array = new int[10];
> int l = array.length;
> for(int i =0; i<l; i++)
> {
>       array[i] = i;
> }
>
> However the bounds check on the assignment inside the loop was not  
> eliminated.
>
> I used the patches from here:
> https://issues.apache.org/jira/browse/HARMONY-1788
>
> I unzipped files in vm.zip and added them in
> jitrino/src/optimizer/abcd/ folder. Then I applied
> abcd_update_1_full.patch. Then I added "classic_abcd" to opt.emconf
>
> But according to log file upper bound check cannot be proved
> redundant. That's strange because this case looks rather obvious.
>
> May be I did something wrong in applying the patch? Or ABCD really
> cannot deal with such case?
>
> -- 
> Maksim


Re: [drvm][jit] ABCD does not eliminate upper bound check

Posted by Mikhail Fursov <mi...@gmail.com>.
On 4/17/07, Maksim Ananjev <ma...@gmail.com> wrote:
>
> Hi!
>
> I tried to apply new ABCD optimization path to the following code:
>
> int[] array = new int[10];
> int l = array.length;
> for(int i =0; i<l; i++)
> {
>        array[i] = i;
> }
>
> However the bounds check on the assignment inside the loop was not
> eliminated.
>
> I used the patches from here:
> https://issues.apache.org/jira/browse/HARMONY-1788
>
> I unzipped files in vm.zip and added them in
> jitrino/src/optimizer/abcd/ folder. Then I applied
> abcd_update_1_full.patch. Then I added "classic_abcd" to opt.emconf
>
> But according to log file upper bound check cannot be proved
> redundant. That's strange because this case looks rather obvious.
>
> May be I did something wrong in applying the patch? Or ABCD really
> cannot deal with such case?
>
> IMHO it must. I'm going to check it tomorrow. I know that new ABCD
implementation does give performance improvement in comparison with old one
so it should deal with cases like this.


-- 
Mikhail Fursov