Skip to content

Commit 99aae78

Browse files
weiyu-chenigcbot
authored andcommitted
Add option to skip memory fence commit.
1 parent e5d89df commit 99aae78

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

visa/Optimizer.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6875,16 +6875,6 @@ bool Optimizer::foldPseudoAndOr(G4_BB* bb, INST_LIST_ITER& ii)
68756875

68766876

68776877
// some workaround for HW restrictions. We apply them here so as not to affect optimizations, RA, and scheduling
6878-
// [DevBDW:A]: A goto instruction must not be followed by any instruction requiring register indirect access on source operands.
6879-
// [DevBDW:A]: A join instruction must not be followed by any instruction requiring register indirect access on source operands.
6880-
// [DevBDW]: A POW/FDIV operation must not be followed by an instruction that requires two destination registers.
6881-
// For BDW A-stepping, we need a WA to prevent the following instructions:
6882-
// Send r10 (read from data port to r10)
6883-
// Send null r10 (write dataport from r10)
6884-
// Insert a dummy mov from r10
6885-
// [BDW+]: call/return's execution size must be set to 16/32 so that the emask will be passed correctly to the callee
6886-
// [BDW,CHV,SKL]: A call instruction must be followed by an instruction that supports Switch.
6887-
// When call takes a jump, the first instruction must have a Switch.
68886878
void Optimizer::HWWorkaround()
68896879
{
68906880
// Ensure the first instruction of a stack function has switch option.
@@ -6908,7 +6898,7 @@ bool Optimizer::foldPseudoAndOr(G4_BB* bb, INST_LIST_ITER& ii)
69086898
G4_INST *inst = *ii;
69096899

69106900
G4_InstSend* sendInst = inst->asSendInst();
6911-
if (sendInst && sendInst->isFence())
6901+
if (sendInst && sendInst->isFence() && !builder.getOption(vISA_skipFenceCommit))
69126902
{
69136903
// ToDo: replace with fence.wait intrinsic so we could hide fence latency by scheduling them apart
69146904
if (sendInst->getMsgDesc()->ResponseLength() > 0)

visa/include/VISAOptions.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ DEF_VISA_OPTION(vISA_SWSBStitch, ET_BOOL, "-SWSBStitch", UNUSED, false)
191191
DEF_VISA_OPTION(vISA_UseOldSubRoutineAugIntf, ET_BOOL, (IGC_MANGLE("-useOldSubRoutineAugIntf")), UNUSED, false)
192192
DEF_VISA_OPTION(vISA_FastCompileRA, ET_BOOL, (IGC_MANGLE("-fastCompileRA")), UNUSED, false)
193193
DEF_VISA_OPTION(vISA_HybridRAWithSpill, ET_BOOL, (IGC_MANGLE("-hybridRAWithSpill")), UNUSED, false)
194+
194195
//=== binary emission options ===
195196
DEF_VISA_OPTION(vISA_Compaction, ET_BOOL, "-nocompaction", UNUSED, true)
196197
DEF_VISA_OPTION(vISA_BXMLEncoder, ET_BOOL, "-nobxmlencoder", UNUSED, true)
@@ -231,6 +232,7 @@ DEF_VISA_OPTION(vISA_ReRAPostSchedule, ET_BOOL, "-rerapostschedule", UNUSED
231232
DEF_VISA_OPTION(vISA_GTPinReRA, ET_BOOL, "-GTPinReRA", UNUSED, false)
232233
DEF_VISA_OPTION(vISA_GetFreeGRFInfo, ET_BOOL, "-getfreegrfinfo", UNUSED, false)
233234
DEF_VISA_OPTION(vISA_GTPinScratchAreaSize,ET_INT32, "-GTPinScratchAreaSize", UNUSED, 0)
235+
DEF_VISA_OPTION(vISA_skipFenceCommit, ET_BOOL, "-skipFenceCommit", UNUSED, false)
234236

235237
//=== HW Workarounds ===
236238
DEF_VISA_OPTION(vISA_clearScratchWritesBeforeEOT, ET_BOOL, NULLSTR, UNUSED, false)
@@ -253,7 +255,6 @@ DEF_VISA_OPTION(vISA_setStartBreakPoint, ET_BOOL, "-setstartbp", UNUSED
253255
DEF_VISA_OPTION(vISA_InsertHashMovs, ET_BOOL, NULLSTR, UNUSED, false)
254256
DEF_VISA_OPTION(vISA_InsertDummyMovForHWRSWA, ET_BOOL, "-insertRSDummyMov", UNUSED, false)
255257
DEF_VISA_OPTION(vISA_registerHWRSWA, ET_INT32, "-dummyRegisterHWRSWA", UNUSED, 0)
256-
// insert a dummy instruction at the beginning
257258
DEF_VISA_OPTION(vISA_InsertDummyCompactInst, ET_BOOL, "-insertDummyCompactInst", UNUSED, false)
258259
DEF_VISA_OPTION(VISA_AsmFileNameUser, ET_BOOL, NULLSTR, UNUSED, false)
259260
DEF_VISA_OPTION(vISA_HashVal, ET_2xINT32, "-hashmovs", "USAGE: -hashmovs hi32 lo32\n", 0)

0 commit comments

Comments
 (0)