@@ -4679,7 +4679,7 @@ void G4_BB_SB::setSendOpndMayKilled(LiveGRFBuckets* globalSendsLB,
46794679 SBNODE_VECT* SBNodes,
46804680 PointsToAnalysis& p)
46814681{
4682- std::vector<SBBucketDescr > BDvec;
4682+ std::vector<SBBucketDesc > BDvec;
46834683 if (first_node == -1 )
46844684 {
46854685 return ;
@@ -4697,26 +4697,26 @@ void G4_BB_SB::setSendOpndMayKilled(LiveGRFBuckets* globalSendsLB,
46974697 }
46984698
46994699 BDvec.clear ();
4700- getGRFBucketDescrs (node, BDvec, true );
4700+ getGRFBucketDescs (node, BDvec, true );
47014701 if (!BDvec.size ())
47024702 {
47034703 continue ;
47044704 }
47054705
47064706 // For all bucket descriptors of curInst
4707- for (const SBBucketDescr & BD : BDvec) {
4707+ for (const SBBucketDesc & BD : BDvec) {
47084708 const int & curBucket = BD.bucket ;
47094709 const Gen4_Operand_Number& curOpnd = BD.opndNum ;
4710- const SBFootprint* curFootprint = BD.node -> getFootprint (BD. opndNum , BD. inst ) ;
4710+ const SBFootprint* curFootprint = BD.footprint ;
47114711
47124712 for (LiveGRFBuckets::BN_iterator bn_it = globalSendsLB->begin (curBucket);
47134713 bn_it != globalSendsLB->end (curBucket);)
47144714 {
47154715 SBBucketNode* liveBN = (*bn_it);
47164716 SBNode* curLiveNode = liveBN->node ;
47174717 Gen4_Operand_Number liveOpnd = liveBN->opndNum ;
4718- G4_INST* liveInst = liveBN->inst ;
4719- const SBFootprint* liveFootprint = curLiveNode-> getFootprint (liveBN-> opndNum ,liveInst) ;
4718+ const SBFootprint* liveFootprint = liveBN->footprint ;
4719+ G4_INST* liveInst = liveFootprint-> inst ;
47204720
47214721 // Send operands are all GRF aligned, there is no overlap checking required.
47224722 // Fix me, this is not right, for math instruction, less than 1 GRF may happen.
@@ -4743,7 +4743,7 @@ void G4_BB_SB::setSendOpndMayKilled(LiveGRFBuckets* globalSendsLB,
47434743 }
47444744
47454745 if (dep == WAR &&
4746- WARDepRequired (liveInst, BD. inst ))
4746+ WARDepRequired (liveInst, curFootprint-> inst ))
47474747 {
47484748 send_may_kill.setSrc (curLiveNode->globalID , true );
47494749 }
@@ -4779,7 +4779,7 @@ void G4_BB_SB::setSendOpndMayKilled(LiveGRFBuckets* globalSendsLB,
47794779 {
47804780 SBBucketNode* liveBN = (*bn_it);
47814781 SBNode* curLiveNode = liveBN->node ;
4782- G4_INST* liveInst = liveBN->inst ;
4782+ G4_INST* liveInst = liveBN->footprint -> inst ;
47834783
47844784 if (liveInst->isSend () &&
47854785 isSLMMsg (liveInst) && liveInst->getDst () != nullptr && !liveInst->getDst ()->isNullReg ())
@@ -4964,7 +4964,7 @@ void G4_BB_SB::getGRFFootprintForIndirect(SBNode* node,
49644964void G4_BB_SB::getGRFBuckets (SBNode* node,
49654965 const SBFootprint* footprint,
49664966 Gen4_Operand_Number opndNum,
4967- std::vector<SBBucketDescr >& BDvec,
4967+ std::vector<SBBucketDesc >& BDvec,
49684968 bool GRFOnly)
49694969{
49704970 for (const SBFootprint* curFootprint = footprint; curFootprint != nullptr ; curFootprint = curFootprint->next )
@@ -4986,7 +4986,7 @@ void G4_BB_SB::getGRFBuckets(SBNode* node,
49864986 for (int j = startingBucket;
49874987 j < (startingBucket + numBuckets); j++)
49884988 {
4989- BDvec.push_back (SBBucketDescr (j, opndNum, node, curFootprint-> inst ));
4989+ BDvec.push_back (SBBucketDesc (j, opndNum, node, curFootprint));
49904990 }
49914991 }
49924992}
@@ -5029,7 +5029,7 @@ bool G4_BB_SB::getGRFFootPrintOperands(SBNode* node,
50295029void G4_BB_SB::getGRFBucketsForOperands (SBNode* node,
50305030 Gen4_Operand_Number first_opnd,
50315031 Gen4_Operand_Number last_opnd,
5032- std::vector<SBBucketDescr >& BDvec,
5032+ std::vector<SBBucketDesc >& BDvec,
50335033 bool GRFOnly)
50345034{
50355035 for (Gen4_Operand_Number opndNum = first_opnd; opndNum <= last_opnd; opndNum = (Gen4_Operand_Number)(opndNum + 1 ))
@@ -5059,7 +5059,7 @@ bool G4_BB_SB::getGRFFootPrint(SBNode* node, PointsToAnalysis& p)
50595059 return hasDistOneAReg;
50605060}
50615061
5062- void G4_BB_SB::getGRFBucketDescrs (SBNode* node, std::vector<SBBucketDescr >& BDvec, bool GRFOnly)
5062+ void G4_BB_SB::getGRFBucketDescs (SBNode* node, std::vector<SBBucketDesc >& BDvec, bool GRFOnly)
50635063{
50645064 // We get the description for source first, so for current instruction, the scan order is src0, src1, src2, src3, dst
50655065 getGRFBucketsForOperands (node, Opnd_src0, Opnd_src3, BDvec, GRFOnly);
@@ -5169,7 +5169,7 @@ void G4_BB_SB::clearSLMWARWAissue(SBNode* curNode, LiveGRFBuckets* LB)
51695169 {
51705170 SBBucketNode* liveBN = (*it);
51715171 SBNode* curLiveNode = liveBN->node ;
5172- G4_INST* liveInst = liveBN->inst ;
5172+ G4_INST* liveInst = liveBN->footprint -> inst ;
51735173
51745174 if (liveInst->isSend () &&
51755175 isSLMMsg (liveInst) && liveInst->getDst () != nullptr && !liveInst->getDst ()->isNullReg ())
@@ -5848,15 +5848,15 @@ void G4_BB_SB::SBDDD(G4_BB* bb,
58485848 }
58495849
58505850 // Get buckets for all GRF registers which are used in curInst
5851- std::vector<SBBucketDescr > BDvec;
5852- std::vector<SBBucketDescr > liveBDvec;
5851+ std::vector<SBBucketDesc > BDvec;
5852+ std::vector<SBBucketDesc > liveBDvec;
58535853 BDvec.clear ();
58545854 liveBDvec.clear ();
58555855
5856- getGRFBucketDescrs (node, BDvec, false );
5856+ getGRFBucketDescs (node, BDvec, false );
58575857 if (node->instVec .size () > 1 )
58585858 {
5859- getGRFBucketDescrs (node, liveBDvec, false );
5859+ getGRFBucketDescs (node, liveBDvec, false );
58605860 }
58615861
58625862 if (builder.hasThreeALUPipes () || builder.hasFourALUPipes ())
@@ -5936,10 +5936,10 @@ void G4_BB_SB::SBDDD(G4_BB* bb,
59365936 bool instKill = false ;
59375937
59385938 // For all bucket descriptors of curInst
5939- for (const SBBucketDescr & BD : BDvec) {
5939+ for (const SBBucketDesc & BD : BDvec) {
59405940 const int & curBucket = BD.bucket ;
59415941 const Gen4_Operand_Number& curOpnd = BD.opndNum ;
5942- const SBFootprint* curFootprint = BD.node -> getFootprint (BD. opndNum , BD. inst ) ;
5942+ const SBFootprint* curFootprint = BD.footprint ;
59435943
59445944 // Check liveness for each live curBucket node.
59455945 // Add explicit dependence if liveness is killed and there is no implicit dependence
@@ -5960,8 +5960,8 @@ void G4_BB_SB::SBDDD(G4_BB* bb,
59605960
59615961 unsigned short internalOffset = 0 ;
59625962 Gen4_Operand_Number liveOpnd = liveBN->opndNum ;
5963- G4_INST* liveInst = liveBN->inst ;
5964- const SBFootprint* liveFootprint = liveNode-> getFootprint (liveBN-> opndNum , liveInst) ;
5963+ const SBFootprint* liveFootprint = liveBN->footprint ;
5964+ G4_INST* liveInst = liveFootprint-> inst ;
59655965
59665966 bool hasOverlap = curFootprint->hasOverlap (liveFootprint, internalOffset);
59675967 bool hasRMWOverlap = false ;
@@ -6290,33 +6290,33 @@ void G4_BB_SB::SBDDD(G4_BB* bb,
62906290 // Add buckets of current instruction to bucket list
62916291 if (node->instVec .size () > 1 )
62926292 {
6293- std::map<G4_INST *, std::vector<SBBucketNode*>> bucketNodes;
6294- for (const SBBucketDescr & BD : liveBDvec)
6293+ std::map<const SBFootprint *, std::vector<SBBucketNode*>> bucketNodes;
6294+ for (const SBBucketDesc & BD : liveBDvec)
62956295 {
6296- auto iter = std::find_if (bucketNodes[BD.inst ].begin (), bucketNodes[BD.inst ].end (),
6296+ auto iter = std::find_if (bucketNodes[BD.footprint ].begin (), bucketNodes[BD.footprint ].end (),
62976297 [&BD](SBBucketNode* node) {return BD.opndNum == node->opndNum ; });
6298- if (iter != bucketNodes[BD.inst ].end ())
6298+ if (iter != bucketNodes[BD.footprint ].end ())
62996299 {
63006300 LB->add ((*iter), BD.bucket );
63016301 }
63026302 else
63036303 {
63046304 void * allocedMem = mem.alloc (sizeof (SBBucketNode));
6305- SBBucketNode* newNode = new (allocedMem)SBBucketNode (node, BD.opndNum , BD.inst );
6306- bucketNodes[BD.inst ].push_back (newNode);
6305+ SBBucketNode* newNode = new (allocedMem)SBBucketNode (node, BD.opndNum , BD.footprint );
6306+ bucketNodes[BD.footprint ].push_back (newNode);
63076307 LB->add (newNode, BD.bucket );
63086308 }
63096309 }
63106310 }
63116311 else
63126312 {
63136313 std::vector<SBBucketNode*> bucketNodes (Opnd_total_num, nullptr ); // The coarse grained footprint of operands
6314- for (const SBBucketDescr & BD : BDvec)
6314+ for (const SBBucketDesc & BD : BDvec)
63156315 {
63166316 if (bucketNodes[BD.opndNum ] == nullptr )
63176317 {
63186318 void * allocedMem = mem.alloc (sizeof (SBBucketNode));
6319- SBBucketNode* newNode = new (allocedMem)SBBucketNode (node, BD.opndNum , BD.inst );
6319+ SBBucketNode* newNode = new (allocedMem)SBBucketNode (node, BD.opndNum , BD.footprint );
63206320 bucketNodes[BD.opndNum ] = newNode;
63216321 }
63226322
@@ -6786,35 +6786,35 @@ void SWSB::addGlobalDependence(unsigned globalSendNum, SBBUCKET_VECTOR* globalSe
67866786 }
67876787
67886788 // Scan BB again to figure out the dependence caused by global send operands
6789- std::vector<SBBucketDescr > BDvec;
6789+ std::vector<SBBucketDesc > BDvec;
67906790 for (int j = BBVector[i]->first_node ; j <= BBVector[i]->last_node ; j++)
67916791 {
67926792 SBNode* node = (*SBNodes)[j];
67936793 G4_INST* curInst = node->getLastInstruction ();
67946794
67956795 BDvec.clear ();
6796- BBVector[i]->getGRFBucketDescrs (node, BDvec, true );
6796+ BBVector[i]->getGRFBucketDescs (node, BDvec, true );
67976797 if (!BDvec.size ())
67986798 {
67996799 continue ;
68006800 }
68016801
68026802 bool instKill = false ;
68036803 // For all bucket descriptors of curInst
6804- for (const SBBucketDescr & BD : BDvec)
6804+ for (const SBBucketDesc & BD : BDvec)
68056805 {
68066806 const int & curBucket = BD.bucket ;
68076807 const Gen4_Operand_Number& curOpnd = BD.opndNum ;
6808- const SBFootprint* curFootprint = BD.node -> getFootprint (BD. opndNum , BD. inst ) ;
6808+ const SBFootprint* curFootprint = BD.footprint ;
68096809
68106810 for (LiveGRFBuckets::BN_iterator bn_it = send_use_kills.begin (curBucket);
68116811 bn_it != send_use_kills.end (curBucket);)
68126812 {
68136813 SBBucketNode* liveBN = (*bn_it);
68146814 SBNode* curLiveNode = liveBN->node ;
68156815 Gen4_Operand_Number liveOpnd = liveBN->opndNum ;
6816- G4_INST* liveInst = liveBN->inst ;
6817- const SBFootprint* liveFootprint = curLiveNode-> getFootprint (liveBN-> opndNum , liveInst) ;
6816+ const SBFootprint* liveFootprint = liveBN->footprint ;
6817+ G4_INST* liveInst = liveFootprint-> inst ;
68186818 unsigned short internalOffset = 0 ;
68196819 bool hasOverlap = curFootprint->hasOverlap (liveFootprint, internalOffset);
68206820
@@ -7144,14 +7144,14 @@ void SWSB::addGlobalDependenceWithReachingDef(unsigned globalSendNum, SBBUCKET_V
71447144 localTokenUsage.clear (); // Add to the live node
71457145
71467146 // Scan BB again to figure out the dependence caused by global send operands
7147- std::vector<SBBucketDescr > BDvec;
7147+ std::vector<SBBucketDesc > BDvec;
71487148 for (int j = BBVector[i]->first_node ; j <= BBVector[i]->last_node ; j++)
71497149 {
71507150 SBNode* node = (*SBNodes)[j];
71517151 G4_INST* curInst = (*SBNodes)[j]->getLastInstruction ();
71527152
71537153 BDvec.clear ();
7154- BBVector[i]->getGRFBucketDescrs (node, BDvec, true );
7154+ BBVector[i]->getGRFBucketDescs (node, BDvec, true );
71557155 if (!BDvec.size ())
71567156 {
71577157 continue ;
@@ -7178,20 +7178,20 @@ void SWSB::addGlobalDependenceWithReachingDef(unsigned globalSendNum, SBBUCKET_V
71787178
71797179 bool instKill = false ;
71807180 // For all bucket descriptors of curInst
7181- for (const SBBucketDescr & BD : BDvec)
7181+ for (const SBBucketDesc & BD : BDvec)
71827182 {
71837183 const int & curBucket = BD.bucket ;
71847184 const Gen4_Operand_Number& curOpnd = BD.opndNum ;
7185- const SBFootprint* curFootprint = BD.node -> getFootprint (BD. opndNum , BD. inst ) ;
7185+ const SBFootprint* curFootprint = BD.footprint ;
71867186
71877187 for (LiveGRFBuckets::BN_iterator bn_it = send_use_kills.begin (curBucket);
71887188 bn_it != send_use_kills.end (curBucket);)
71897189 {
71907190 SBBucketNode* liveBN = (*bn_it);
71917191 SBNode* curLiveNode = liveBN->node ;
71927192 Gen4_Operand_Number liveOpnd = liveBN->opndNum ;
7193- G4_INST* liveInst = liveBN->inst ;
7194- const SBFootprint* liveFootprint = curLiveNode-> getFootprint (liveBN-> opndNum , liveInst) ;
7193+ const SBFootprint* liveFootprint = liveBN->footprint ;
7194+ G4_INST* liveInst = liveFootprint-> inst ;
71957195 unsigned short internalOffset = 0 ;
71967196 bool hasOverlap = curFootprint->hasOverlap (liveFootprint, internalOffset);
71977197
0 commit comments