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! > 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. -- Egor Pasko, Intel Managed Runtime Division --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]