« Return to Thread: Re: [rvm-core] [rvm-commits] SF.net SVN: jikesrvm:[15318] rvmroot/trunk

Re: [rvm-core] [rvm-commits] SF.net SVN: jikesrvm:[15318] rvmroot/trunk

by David P Grove :: Rate this Message:

Reply to Author | View in Thread

Steve Blackburn <Steve.Blackburn@...> wrote on 02/04/2009 07:47:21 AM:
>
> > I propose fixing the compiler to handle this and Dave proposes an
> > invasive change to MMTk.
>
> Dave?  What change are you proposing?

I'm objecting to letting the opt compiler copy propagate physical registers as I think it has some potential for introducing bugs in code that is using Magic to manipulate the processor register.  The problem is that MMTk gets hold of the PR register through a series of function calls.  By the time we inline all of those, we are left with an assignment of PR to a temporary variable (the return value from the inlined function).  Ian is right that if we allow copy propagation to be applied to this IR, then we will get better code.

My reluctance to do this optimization is that the opt compiler will also copy propagate in cases where the programmer has explicitly assigned PR to a local variable because they want to hold on to a particular value in that register and use it later.  

It is awkward for the opt compiler to be able to distinguish between code where the programmer is explicitly putting PR in a local variable vs. where it is only in a local variable as a result of inlining.

The invasive change is that I'd prefer to force the Magic programmer to invoke the magic to get the PR everywhere they want it in the inline sequence instead of wrapping layers of function calls.

To be clear, I'm not saying this change is a good idea (or one that we should do), but having been burned badly in the past by the opt compiler trying to be to smart and optimize code sequences that arise from VM magic I would like us to not enable any such optimization unless we really understand and document what implications it has for the correct and bug free use of magic.

I'm also putting this mail in the tracker...

--dave

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Jikesrvm-core mailing list
Jikesrvm-core@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-core

 « Return to Thread: Re: [rvm-core] [rvm-commits] SF.net SVN: jikesrvm:[15318] rvmroot/trunk