StoreCM Optimization

Changpeng Fang Changpeng.Fang at Sun.COM
Mon Aug 31 10:41:17 PDT 2009


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