6590177: jck60019 test assert(!repeated,"do not walk merges twice")
A mergemem node could be not in worklist_store but in should_not_repeat vectorset since it was processed and removed from worklist_store before. Reviewed-by: jrose, never
This commit is contained in:
parent
73fa03eafc
commit
7be6246821
@ -448,9 +448,9 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
|
|||||||
ResourceArea *area = Thread::current()->resource_area();
|
ResourceArea *area = Thread::current()->resource_area();
|
||||||
Node_List worklist_mem(area); // prior memory state to store
|
Node_List worklist_mem(area); // prior memory state to store
|
||||||
Node_List worklist_store(area); // possible-def to explore
|
Node_List worklist_store(area); // possible-def to explore
|
||||||
|
Node_List worklist_visited(area); // visited mergemem nodes
|
||||||
Node_List non_early_stores(area); // all relevant stores outside of early
|
Node_List non_early_stores(area); // all relevant stores outside of early
|
||||||
bool must_raise_LCA = false;
|
bool must_raise_LCA = false;
|
||||||
DEBUG_ONLY(VectorSet should_not_repeat(area));
|
|
||||||
|
|
||||||
#ifdef TRACK_PHI_INPUTS
|
#ifdef TRACK_PHI_INPUTS
|
||||||
// %%% This extra checking fails because MergeMem nodes are not GVNed.
|
// %%% This extra checking fails because MergeMem nodes are not GVNed.
|
||||||
@ -479,8 +479,8 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
|
|||||||
|
|
||||||
Node* initial_mem = load->in(MemNode::Memory);
|
Node* initial_mem = load->in(MemNode::Memory);
|
||||||
worklist_store.push(initial_mem);
|
worklist_store.push(initial_mem);
|
||||||
|
worklist_visited.push(initial_mem);
|
||||||
worklist_mem.push(NULL);
|
worklist_mem.push(NULL);
|
||||||
DEBUG_ONLY(should_not_repeat.test_set(initial_mem->_idx));
|
|
||||||
while (worklist_store.size() > 0) {
|
while (worklist_store.size() > 0) {
|
||||||
// Examine a nearby store to see if it might interfere with our load.
|
// Examine a nearby store to see if it might interfere with our load.
|
||||||
Node* mem = worklist_mem.pop();
|
Node* mem = worklist_mem.pop();
|
||||||
@ -494,18 +494,20 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
|
|||||||
|| op == Op_MergeMem // internal node of tree we are searching
|
|| op == Op_MergeMem // internal node of tree we are searching
|
||||||
) {
|
) {
|
||||||
mem = store; // It's not a possibly interfering store.
|
mem = store; // It's not a possibly interfering store.
|
||||||
|
if (store == initial_mem)
|
||||||
|
initial_mem = NULL; // only process initial memory once
|
||||||
|
|
||||||
for (DUIterator_Fast imax, i = mem->fast_outs(imax); i < imax; i++) {
|
for (DUIterator_Fast imax, i = mem->fast_outs(imax); i < imax; i++) {
|
||||||
store = mem->fast_out(i);
|
store = mem->fast_out(i);
|
||||||
if (store->is_MergeMem()) {
|
if (store->is_MergeMem()) {
|
||||||
// Be sure we don't get into combinatorial problems.
|
// Be sure we don't get into combinatorial problems.
|
||||||
// (Allow phis to be repeated; they can merge two relevant states.)
|
// (Allow phis to be repeated; they can merge two relevant states.)
|
||||||
uint i = worklist_store.size();
|
uint j = worklist_visited.size();
|
||||||
for (; i > 0; i--) {
|
for (; j > 0; j--) {
|
||||||
if (worklist_store.at(i-1) == store) break;
|
if (worklist_visited.at(j-1) == store) break;
|
||||||
}
|
}
|
||||||
if (i > 0) continue; // already on work list; do not repeat
|
if (j > 0) continue; // already on work list; do not repeat
|
||||||
DEBUG_ONLY(int repeated = should_not_repeat.test_set(store->_idx));
|
worklist_visited.push(store);
|
||||||
assert(!repeated, "do not walk merges twice");
|
|
||||||
}
|
}
|
||||||
worklist_mem.push(mem);
|
worklist_mem.push(mem);
|
||||||
worklist_store.push(store);
|
worklist_store.push(store);
|
||||||
|
Loading…
Reference in New Issue
Block a user