comparison src/share/vm/opto/macro.cpp @ 3854:1af104d6cf99

7079329: Adjust allocation prefetching for T4 Summary: on T4 2 BIS instructions should be issued to prefetch 64 bytes Reviewed-by: iveresov, phh, twisti
author kvn
date Tue, 16 Aug 2011 16:59:46 -0700
parents f1c12354c3f7
children a92cdbac8b9e
comparison
equal deleted inserted replaced
3853:11211f7cb5a0 3854:1af104d6cf99
1588 1588
1589 for ( uint i = 0; i < lines; i++ ) { 1589 for ( uint i = 0; i < lines; i++ ) {
1590 prefetch_adr = new (C, 4) AddPNode( old_pf_wm, new_pf_wmt, 1590 prefetch_adr = new (C, 4) AddPNode( old_pf_wm, new_pf_wmt,
1591 _igvn.MakeConX(distance) ); 1591 _igvn.MakeConX(distance) );
1592 transform_later(prefetch_adr); 1592 transform_later(prefetch_adr);
1593 prefetch = new (C, 3) PrefetchWriteNode( i_o, prefetch_adr ); 1593 prefetch = new (C, 3) PrefetchAllocationNode( i_o, prefetch_adr );
1594 transform_later(prefetch); 1594 transform_later(prefetch);
1595 distance += step_size; 1595 distance += step_size;
1596 i_o = prefetch; 1596 i_o = prefetch;
1597 } 1597 }
1598 pf_phi_abio->set_req( pf_path, i_o ); 1598 pf_phi_abio->set_req( pf_path, i_o );
1609 1609
1610 needgc_false = pf_region; 1610 needgc_false = pf_region;
1611 contended_phi_rawmem = pf_phi_rawmem; 1611 contended_phi_rawmem = pf_phi_rawmem;
1612 i_o = pf_phi_abio; 1612 i_o = pf_phi_abio;
1613 } else if( UseTLAB && AllocatePrefetchStyle == 3 ) { 1613 } else if( UseTLAB && AllocatePrefetchStyle == 3 ) {
1614 // Insert a prefetch for each allocation only on the fast-path 1614 // Insert a prefetch for each allocation.
1615 // This code is used for Sparc with BIS.
1615 Node *pf_region = new (C, 3) RegionNode(3); 1616 Node *pf_region = new (C, 3) RegionNode(3);
1616 Node *pf_phi_rawmem = new (C, 3) PhiNode( pf_region, Type::MEMORY, 1617 Node *pf_phi_rawmem = new (C, 3) PhiNode( pf_region, Type::MEMORY,
1617 TypeRawPtr::BOTTOM ); 1618 TypeRawPtr::BOTTOM );
1618 1619
1619 // Generate several prefetch instructions only for arrays. 1620 // Generate several prefetch instructions.
1620 uint lines = (length != NULL) ? AllocatePrefetchLines : 1; 1621 uint lines = (length != NULL) ? AllocatePrefetchLines : AllocateInstancePrefetchLines;
1621 uint step_size = AllocatePrefetchStepSize; 1622 uint step_size = AllocatePrefetchStepSize;
1622 uint distance = AllocatePrefetchDistance; 1623 uint distance = AllocatePrefetchDistance;
1623 1624
1624 // Next cache address. 1625 // Next cache address.
1625 Node *cache_adr = new (C, 4) AddPNode(old_eden_top, old_eden_top, 1626 Node *cache_adr = new (C, 4) AddPNode(old_eden_top, old_eden_top,
1632 transform_later(cache_adr); 1633 transform_later(cache_adr);
1633 cache_adr = new (C, 2) CastX2PNode(cache_adr); 1634 cache_adr = new (C, 2) CastX2PNode(cache_adr);
1634 transform_later(cache_adr); 1635 transform_later(cache_adr);
1635 1636
1636 // Prefetch 1637 // Prefetch
1637 Node *prefetch = new (C, 3) PrefetchWriteNode( contended_phi_rawmem, cache_adr ); 1638 Node *prefetch = new (C, 3) PrefetchAllocationNode( contended_phi_rawmem, cache_adr );
1638 prefetch->set_req(0, needgc_false); 1639 prefetch->set_req(0, needgc_false);
1639 transform_later(prefetch); 1640 transform_later(prefetch);
1640 contended_phi_rawmem = prefetch; 1641 contended_phi_rawmem = prefetch;
1641 Node *prefetch_adr; 1642 Node *prefetch_adr;
1642 distance = step_size; 1643 distance = step_size;
1643 for ( uint i = 1; i < lines; i++ ) { 1644 for ( uint i = 1; i < lines; i++ ) {
1644 prefetch_adr = new (C, 4) AddPNode( cache_adr, cache_adr, 1645 prefetch_adr = new (C, 4) AddPNode( cache_adr, cache_adr,
1645 _igvn.MakeConX(distance) ); 1646 _igvn.MakeConX(distance) );
1646 transform_later(prefetch_adr); 1647 transform_later(prefetch_adr);
1647 prefetch = new (C, 3) PrefetchWriteNode( contended_phi_rawmem, prefetch_adr ); 1648 prefetch = new (C, 3) PrefetchAllocationNode( contended_phi_rawmem, prefetch_adr );
1648 transform_later(prefetch); 1649 transform_later(prefetch);
1649 distance += step_size; 1650 distance += step_size;
1650 contended_phi_rawmem = prefetch; 1651 contended_phi_rawmem = prefetch;
1651 } 1652 }
1652 } else if( AllocatePrefetchStyle > 0 ) { 1653 } else if( AllocatePrefetchStyle > 0 ) {
1653 // Insert a prefetch for each allocation only on the fast-path 1654 // Insert a prefetch for each allocation only on the fast-path
1654 Node *prefetch_adr; 1655 Node *prefetch_adr;
1655 Node *prefetch; 1656 Node *prefetch;
1656 // Generate several prefetch instructions only for arrays. 1657 // Generate several prefetch instructions.
1657 uint lines = (length != NULL) ? AllocatePrefetchLines : 1; 1658 uint lines = (length != NULL) ? AllocatePrefetchLines : AllocateInstancePrefetchLines;
1658 uint step_size = AllocatePrefetchStepSize; 1659 uint step_size = AllocatePrefetchStepSize;
1659 uint distance = AllocatePrefetchDistance; 1660 uint distance = AllocatePrefetchDistance;
1660 for ( uint i = 0; i < lines; i++ ) { 1661 for ( uint i = 0; i < lines; i++ ) {
1661 prefetch_adr = new (C, 4) AddPNode( old_eden_top, new_eden_top, 1662 prefetch_adr = new (C, 4) AddPNode( old_eden_top, new_eden_top,
1662 _igvn.MakeConX(distance) ); 1663 _igvn.MakeConX(distance) );
1663 transform_later(prefetch_adr); 1664 transform_later(prefetch_adr);
1664 prefetch = new (C, 3) PrefetchWriteNode( i_o, prefetch_adr ); 1665 prefetch = new (C, 3) PrefetchAllocationNode( i_o, prefetch_adr );
1665 // Do not let it float too high, since if eden_top == eden_end, 1666 // Do not let it float too high, since if eden_top == eden_end,
1666 // both might be null. 1667 // both might be null.
1667 if( i == 0 ) { // Set control for first prefetch, next follows it 1668 if( i == 0 ) { // Set control for first prefetch, next follows it
1668 prefetch->init_req(0, needgc_false); 1669 prefetch->init_req(0, needgc_false);
1669 } 1670 }