src/share/vm/opto/loopTransform.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6984979 Cdiff src/share/vm/opto/loopTransform.cpp

src/share/vm/opto/loopTransform.cpp

Print this page

        

*** 2445,2454 **** --- 2445,2461 ---- if (msg == NULL && !store->in(MemNode::Address)->is_AddP()) { msg = "can't handle store address"; msg_node = store->in(MemNode::Address); } + if (msg == NULL && + (!store->in(MemNode::Memory)->is_Phi() || + store->in(MemNode::Memory)->in(LoopNode::LoopBackControl) != store)) { + msg = "store memory isn't proper phi"; + msg_node = store->in(MemNode::Memory); + } + // Make sure there is an appropriate fill routine BasicType t = store->as_Mem()->memory_type(); const char* fill_name; if (msg == NULL && StubRoutines::select_fill_function(t, false, fill_name) == NULL) {
*** 2568,2578 **** // Make sure no unexpected values are used outside the loop for (uint i = 0; msg == NULL && i < lpt->_body.size(); i++) { Node* n = lpt->_body.at(i); // These values can be replaced with other nodes if they are used // outside the loop. ! if (n == store || n == head->loopexit() || n == head->incr()) continue; for (SimpleDUIterator iter(n); iter.has_next(); iter.next()) { Node* use = iter.get(); if (!lpt->_body.contains(use)) { msg = "node is used outside loop"; // lpt->_body.dump(); --- 2575,2585 ---- // Make sure no unexpected values are used outside the loop for (uint i = 0; msg == NULL && i < lpt->_body.size(); i++) { Node* n = lpt->_body.at(i); // These values can be replaced with other nodes if they are used // outside the loop. ! if (n == store || n == head->loopexit() || n == head->incr() || n == store->in(MemNode::Memory)) continue; for (SimpleDUIterator iter(n); iter.has_next(); iter.next()) { Node* use = iter.get(); if (!lpt->_body.contains(use)) { msg = "node is used outside loop"; // lpt->_body.dump();
*** 2713,2722 **** --- 2720,2733 ---- } } // Redirect the old control and memory edges that are outside the loop. Node* exit = head->loopexit()->proj_out(0); + // Sometimes the memory phi of the head is used as the outgoing + // state of the loop. It's safe in this case to replace it with the + // result_mem. + _igvn.replace_node(store->in(MemNode::Memory), result_mem); _igvn.replace_node(exit, result_ctrl); _igvn.replace_node(store, result_mem); // Any uses the increment outside of the loop become the loop limit. _igvn.replace_node(head->incr(), head->limit());
src/share/vm/opto/loopTransform.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File