StoreCM Optimization

Changpeng Fang Changpeng.Fang at Sun.COM
Mon Aug 31 12:08:31 PDT 2009


On 08/31/09 11:11, Tom Rodriguez wrote:
> I don't think so.  Because of optimizations, couldn't the input be 
> another memory state that merges multiple stores that are sharing the 
> card mark?  I seem to remember an old email exchange about this but I 
> can't find it now.
> Tom Rodriguez wrote:
>
I remember that I raised the similar question before. Below is part of 
the email exchange.
> On Feb 25, 2009, at 12:26 PM, Changpeng Fang wrote:
>
>> Tom Rodriguez wrote:
>>>
>>>> The question is:
>>>>
>>>> (1) do we need to generated this StoreCM for a store when we know 
>>>> this store
>>>> is eliminated?
>>>
>>> If we know at parse time that it was eliminated then a card mark is 
>>> clearly not needed.
>>>
>> The problem in question follows this case. We know the 
>> StoreNode::Identity eliminate
>> the StoreP and return a phi node. However, at the time of generating 
>> StoreCM, we only
>> see this Phi node (as oop_store), and this will lead to the case (2) 
>> below.  When we see
>> this Phi node we don't know whether it is generated by the store 
>> elimination or other
>> optimizations (In those cases, storeCM may still be required?).
>
> The set of optimizations performed at parse time is more limited and 
> won't include any serious reshapes of the graph since the graph is 
> incomplete.  I think the code that performs the card mark in the 
> parser could be modified to skip the card mark if the returned node 
> isn't a store.  Obviously a more complete solution would be nicer.

I am investigating how a Macro storeP node can help.


Changpeng



> tom
>
> On Aug 31, 2009, at 10:41 AM, Changpeng Fang wrote:
>
>> Is it safe to simply remove the storeCM node if its OopStore is not a 
>> store?
>>
>> diff -r d0acbc302e14 src/share/vm/opto/memnode.cpp
>> --- a/src/share/vm/opto/memnode.cpp     Mon Aug 17 14:45:02 2009 -0700
>> +++ b/src/share/vm/opto/memnode.cpp     Mon Aug 31 10:34:15 2009 -0700
>> @@ -2309,7 +2309,7 @@ Node *StoreCMNode::Identity( PhaseTransf
>> //------------------------------Identity--------------------------------------- 
>>
>> Node *StoreCMNode::Identity( PhaseTransform *phase ) {
>> // No need to card mark when storing a null ptr
>> Node* my_store = in(MemNode::OopStore);
>> if (my_store->is_Store()) {
>>   const Type *t1 = phase->type( my_store->in(MemNode::ValueIn) );
>>   if( t1 == TypePtr::NULL_PTR ) {
>>     return in(MemNode::Memory);
>>   }
>> - }
>> +} else return in(MemNode::Memory);
>> return this;
>> }
>>
>>
>> Thanks,
>>
>> Changpeng
>



More information about the hotspot-compiler-dev mailing list