RFR (M): 7173340: C2: code cleanup: use PhaseIterGVN::replace_edge(Node*, int, Node*) where applicable (original) (raw)

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed Jun 6 11:15:17 PDT 2012


Vladimir,

Next code is wrong, use_clone edge update should be after use node update since it is used there:

! _igvn.replace_edge_of(use_clone, LoopNode::LoopBackControl, C->top()); ! _igvn.rehash_node_delayed(use); // Multiple edge updates use->set_req(LoopNode::EntryControl, use_clone->in(LoopNode::LoopBackControl)); use->set_req(LoopNode::LoopBackControl, C->top());

Could you also define rehash_node_delayed() first and use it in replace_edge_of() and delete_edge_of() methods since it is not required to have set_req() and del_req() before _worklist.push()?

It was my suggestion to use 'edge' in new methods name but I think it is not accurate. Methods update only input edges so it would be better to call methods replace_input_of() and delete_input_of().

Thanks, Vladimir

Vladimir Ivanov wrote:

http://cr.openjdk.java.net/~vi/7173340/webrev.01/

The idea is to replace the following patterns with a single call to a corresponding method from PhaseIterGVN: 1) igvn.hashdelete(n); n->setreq(i, in); igvn.worklist.push(n); 2) hashdelete(n); n->delreq(i); worklist.push(n); 3) hashdelete(n); worklist.push(n); to 1) PhaseIterGVN::replaceedgeof(Node*, int, Node*) 2) PhaseIterGVN::deleteedgeof(Node*, int) 3) PhaseIterGVN::rehashnodedelayed(Node*) I reordered code in some places, but it should be safe. Please, confirm. Testing: VM tests, VM regression tests Thanks! Best regards, Vladimir Ivanov



More information about the hotspot-compiler-dev mailing list