@@ -560,16 +560,26 @@ send.dc0 (16|M0) r38 r118 null 0x0 a0.0 ret (16|M0)
560
560
561
561
Right now mov will have false dependense on the first send.
562
562
*/
563
- void SWSBAnalyzer::clearSBIDDependence (InstList::iterator insertPoint,
563
+ bool SWSBAnalyzer::clearSBIDDependence (InstList::iterator insertPoint,
564
564
Instruction *lastInst, Block *bb) {
565
+
566
+ auto clearSBID = [&](const SBID& in) {
567
+ m_freeSBIDList[in.sbid ].reset ();
568
+ assert (m_IdToDepSetMap.find (in.sbid ) != m_IdToDepSetMap.end ());
569
+ assert (m_IdToDepSetMap[in.sbid ].first ->getDepClass () ==
570
+ DEP_CLASS::OUT_OF_ORDER);
571
+ clearDepBuckets (*m_IdToDepSetMap[in.sbid ].first );
572
+ clearDepBuckets (*m_IdToDepSetMap[in.sbid ].second );
573
+ };
574
+
565
575
bool sbidInUse = false ;
566
576
for (uint32_t i = 0 ; i < m_SBIDCount; ++i) {
567
577
// there are still dependencies that might be used outside of this basic
568
578
// block
569
579
if (!m_freeSBIDList[i].isFree ) {
580
+ clearSBID (m_freeSBIDList[i]);
570
581
sbidInUse = true ;
571
582
}
572
- m_freeSBIDList[i].reset ();
573
583
}
574
584
575
585
// if last instruction in basic block is EOT no need to generate flushes
@@ -583,6 +593,8 @@ void SWSBAnalyzer::clearSBIDDependence(InstList::iterator insertPoint,
583
593
if (sbidInUse) {
584
594
insertSyncAllRdWr (insertPoint, bb);
585
595
}
596
+
597
+ return sbidInUse;
586
598
}
587
599
588
600
// Keeping track of dependencies that need to be cleared because they are no
@@ -1302,10 +1314,9 @@ void SWSBAnalyzer::run() {
1302
1314
InstListIterator insert_point = instIter;
1303
1315
if (first_inst_in_dpas_macro != instList.end ())
1304
1316
insert_point = first_inst_in_dpas_macro;
1305
- if (input->getDepClass () == DEP_CLASS::OUT_OF_ORDER)
1317
+ bool forceSyncAll = clearSBIDDependence (insert_point, inst, bb);
1318
+ if (!forceSyncAll && input->getDepClass () == DEP_CLASS::OUT_OF_ORDER)
1306
1319
insertSyncAllRdWr (insert_point, bb);
1307
- else
1308
- clearSBIDDependence (insert_point, inst, bb);
1309
1320
1310
1321
// clear in-order dependency
1311
1322
clearBuckets (input, output);
0 commit comments