@@ -1022,7 +1022,7 @@ void BankConflictPass::setupBankConflictsForBBTGL(G4_BB *bb,
1022
1022
} else {
1023
1023
setupBankConflictsforMad(inst);
1024
1024
}
1025
- } else if (gra.forceBCR && !forGlobal &&
1025
+ } else if (gra.kernel.getOption(vISA_forceBCR) && !forGlobal &&
1026
1026
inst->getNumSrc() == 2) {
1027
1027
threeSourceInstNum++;
1028
1028
setupBankConflictsforMad(inst);
@@ -3499,7 +3499,7 @@ bool Augmentation::markNonDefaultMaskDef() {
3499
3499
nonDefaultMaskDefFound = true;
3500
3500
}
3501
3501
3502
- if (gra.favorBCR &&
3502
+ if (kernel.getOption(vISA_forceBCR) &&
3503
3503
gra.getBankConflict(dcl) != BANK_CONFLICT_NONE) {
3504
3504
gra.setAugmentationMask(dcl, AugmentationMasks::NonDefault);
3505
3505
nonDefaultMaskDefFound = true;
@@ -6660,6 +6660,7 @@ bool GraphColor::assignColors(ColorHeuristic colorHeuristicGRF,
6660
6660
6661
6661
bool failed_alloc = false;
6662
6662
G4_Declare *dcl = lrVar->getDeclare();
6663
+
6663
6664
if (!(noIndirForceSpills && liveAnalysis.isAddressSensitive(lr_id)) &&
6664
6665
forceSpill &&
6665
6666
(dcl->getRegFile() == G4_GRF || dcl->getRegFile() == G4_FLAG) &&
@@ -6722,7 +6723,7 @@ bool GraphColor::assignColors(ColorHeuristic colorHeuristicGRF,
6722
6723
// pass) then abort on spill
6723
6724
//
6724
6725
if ((heuristic == ROUND_ROBIN ||
6725
- (doBankConflict && !gra.forceBCR )) &&
6726
+ (doBankConflict && !kernel.getOption(vISA_forceBCR) )) &&
6726
6727
(lr->getRegKind() == G4_GRF || lr->getRegKind() == G4_FLAG)) {
6727
6728
return false;
6728
6729
} else if (kernel.fg.isPseudoDcl(dcl)) {
@@ -7344,7 +7345,7 @@ bool GraphColor::regAlloc(bool doBankConflictReduction,
7344
7345
return false;
7345
7346
}
7346
7347
7347
- if (!gra.forceBCR ) {
7348
+ if (!kernel.getOption(vISA_forceBCR) ) {
7348
7349
if (!success && doBankConflictReduction) {
7349
7350
resetTemporaryRegisterAssignments();
7350
7351
assignColors(FIRST_FIT);
@@ -10110,14 +10111,6 @@ bool GlobalRA::tryHybridRA() {
10110
10111
return true;
10111
10112
}
10112
10113
10113
- //Skip hybridRA if BCR is needed
10114
- if (favorBCR) {
10115
- lra.undoLocalRAAssignments(true);
10116
- //reset favorBCR
10117
- favorBCR = forceBCR;
10118
- return false;
10119
- }
10120
-
10121
10114
if (useHybridRAwithSpill) {
10122
10115
insertPhyRegDecls();
10123
10116
} else {
@@ -10438,14 +10431,14 @@ std::pair<bool, bool> GlobalRA::bankConflict() {
10438
10431
bool doBankConflictReduction = false, highInternalConflict = false;
10439
10432
if (builder.getOption(vISA_LocalBankConflictReduction) &&
10440
10433
builder.hasBankCollision()) {
10441
- bool reduceBC = false;
10442
- bool threeSouceBCR = false;
10434
+ bool reduceBCInRR = false;
10435
+ bool reduceBCInTAandFF = false;
10443
10436
BankConflictPass bc(*this, true);
10444
10437
10445
- reduceBC = bc.setupBankConflictsForKernel(
10446
- true, threeSouceBCR , SECOND_HALF_BANK_START_GRF * 2,
10438
+ reduceBCInRR = bc.setupBankConflictsForKernel(
10439
+ true, reduceBCInTAandFF , SECOND_HALF_BANK_START_GRF * 2,
10447
10440
highInternalConflict);
10448
- doBankConflictReduction = reduceBC && threeSouceBCR ;
10441
+ doBankConflictReduction = reduceBCInRR && reduceBCInTAandFF ;
10449
10442
}
10450
10443
return std::make_pair(doBankConflictReduction, highInternalConflict);
10451
10444
}
@@ -10776,8 +10769,11 @@ GlobalRA::insertSpillCode(bool enableSpillSpaceCompression,
10776
10769
10777
10770
bool GlobalRA::rerunGRAIter(bool rerunGRA)
10778
10771
{
10779
- if (getIterNo() == 0 && (rerunGRA || forceBCR)) {
10780
- forceBCR = false;
10772
+ if (getIterNo() == 0 && (rerunGRA || kernel.getOption(vISA_forceBCR))) {
10773
+ if (kernel.getOption(vISA_forceBCR)) {
10774
+ // FIXME: We shouldn't modify options. Use local bool flag instead.
10775
+ kernel.getOptions()->setOption(vISA_forceBCR, false);
10776
+ }
10781
10777
return true;
10782
10778
}
10783
10779
return false;
@@ -10995,7 +10991,6 @@ int GlobalRA::coloringRegAlloc() {
10995
10991
if (!fastCompile) {
10996
10992
rpe.run();
10997
10993
writeVerboseRPEStats(rpe);
10998
- favorBCR |= doBankConflictReduction && (rpe.getMaxRP() < kernel.getNumRegTotal() - 16);
10999
10994
}
11000
10995
GraphColor coloring(liveAnalysis, false, forceSpill);
11001
10996
0 commit comments