Re: [rvm-research] Improving multiplication and division by constant code (RVM-256 from JIRA)

David P Grove <[email protected]>
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <OF35ED5F8A.72E7547C-ON85257E3D.0078911C-85257E3D.007A2471@us.ibm.com>


Ricardo Coelho <[email protected]> wrote on 05/05/2015 08:42:42 AM:
>
> I found this issue https://xtenlang.atlassian.net/browse/RVM-256
> about improving multiplication and division by constant code, and I
> have been searching about it on the class Simplifier in optimizing
> compiler. I found the methods intMul, intDiv, longMul, longDiv,
> floatMul, floatDiv, doubleMul, doubleDiv and multiplyByConstant,
> where this optimization would take place, and I would like to ask if
> this subject still can be subjected to a better scheme since there
> have been several changes to this class since this issue was
> created. If so, I also would like to ask if you have some
> recommendation about this issue, like any paper that we can rely on.
> Currently I am reading the paper referenced in sourceforge related
> to this issue http://sourceforge.net/p/jikesrvm/feature-requests/130/).

Hi,

	This has the virtue of being a coding problem where you could learn
about tricky ways to do multiply/divides and where the code changes would
be fairly local.  Both good for a class project.

	On the downside, I think it will be very hard to find a program where
this optimization would make a measurable difference.   And as you noted,
there was work done by Ian in 2008 to improve the code in Simplifier after
RVM-256 (pre 2007).  Since Ian didn't close RVM-256, I suspect there was
additional cleverness that could be applied that he didn't get time to
implement.  After reading the papers, maybe you will find some additional
tweaks that could be made.

	If you do make an improvement, you'd probably have to write carefully
crafted microbenchmarks to be able to (a) see the optimization do something
and (b) measure it.  Again, for a course project, this is probably ok.  You
could show you implemented something, that it handled the cases it was
expected to, and that the resulting machine code was better.

>
> Additionally, related to the generation of intermediate
> representation and in order to debug, is there any way we can access
> it during test running provided with the VM?
>

	I would probably do work like this by using a prototype-opt
configuration of JikesRVM and then using
org.jikesrvm.tools.oth.OptTestHarness to compile/execute test cases and
print the IR for carefully contrived test methods that divided/multiplied
an argument by interesting constants.

--dave

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y

_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.