[Mono-devel-list] Re: [Mono-patches] r37935 - trunk/mono/mono/mini
Ben Maurer
bmaurer at ximian.com
Sun Dec 19 11:55:54 EST 2004
Hey Zoltan,
On Sun, 2004-12-19 at 11:29 -0500, Zoltan Varga (vargaz AT freemail.hu) wrote:
> +
> + /* Optimize the common ldobj+stloc combination */
> + switch (ip [5]) {
> + case CEE_STLOC_S:
> + loc_index = ip [6];
> + stloc_len = 2;
> + break;
> + case CEE_STLOC_0:
> + case CEE_STLOC_1:
> + case CEE_STLOC_2:
> + case CEE_STLOC_3:
> + loc_index = ip [5] - CEE_STLOC_0;
> + stloc_len = 1;
> + break;
> + default:
> + break;
> + }
This is a great idea, but it doesn't quite work as it is. Your patch
assumes that ip + 5 is in the same bb as we are currently parsing
However, this might not be the case. A long time ago, I filed a bug
about this assumption being used in ldtoken.
I actually just hacked up a patch yesterday (well, I have had this patch
for ages, but revived it...) that did a similar optimization on method
calls and the emit_tree thingy. I have attached it. I was planning to
check this patch in after testing it for a day or two more on my local
tree. It gives a nice 2% boost on mcs bootstrap.
I will fix up your code when I check this in.
BTW, one other similar problem I noticed was:
call <foo>
ret
where <foo> returns a valuetype. What we should do is push the return
address on to the stack, but we just allocate a temporary space and then
copy.
-- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mini-reduce-spills.patch
Type: text/x-patch
Size: 3717 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20041219/25ab8c25/attachment.bin
More information about the Mono-devel-list
mailing list