@@ -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);
@@ -10112,16 +10113,6 @@ bool GlobalRA::tryHybridRA() {
10112
10113
return true ;
10113
10114
}
10114
10115
10115
- // Skip hybridRA if BCR is needed
10116
- if (favorBCR) {
10117
- lra.undoLocalRAAssignments (true );
10118
- // Restore alignment in case LRA modified it
10119
- copyAlignment ();
10120
- // reset favorBCR
10121
- favorBCR = forceBCR;
10122
- return false ;
10123
- }
10124
-
10125
10116
if (useHybridRAwithSpill) {
10126
10117
insertPhyRegDecls ();
10127
10118
} else {
@@ -10442,14 +10433,14 @@ std::pair<bool, bool> GlobalRA::bankConflict() {
10442
10433
bool doBankConflictReduction = false , highInternalConflict = false ;
10443
10434
if (builder.getOption (vISA_LocalBankConflictReduction) &&
10444
10435
builder.hasBankCollision ()) {
10445
- bool reduceBC = false ;
10446
- bool threeSouceBCR = false ;
10436
+ bool reduceBCInRR = false ;
10437
+ bool reduceBCInTAandFF = false ;
10447
10438
BankConflictPass bc (*this , true );
10448
10439
10449
- reduceBC = bc.setupBankConflictsForKernel (
10450
- true , threeSouceBCR , SECOND_HALF_BANK_START_GRF * 2 ,
10440
+ reduceBCInRR = bc.setupBankConflictsForKernel (
10441
+ true , reduceBCInTAandFF , SECOND_HALF_BANK_START_GRF * 2 ,
10451
10442
highInternalConflict);
10452
- doBankConflictReduction = reduceBC && threeSouceBCR ;
10443
+ doBankConflictReduction = reduceBCInRR && reduceBCInTAandFF ;
10453
10444
}
10454
10445
return std::make_pair (doBankConflictReduction, highInternalConflict);
10455
10446
}
@@ -10780,8 +10771,11 @@ GlobalRA::insertSpillCode(bool enableSpillSpaceCompression,
10780
10771
10781
10772
bool GlobalRA::rerunGRAIter (bool rerunGRA)
10782
10773
{
10783
- if (getIterNo () == 0 && (rerunGRA || forceBCR)) {
10784
- forceBCR = false ;
10774
+ if (getIterNo () == 0 && (rerunGRA || kernel.getOption (vISA_forceBCR))) {
10775
+ if (kernel.getOption (vISA_forceBCR)) {
10776
+ // FIXME: We shouldn't modify options. Use local bool flag instead.
10777
+ kernel.getOptions ()->setOption (vISA_forceBCR, false );
10778
+ }
10785
10779
return true ;
10786
10780
}
10787
10781
return false ;
@@ -10999,7 +10993,6 @@ int GlobalRA::coloringRegAlloc() {
10999
10993
if (!fastCompile) {
11000
10994
rpe.run ();
11001
10995
writeVerboseRPEStats (rpe);
11002
- favorBCR |= doBankConflictReduction && (rpe.getMaxRP () < kernel.getNumRegTotal () - 16 );
11003
10996
}
11004
10997
GraphColor coloring (liveAnalysis, false , forceSpill);
11005
10998
0 commit comments