Skip to content

Commit 562c0d5

Browse files
bcheng0127igcbot
authored andcommitted
Disable bundle conflict reduction if there is spill
1 parent 22fdd04 commit 562c0d5

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

visa/GraphColor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,8 @@ void BankConflictPass::setupBankConflictsforMad(G4_INST* inst)
850850
}
851851

852852
LocalLiveRange* lr = gra.getLocalLR(dcls[i]);
853-
if (k == 0 && !lr->isLiveRangeLocal())
853+
if (!lr ||
854+
(k == 0 && !lr->isLiveRangeLocal()))
854855
{
855856
continue;
856857
}
@@ -6728,7 +6729,9 @@ bool GraphColor::regAlloc(
67286729
if (!success && doBankConflictReduction)
67296730
{
67306731
resetTemporaryRegisterAssignments();
6732+
kernel.getOptions()->setOption(vISA_enableBundleCR, false);
67316733
assignColors(FIRST_FIT, false, false);
6734+
kernel.getOptions()->setOption(vISA_enableBundleCR, true);
67326735
}
67336736
}
67346737
}

visa/PhyRegUsage.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ unsigned short PhyRegUsage::getOccupiedBundle(const G4_Declare* dcl) const
218218
{
219219
unsigned short occupiedBundles = 0;
220220
unsigned bundleNum = 0;
221-
221+
if (!builder.getOption(vISA_enableBundleCR))
222+
{
223+
return occupiedBundles;
224+
}
222225

223226
for (const BundleConflict& conflict : gra.getBundleConflicts(dcl))
224227
{

visa/include/VISAOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ DEF_VISA_OPTION(vISA_FastSpill, ET_BOOL, "-fasterRA", UNUSED, false)
135135
DEF_VISA_OPTION(vISA_AbortOnSpillThreshold, ET_INT32, NULLSTR, UNUSED, 0)
136136
DEF_VISA_OPTION(vISA_enableBCR, ET_BOOL, "-enableBCR", UNUSED, false)
137137
DEF_VISA_OPTION(vISA_forceBCR, ET_BOOL, "-forceBCR", UNUSED, false)
138+
DEF_VISA_OPTION(vISA_enableBundleCR, ET_BOOL, "-enableBundleCR", UNUSED, true)
138139
DEF_VISA_OPTION(vISA_IntrinsicSplit, ET_BOOL, "-doSplit", UNUSED, false)
139140
DEF_VISA_OPTION(vISA_LraFFWindowSize, ET_INT32, "-lraFFWindowSize", UNUSED, 12)
140141
DEF_VISA_OPTION(vISA_SplitGRFAlignedScalar, ET_BOOL, "-splitGRFalignedscalar", UNUSED, false)

0 commit comments

Comments
 (0)