Skip to content

Commit ba66269

Browse files
committed
[Autobackout][FuncReg]Revert of change: 3bc2e64
To remove one sync instruction Change-Id: Ib547636bd42fb12f83130f3873434ccdabc944f0
1 parent 1ba7d6d commit ba66269

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

visa/LocalScheduler/SWSB_G4IR.cpp

+8-18
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,7 @@ G4_INST* SWSB::insertSyncAllWRInstruction(G4_BB* bb, unsigned int SBIDs, INST_LI
20812081
return syncInst;
20822082
}
20832083

2084-
bool SWSB::insertSyncToken(G4_BB *bb, SBNode *node, G4_INST *inst, INST_LIST_ITER inst_it, int newInstID, BitSet *dstTokens, BitSet *srcTokens, bool removeAllToken)
2084+
void SWSB::insertSyncToken(G4_BB* bb, SBNode* node, G4_INST* inst, INST_LIST_ITER inst_it, int newInstID, BitSet* dstTokens, BitSet* srcTokens, bool removeAllToken)
20852085
{
20862086
//Non-test instruction can only have
20872087
// 1. non-send: one Dst Token with distance, or
@@ -2097,8 +2097,6 @@ bool SWSB::insertSyncToken(G4_BB *bb, SBNode *node, G4_INST *inst, INST_LIST_ITE
20972097
unsigned short dstToken = (unsigned short)-1;
20982098
unsigned short srcToken = (unsigned short)-1;
20992099
SWSBTokenType type = G4_INST::SWSBTokenType::TOKEN_NONE;
2100-
bool insertedSync = false;
2101-
21022100
for (unsigned int i = 0; i < node->GetInstruction()->getDepTokenNum();)
21032101
{
21042102
G4_INST* synAllInst = nullptr;
@@ -2214,7 +2212,6 @@ bool SWSB::insertSyncToken(G4_BB *bb, SBNode *node, G4_INST *inst, INST_LIST_ITE
22142212
synInst->setDepToken(dstToken, SWSBTokenType::AFTER_WRITE);
22152213
}
22162214
synInst->setLexicalId(newInstID);
2217-
insertedSync = true;
22182215
}
22192216

22202217
if (src)
@@ -2233,31 +2230,23 @@ bool SWSB::insertSyncToken(G4_BB *bb, SBNode *node, G4_INST *inst, INST_LIST_ITE
22332230
synInst->setDepToken(srcToken, SWSBTokenType::AFTER_READ);
22342231
}
22352232
synInst->setLexicalId(newInstID);
2236-
insertedSync = true;
22372233
}
22382234

2239-
return insertedSync;
2235+
return;
22402236
}
22412237

22422238

22432239
void SWSB::insertSync(G4_BB* bb, SBNode* node, G4_INST* inst, INST_LIST_ITER inst_it, int newInstID, BitSet* dstTokens, BitSet* srcTokens, bool hasDistOneAreg)
22442240
{
2245-
bool insertedSync = false;
2246-
INST_LIST_ITER prevIt = inst_it;
2241+
G4_INST* syncInst = nullptr;
22472242
if (hasDistOneAreg)
22482243
{
2249-
prevIt--;
2250-
}
2251-
2252-
{
2253-
insertedSync = insertSyncToken(bb, node, inst, inst_it, newInstID, dstTokens, srcTokens, false);
2244+
syncInst = insertSyncInstructionAfter(bb, inst_it, inst->getCISAOff(), inst->getLineNo());
2245+
syncInst->setDistance(1);
22542246
}
22552247

2256-
if (hasDistOneAreg && insertedSync)
22572248
{
2258-
G4_INST* syncInst = nullptr;
2259-
syncInst = insertSyncInstructionAfter(bb, prevIt, inst->getCISAOff(), inst->getLineNo());
2260-
syncInst->setDistance(1);
2249+
insertSyncToken(bb, node, inst, inst_it, newInstID, dstTokens, srcTokens, false);
22612250
}
22622251
}
22632252

@@ -3359,7 +3348,6 @@ void G4_BB_SB::SBDDD(G4_BB* bb,
33593348
if (hasFollowDistOneAReg)
33603349
{
33613350
node->setDistance(1);
3362-
node->setDistOneAReg();
33633351
hasFollowDistOneAReg = false;
33643352
}
33653353

@@ -3369,6 +3357,8 @@ void G4_BB_SB::SBDDD(G4_BB* bb,
33693357
if (hasFollowDistOneAReg)
33703358
{
33713359
node->setDistance(1);
3360+
node->setDistOneAReg();
3361+
33723362
}
33733363

33743364

visa/LocalScheduler/SWSB_G4IR.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ namespace vISA
10401040
//Assign Token
10411041
void assignToken(SBNode *node, unsigned short token, uint32_t &tokenReuseCount, uint32_t &AWTokenReuseCount, uint32_t &ARTokenReuseCount, uint32_t &AATokenReuseCount);
10421042
void assignDepToken(SBNode *node);
1043-
bool insertSyncToken(G4_BB *bb, SBNode *node, G4_INST *inst, INST_LIST_ITER inst_it, int newInstID, BitSet *dstTokens, BitSet *srcTokens, bool removeAllTokens);
1043+
void insertSyncToken(G4_BB *bb, SBNode *node, G4_INST *inst, INST_LIST_ITER inst_it, int newInstID, BitSet *dstTokens, BitSet *srcTokens, bool removeAllTokens);
10441044
void insertSync(G4_BB *bb, SBNode *node, G4_INST *inst, INST_LIST_ITER inst_it, int newInstID, BitSet *dstTokens, BitSet *srcTokens, bool hasDistOneAreg);
10451045
void insertTest();
10461046

0 commit comments

Comments
 (0)