@@ -4679,7 +4679,7 @@ void G4_BB_SB::setSendOpndMayKilled(LiveGRFBuckets* globalSendsLB,
4679
4679
SBNODE_VECT* SBNodes,
4680
4680
PointsToAnalysis& p)
4681
4681
{
4682
- std::vector<SBBucketDescr > BDvec;
4682
+ std::vector<SBBucketDesc > BDvec;
4683
4683
if (first_node == -1 )
4684
4684
{
4685
4685
return ;
@@ -4697,26 +4697,26 @@ void G4_BB_SB::setSendOpndMayKilled(LiveGRFBuckets* globalSendsLB,
4697
4697
}
4698
4698
4699
4699
BDvec.clear ();
4700
- getGRFBucketDescrs (node, BDvec, true );
4700
+ getGRFBucketDescs (node, BDvec, true );
4701
4701
if (!BDvec.size ())
4702
4702
{
4703
4703
continue ;
4704
4704
}
4705
4705
4706
4706
// For all bucket descriptors of curInst
4707
- for (const SBBucketDescr & BD : BDvec) {
4707
+ for (const SBBucketDesc & BD : BDvec) {
4708
4708
const int & curBucket = BD.bucket ;
4709
4709
const Gen4_Operand_Number& curOpnd = BD.opndNum ;
4710
- const SBFootprint* curFootprint = BD.node -> getFootprint (BD. opndNum , BD. inst ) ;
4710
+ const SBFootprint* curFootprint = BD.footprint ;
4711
4711
4712
4712
for (LiveGRFBuckets::BN_iterator bn_it = globalSendsLB->begin (curBucket);
4713
4713
bn_it != globalSendsLB->end (curBucket);)
4714
4714
{
4715
4715
SBBucketNode* liveBN = (*bn_it);
4716
4716
SBNode* curLiveNode = liveBN->node ;
4717
4717
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 ;
4720
4720
4721
4721
// Send operands are all GRF aligned, there is no overlap checking required.
4722
4722
// 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,
4743
4743
}
4744
4744
4745
4745
if (dep == WAR &&
4746
- WARDepRequired (liveInst, BD. inst ))
4746
+ WARDepRequired (liveInst, curFootprint-> inst ))
4747
4747
{
4748
4748
send_may_kill.setSrc (curLiveNode->globalID , true );
4749
4749
}
@@ -4779,7 +4779,7 @@ void G4_BB_SB::setSendOpndMayKilled(LiveGRFBuckets* globalSendsLB,
4779
4779
{
4780
4780
SBBucketNode* liveBN = (*bn_it);
4781
4781
SBNode* curLiveNode = liveBN->node ;
4782
- G4_INST* liveInst = liveBN->inst ;
4782
+ G4_INST* liveInst = liveBN->footprint -> inst ;
4783
4783
4784
4784
if (liveInst->isSend () &&
4785
4785
isSLMMsg (liveInst) && liveInst->getDst () != nullptr && !liveInst->getDst ()->isNullReg ())
@@ -4964,7 +4964,7 @@ void G4_BB_SB::getGRFFootprintForIndirect(SBNode* node,
4964
4964
void G4_BB_SB::getGRFBuckets (SBNode* node,
4965
4965
const SBFootprint* footprint,
4966
4966
Gen4_Operand_Number opndNum,
4967
- std::vector<SBBucketDescr >& BDvec,
4967
+ std::vector<SBBucketDesc >& BDvec,
4968
4968
bool GRFOnly)
4969
4969
{
4970
4970
for (const SBFootprint* curFootprint = footprint; curFootprint != nullptr ; curFootprint = curFootprint->next )
@@ -4986,7 +4986,7 @@ void G4_BB_SB::getGRFBuckets(SBNode* node,
4986
4986
for (int j = startingBucket;
4987
4987
j < (startingBucket + numBuckets); j++)
4988
4988
{
4989
- BDvec.push_back (SBBucketDescr (j, opndNum, node, curFootprint-> inst ));
4989
+ BDvec.push_back (SBBucketDesc (j, opndNum, node, curFootprint));
4990
4990
}
4991
4991
}
4992
4992
}
@@ -5029,7 +5029,7 @@ bool G4_BB_SB::getGRFFootPrintOperands(SBNode* node,
5029
5029
void G4_BB_SB::getGRFBucketsForOperands (SBNode* node,
5030
5030
Gen4_Operand_Number first_opnd,
5031
5031
Gen4_Operand_Number last_opnd,
5032
- std::vector<SBBucketDescr >& BDvec,
5032
+ std::vector<SBBucketDesc >& BDvec,
5033
5033
bool GRFOnly)
5034
5034
{
5035
5035
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)
5059
5059
return hasDistOneAReg;
5060
5060
}
5061
5061
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)
5063
5063
{
5064
5064
// We get the description for source first, so for current instruction, the scan order is src0, src1, src2, src3, dst
5065
5065
getGRFBucketsForOperands (node, Opnd_src0, Opnd_src3, BDvec, GRFOnly);
@@ -5169,7 +5169,7 @@ void G4_BB_SB::clearSLMWARWAissue(SBNode* curNode, LiveGRFBuckets* LB)
5169
5169
{
5170
5170
SBBucketNode* liveBN = (*it);
5171
5171
SBNode* curLiveNode = liveBN->node ;
5172
- G4_INST* liveInst = liveBN->inst ;
5172
+ G4_INST* liveInst = liveBN->footprint -> inst ;
5173
5173
5174
5174
if (liveInst->isSend () &&
5175
5175
isSLMMsg (liveInst) && liveInst->getDst () != nullptr && !liveInst->getDst ()->isNullReg ())
@@ -5848,15 +5848,15 @@ void G4_BB_SB::SBDDD(G4_BB* bb,
5848
5848
}
5849
5849
5850
5850
// 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;
5853
5853
BDvec.clear ();
5854
5854
liveBDvec.clear ();
5855
5855
5856
- getGRFBucketDescrs (node, BDvec, false );
5856
+ getGRFBucketDescs (node, BDvec, false );
5857
5857
if (node->instVec .size () > 1 )
5858
5858
{
5859
- getGRFBucketDescrs (node, liveBDvec, false );
5859
+ getGRFBucketDescs (node, liveBDvec, false );
5860
5860
}
5861
5861
5862
5862
if (builder.hasThreeALUPipes () || builder.hasFourALUPipes ())
@@ -5936,10 +5936,10 @@ void G4_BB_SB::SBDDD(G4_BB* bb,
5936
5936
bool instKill = false ;
5937
5937
5938
5938
// For all bucket descriptors of curInst
5939
- for (const SBBucketDescr & BD : BDvec) {
5939
+ for (const SBBucketDesc & BD : BDvec) {
5940
5940
const int & curBucket = BD.bucket ;
5941
5941
const Gen4_Operand_Number& curOpnd = BD.opndNum ;
5942
- const SBFootprint* curFootprint = BD.node -> getFootprint (BD. opndNum , BD. inst ) ;
5942
+ const SBFootprint* curFootprint = BD.footprint ;
5943
5943
5944
5944
// Check liveness for each live curBucket node.
5945
5945
// 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,
5960
5960
5961
5961
unsigned short internalOffset = 0 ;
5962
5962
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 ;
5965
5965
5966
5966
bool hasOverlap = curFootprint->hasOverlap (liveFootprint, internalOffset);
5967
5967
bool hasRMWOverlap = false ;
@@ -6290,33 +6290,33 @@ void G4_BB_SB::SBDDD(G4_BB* bb,
6290
6290
// Add buckets of current instruction to bucket list
6291
6291
if (node->instVec .size () > 1 )
6292
6292
{
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)
6295
6295
{
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 (),
6297
6297
[&BD](SBBucketNode* node) {return BD.opndNum == node->opndNum ; });
6298
- if (iter != bucketNodes[BD.inst ].end ())
6298
+ if (iter != bucketNodes[BD.footprint ].end ())
6299
6299
{
6300
6300
LB->add ((*iter), BD.bucket );
6301
6301
}
6302
6302
else
6303
6303
{
6304
6304
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);
6307
6307
LB->add (newNode, BD.bucket );
6308
6308
}
6309
6309
}
6310
6310
}
6311
6311
else
6312
6312
{
6313
6313
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)
6315
6315
{
6316
6316
if (bucketNodes[BD.opndNum ] == nullptr )
6317
6317
{
6318
6318
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 );
6320
6320
bucketNodes[BD.opndNum ] = newNode;
6321
6321
}
6322
6322
@@ -6786,35 +6786,35 @@ void SWSB::addGlobalDependence(unsigned globalSendNum, SBBUCKET_VECTOR* globalSe
6786
6786
}
6787
6787
6788
6788
// Scan BB again to figure out the dependence caused by global send operands
6789
- std::vector<SBBucketDescr > BDvec;
6789
+ std::vector<SBBucketDesc > BDvec;
6790
6790
for (int j = BBVector[i]->first_node ; j <= BBVector[i]->last_node ; j++)
6791
6791
{
6792
6792
SBNode* node = (*SBNodes)[j];
6793
6793
G4_INST* curInst = node->getLastInstruction ();
6794
6794
6795
6795
BDvec.clear ();
6796
- BBVector[i]->getGRFBucketDescrs (node, BDvec, true );
6796
+ BBVector[i]->getGRFBucketDescs (node, BDvec, true );
6797
6797
if (!BDvec.size ())
6798
6798
{
6799
6799
continue ;
6800
6800
}
6801
6801
6802
6802
bool instKill = false ;
6803
6803
// For all bucket descriptors of curInst
6804
- for (const SBBucketDescr & BD : BDvec)
6804
+ for (const SBBucketDesc & BD : BDvec)
6805
6805
{
6806
6806
const int & curBucket = BD.bucket ;
6807
6807
const Gen4_Operand_Number& curOpnd = BD.opndNum ;
6808
- const SBFootprint* curFootprint = BD.node -> getFootprint (BD. opndNum , BD. inst ) ;
6808
+ const SBFootprint* curFootprint = BD.footprint ;
6809
6809
6810
6810
for (LiveGRFBuckets::BN_iterator bn_it = send_use_kills.begin (curBucket);
6811
6811
bn_it != send_use_kills.end (curBucket);)
6812
6812
{
6813
6813
SBBucketNode* liveBN = (*bn_it);
6814
6814
SBNode* curLiveNode = liveBN->node ;
6815
6815
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 ;
6818
6818
unsigned short internalOffset = 0 ;
6819
6819
bool hasOverlap = curFootprint->hasOverlap (liveFootprint, internalOffset);
6820
6820
@@ -7144,14 +7144,14 @@ void SWSB::addGlobalDependenceWithReachingDef(unsigned globalSendNum, SBBUCKET_V
7144
7144
localTokenUsage.clear (); // Add to the live node
7145
7145
7146
7146
// Scan BB again to figure out the dependence caused by global send operands
7147
- std::vector<SBBucketDescr > BDvec;
7147
+ std::vector<SBBucketDesc > BDvec;
7148
7148
for (int j = BBVector[i]->first_node ; j <= BBVector[i]->last_node ; j++)
7149
7149
{
7150
7150
SBNode* node = (*SBNodes)[j];
7151
7151
G4_INST* curInst = (*SBNodes)[j]->getLastInstruction ();
7152
7152
7153
7153
BDvec.clear ();
7154
- BBVector[i]->getGRFBucketDescrs (node, BDvec, true );
7154
+ BBVector[i]->getGRFBucketDescs (node, BDvec, true );
7155
7155
if (!BDvec.size ())
7156
7156
{
7157
7157
continue ;
@@ -7178,20 +7178,20 @@ void SWSB::addGlobalDependenceWithReachingDef(unsigned globalSendNum, SBBUCKET_V
7178
7178
7179
7179
bool instKill = false ;
7180
7180
// For all bucket descriptors of curInst
7181
- for (const SBBucketDescr & BD : BDvec)
7181
+ for (const SBBucketDesc & BD : BDvec)
7182
7182
{
7183
7183
const int & curBucket = BD.bucket ;
7184
7184
const Gen4_Operand_Number& curOpnd = BD.opndNum ;
7185
- const SBFootprint* curFootprint = BD.node -> getFootprint (BD. opndNum , BD. inst ) ;
7185
+ const SBFootprint* curFootprint = BD.footprint ;
7186
7186
7187
7187
for (LiveGRFBuckets::BN_iterator bn_it = send_use_kills.begin (curBucket);
7188
7188
bn_it != send_use_kills.end (curBucket);)
7189
7189
{
7190
7190
SBBucketNode* liveBN = (*bn_it);
7191
7191
SBNode* curLiveNode = liveBN->node ;
7192
7192
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 ;
7195
7195
unsigned short internalOffset = 0 ;
7196
7196
bool hasOverlap = curFootprint->hasOverlap (liveFootprint, internalOffset);
7197
7197
0 commit comments