Skip to content

Commit 1264337

Browse files
DianaChenigcbot
authored andcommitted
IGA: Fixed SWSB for write-combined block
Fixed a bug that distance swsb info for the write-combined instructions block was missing when the last instruction in the write-combined block is also the last instruction of the BB. Insert a sync.nop at the end of the BB to carry the distance swsb info for the case.
1 parent 806fdb3 commit 1264337

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

visa/iga/IGALibrary/IR/SWSBSetter.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,8 +929,21 @@ void SWSBAnalyzer::postProcess() {
929929
// insert distance dependency to the instruction following the block
930930
InstListIterator next = inst_it;
931931
next++;
932-
if (next == instList.end())
932+
// if the last instruction in the atomic block is the last instruction
933+
// in the BB, insert a sync.nop to carry the required SWSB info
934+
// For example:
935+
// BB0:
936+
// (W) mov (32|M0) r13.0<2>:ub r50.0<1;1,0>:uw {Atomic}
937+
// (W) mov (32|M0) r13.1<2>:ub r52.0<1;1,0>:uw {Atomic}
938+
// (W) mov (32|M0) r13.2<2>:ub r54.0<1;1,0>:uw {Atomic}
939+
// (W) mov (32|M0) r13.3<2>:ub r56.0<1;1,0>:uw
940+
// (W) sync.nop {I@1} // insert nop
941+
// BB1:
942+
// add (1) r13.0<1>:df r100.0<0;1,0>:df
943+
if (next == instList.end()) {
944+
instList.push_back(m_kernel.createSyncNopInstruction(allDistSWSB));
933945
break;
946+
}
934947
addSWSBToInst(next, allDistSWSB, *bb);
935948
}
936949
}

0 commit comments

Comments
 (0)