On 15 Sep 2006 11:26:40 +0700, Egor Pasko <[EMAIL PROTECTED]> wrote:

>>On the 0x1E4 day of Apache Harmony Mikhail Fursov wrote:
>> This would be the best solution to test if an optimization works as
> >expected.
> >We can create the following framework inside Jitrino compiler to test
> >individual optimizations and optimizations inter-dependencies:
>>
>> Create a special optimization ("test") that that works only for
"special"
>> Java method (jitrino.TestCase.testJitrino) during the compilation.
>> It works in the following way:
>> 1) Cleans current IR
>> 2) Set up some kind of template IR: e.g. IR with 1 loop and a const
inside
>> the loop
>> 3) Runs a test that uses internal Jitrino API and checks the results:
e.g.
>> runs some loop optimizations and checks that constant is moved out from
the
>> loop.
>> 4) Restores initial IR of the method.

>> Such tests could be run from junit with a special adapter as usual Java
>> tests.
>>
>> Does it makes sense?

>I like it! Thanks!


This looks like a good idea for cases where the optimization is  more subtle
and may not immediately translate to a tangile perf gain. These( at least
some ) can be included in the pre-commit tests as correctness tests, rather
than performance tests.


>> Any other ideas or experience how to test compiler optimizations
>> predictably?

>although having performance measurements, NULLSTONE-like tests are
>quite predictable and relatively easy to write.


Yes.  As Egor said above, we need both types. Nullstone-like perf tests (
for cases where they can be expressed in this way ) should be quite
predictable and platform independent. We can play with a reasonably safe
confidence interval ( eg., within X% of the manual optimization ). These
should be OK for pre-commit too.  If they are unsafe, we will know soon :-)

Thanks for the good ideas,
Rana



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to