Skip to content

Commit 6bb7bd0

Browse files
weiyu-chenigcbot
authored andcommitted
Re-enable memory fence scheduling and do not schedule it beyond branches.
1 parent 49ea47e commit 6bb7bd0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

visa/Optimizer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6907,7 +6907,7 @@ bool Optimizer::foldPseudoAndOr(G4_BB* bb, INST_LIST_ITER& ii)
69076907
for (auto E = bb->end(); I != E; ++I)
69086908
{
69096909
G4_INST* inst = *I;
6910-
if (inst->isSend() || inst->isOptBarrier())
6910+
if (inst->isSend() || inst->isCFInst() || inst->isLabel() || inst->isOptBarrier())
69116911
{
69126912
break;
69136913
}
@@ -6951,6 +6951,7 @@ bool Optimizer::foldPseudoAndOr(G4_BB* bb, INST_LIST_ITER& ii)
69516951
builder.phyregpool.getNullReg(), 0, 0, 1, fenceDcl->getElemType());
69526952
G4_SrcRegRegion* movSrc = builder.Create_Src_Opnd_From_Dcl(fenceDcl, builder.createRegionDesc(8, 8, 1));
69536953
G4_INST* movInst = builder.createMov(g4::SIMD8, movDst, movSrc, InstOpt_WriteEnable, false);
6954+
movInst->setComments("memory fence commit");
69546955
bb->insertBefore(nextIter, movInst);
69556956
}
69566957
return true;

visa/include/VISAOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ DEF_VISA_OPTION(vISA_reassociate, ET_BOOL, "-noreassoc", UNUSED, tru
7575
DEF_VISA_OPTION(vISA_split4GRFVar, ET_BOOL, "-no4GRFSplit", UNUSED, true)
7676
DEF_VISA_OPTION(vISA_divergentBB, ET_BOOL, "-divergentBB", UNUSED, true)
7777
DEF_VISA_OPTION(vISA_splitInstructions, ET_BOOL, "-noSplitInstructions", UNUSED, true)
78-
DEF_VISA_OPTION(vISA_scheduleFenceCommit, ET_BOOL, NULLSTR, UNUSED, false)
78+
DEF_VISA_OPTION(vISA_scheduleFenceCommit, ET_BOOL, NULLSTR, UNUSED, true)
7979

8080
//=== code gen options ===
8181
DEF_VISA_OPTION(vISA_noSrc1Byte, ET_BOOL, "-nosrc1byte", UNUSED, false)

0 commit comments

Comments
 (0)