fixing LDS read sync issue for 'suppress no-load-loop' config
@@ -5981,15 +5981,6 @@ class KernelWriterAssembly(KernelWriter):
if self.db["InitSgpr"] & 0x2:
kStr += self.sgprPool.initTmps(self.initSgprValue)
- # copy accumulated C from agpr to vgpr
- if "MatrixInstM" in kernel:
- #for i in range(0, self.totalAgprs):
- # kStr += inst("v_accvgpr_read_b32", vgpr("ValuC+%u"%i), "acc%u"%i, "copy areg to vreg")
- #TODO avoid s_nop if its possible
- instCycles = kernel["MatrixInstM"] // 2 # 32x32 is 64 cycles, 16x16 is 32 cycles, 4x4 is 8 cycles
- kStr += "s_nop %u\n" % instCycles
- kStr += self.MapAcctoArchRegs(kernel,option=0)
-
if self.db["ConservativeWaitCnt"] & 0x10:
kStr += "s_barrier // debug" + self.endLine
kStr += "s_waitcnt lgkmcnt(0) & vmcnt(0)" + self.endLine
@@ -6001,6 +5992,15 @@ class KernelWriterAssembly(KernelWriter):
if self.archCaps["SeparateVscnt"]:
kStr += inst("s_waitcnt_vscnt", "null", "0", "writes")
+ # copy accumulated C from agpr to vgpr
+ if "MatrixInstM" in kernel:
+ #for i in range(0, self.totalAgprs):
+ # kStr += inst("v_accvgpr_read_b32", vgpr("ValuC+%u"%i), "acc%u"%i, "copy areg to vreg")
+ #TODO avoid s_nop if its possible
+ instCycles = kernel["MatrixInstM"] // 2 # 32x32 is 64 cycles, 16x16 is 32 cycles, 4x4 is 8 cycles
+ kStr += "s_nop %u\n" % instCycles
+ kStr += self.MapAcctoArchRegs(kernel,option=0)
+
return kStr
##############################################################################
