1576 return true; |
1578 return true; |
1577 } |
1579 } |
1578 |
1580 |
1579 //------------------------------construct_bb--------------------------- |
1581 //------------------------------construct_bb--------------------------- |
1580 // Construct reverse postorder list of block members |
1582 // Construct reverse postorder list of block members |
1581 void SuperWord::construct_bb() { |
1583 bool SuperWord::construct_bb() { |
1582 Node* entry = bb(); |
1584 Node* entry = bb(); |
1583 |
1585 |
1584 assert(_stk.length() == 0, "stk is empty"); |
1586 assert(_stk.length() == 0, "stk is empty"); |
1585 assert(_block.length() == 0, "block is empty"); |
1587 assert(_block.length() == 0, "block is empty"); |
1586 assert(_data_entry.length() == 0, "data_entry is empty"); |
1588 assert(_data_entry.length() == 0, "data_entry is empty"); |
1594 int bb_ct = 0; |
1596 int bb_ct = 0; |
1595 for (uint i = 0; i < lpt()->_body.size(); i++ ) { |
1597 for (uint i = 0; i < lpt()->_body.size(); i++ ) { |
1596 Node *n = lpt()->_body.at(i); |
1598 Node *n = lpt()->_body.at(i); |
1597 set_bb_idx(n, i); // Create a temporary map |
1599 set_bb_idx(n, i); // Create a temporary map |
1598 if (in_bb(n)) { |
1600 if (in_bb(n)) { |
|
1601 if (n->is_LoadStore() || n->is_MergeMem() || |
|
1602 (n->is_Proj() && !n->as_Proj()->is_CFG())) { |
|
1603 // Bailout if the loop has LoadStore, MergeMem or data Proj |
|
1604 // nodes. Superword optimization does not work with them. |
|
1605 return false; |
|
1606 } |
1599 bb_ct++; |
1607 bb_ct++; |
1600 if (!n->is_CFG()) { |
1608 if (!n->is_CFG()) { |
1601 bool found = false; |
1609 bool found = false; |
1602 for (uint j = 0; j < n->req(); j++) { |
1610 for (uint j = 0; j < n->req(); j++) { |
1603 Node* def = n->in(j); |
1611 Node* def = n->in(j); |
1618 for (DUIterator_Fast imax, i = lp()->fast_outs(imax); i < imax; i++) { |
1626 for (DUIterator_Fast imax, i = lp()->fast_outs(imax); i < imax; i++) { |
1619 Node *n = lp()->fast_out(i); |
1627 Node *n = lp()->fast_out(i); |
1620 if (in_bb(n) && (n->is_Phi() && n->bottom_type() == Type::MEMORY)) { |
1628 if (in_bb(n) && (n->is_Phi() && n->bottom_type() == Type::MEMORY)) { |
1621 Node* n_tail = n->in(LoopNode::LoopBackControl); |
1629 Node* n_tail = n->in(LoopNode::LoopBackControl); |
1622 if (n_tail != n->in(LoopNode::EntryControl)) { |
1630 if (n_tail != n->in(LoopNode::EntryControl)) { |
|
1631 if (!n_tail->is_Mem()) { |
|
1632 assert(n_tail->is_Mem(), err_msg_res("unexpected node for memory slice: %s", n_tail->Name())); |
|
1633 return false; // Bailout |
|
1634 } |
1623 _mem_slice_head.push(n); |
1635 _mem_slice_head.push(n); |
1624 _mem_slice_tail.push(n_tail); |
1636 _mem_slice_tail.push(n_tail); |
1625 } |
1637 } |
1626 } |
1638 } |
1627 } |
1639 } |
1693 tty->print(" "); _mem_slice_tail.at(m)->dump(); |
1705 tty->print(" "); _mem_slice_tail.at(m)->dump(); |
1694 } |
1706 } |
1695 } |
1707 } |
1696 #endif |
1708 #endif |
1697 assert(rpo_idx == -1 && bb_ct == _block.length(), "all block members found"); |
1709 assert(rpo_idx == -1 && bb_ct == _block.length(), "all block members found"); |
|
1710 return (_mem_slice_head.length() > 0) || (_data_entry.length() > 0); |
1698 } |
1711 } |
1699 |
1712 |
1700 //------------------------------initialize_bb--------------------------- |
1713 //------------------------------initialize_bb--------------------------- |
1701 // Initialize per node info |
1714 // Initialize per node info |
1702 void SuperWord::initialize_bb() { |
1715 void SuperWord::initialize_bb() { |