Skip to content

Commit a2a7ca4

Browse files
bcheng0127igcbot
authored andcommitted
Bump up GRF mode for forceBCR
When forceBCR is applied, there are a lot of bank conflict. Bump up GRF mode to reduce conflict
1 parent 10694dd commit a2a7ca4

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4259,6 +4259,9 @@ void CEncoder::InitVISABuilderOptions(TARGET_PLATFORM VISAPlatform, bool canAbor
42594259
if (IGC_IS_FLAG_ENABLED(ForceBCR)) {
42604260
SaveOption(vISA_forceBCR, true);
42614261
}
4262+
if (IGC_IS_FLAG_ENABLED(BumpGRFForForceBCR)) {
4263+
SaveOption(vISA_bumpGRFForForceBCR, true);
4264+
}
42624265
if (IGC_IS_FLAG_ENABLED(forceSamplerHeader)) {
42634266
SaveOption(vISA_forceSamplerHeader, true);
42644267
}

IGC/common/igc_flags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ DECLARE_IGC_REGKEY(bool, DisableGatherRSFusionSyncWA, false,
101101
"Disable WA for gather instruction when read suppression and EU fusion are enabled.", true)
102102
DECLARE_IGC_REGKEY(bool, EnableBCR, false, "Enable bank conflict reduction.", true)
103103
DECLARE_IGC_REGKEY(bool, ForceBCR, false, "Force bank conflict reduction, no matter spill or not.", true)
104+
DECLARE_IGC_REGKEY(bool, BumpGRFForForceBCR, false, "Bump up GRF mode for force BCR.", true)
104105
DECLARE_IGC_REGKEY(bool, EnableForceDebugSWSB, false,
105106
"Enable force debugging functionality for software scoreboard generation", true)
106107
DECLARE_IGC_REGKEY(DWORD, EnableSWSBInstStall, 0,

visa/G4_Kernel.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,6 +2246,13 @@ GRFMode::GRFMode(const TARGET_PLATFORM plat, unsigned regSize, Options *op)
22462246

22472247
// Select higher GRF
22482248
GRFModeUpValue = op->getuInt32Option(vISA_ForceGRFModeUp);
2249+
2250+
if (GRFModeUpValue == 0)
2251+
GRFModeUpValue =
2252+
(op->getOption(vISA_forceBCR) && op->getOption(vISA_bumpGRFForForceBCR))
2253+
? 1
2254+
: 0;
2255+
22492256
vISA_ASSERT(GRFModeUpValue >= 0 && GRFModeUpValue <= configs.size(),
22502257
"Invalid value for selecting a higher GRF mode");
22512258
}

visa/include/VISAOptionsDefs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ DEF_VISA_OPTION(vISA_AbortOnSpillThreshold, ET_INT32, "-abortOnSpill", UNUSED,
421421
0)
422422
DEF_VISA_OPTION(vISA_enableBCR, ET_BOOL, "-enableBCR", UNUSED, false)
423423
DEF_VISA_OPTION(vISA_forceBCR, ET_BOOL, "-forceBCR", UNUSED, false)
424+
DEF_VISA_OPTION(vISA_bumpGRFForForceBCR, ET_BOOL, "-bumpGRFForForceBCR", UNUSED, false)
424425
DEF_VISA_OPTION(vISA_twoSrcBundleBCR, ET_BOOL, "-twoSrcBundleBCR", UNUSED, false)
425426
DEF_VISA_OPTION(vISA_NewAugmentation, ET_BOOL_TRUE, "-newaugmentation",
426427
"USAGE: -newaugmentation "

0 commit comments

Comments
 (0)