Skip to content

Commit f59947c

Browse files
bcheng0127igcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 0d8e8ce
Bundle BCR for two source inst for OCL Add bundle conflict reduction for two source instructions for OCL.
1 parent 0829ac8 commit f59947c

File tree

6 files changed

+5
-75
lines changed

6 files changed

+5
-75
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4842,11 +4842,6 @@ namespace IGC
48424842
{
48434843
SaveOption(vISA_enableBCR, true);
48444844
}
4845-
if (context->type == ShaderType::OPENCL_SHADER &&
4846-
m_program->m_Platform->supportTwoSrcBundleConflictReduction())
4847-
{
4848-
SaveOption(vISA_twoSrcBCR, true);
4849-
}
48504845
if (context->type == ShaderType::OPENCL_SHADER &&
48514846
m_program->m_Platform->supportDpasInstruction())
48524847
{

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,6 @@ bool supportBfnInstruction() const
579579
return isProductChildOf(IGFX_XE_HP_SDV);
580580
}
581581

582-
bool supportTwoSrcBundleConflictReduction() const
583-
{
584-
return isProductChildOf(IGFX_ARROWLAKE);
585-
}
586-
587582
bool supportDpasInstruction() const
588583
{
589584
return isProductChildOf(IGFX_XE_HP_SDV) && m_platformInfo.eProductFamily != IGFX_METEORLAKE &&

visa/GraphColor.cpp

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -806,39 +806,6 @@ void BankConflictPass::setupBankConflictsforDPAS(G4_INST *inst) {
806806
return;
807807
}
808808

809-
810-
void BankConflictPass::setupBundleConflictsforTwoSrcsInst(G4_INST *inst) {
811-
vISA_ASSERT(inst->getNumSrc() == 2, "Only support two source operands instructions");
812-
813-
G4_Declare *dcls[2];
814-
G4_Declare *opndDcls[2];
815-
unsigned offset[2];
816-
817-
for (int i = 0; i < 2; i += 1) {
818-
dcls[i] = nullptr;
819-
opndDcls[i] = nullptr;
820-
821-
G4_Operand *src = inst->getSrc(i);
822-
if (!src || !src->isSrcRegRegion() || src->isAreg()) {
823-
// bank conflict not possible
824-
continue;
825-
}
826-
827-
dcls[i] = GetTopDclFromRegRegion(src);
828-
opndDcls[i] = src->getBase()->asRegVar()->getDeclare();
829-
offset[i] = (opndDcls[i]->getOffsetFromBase() + src->getLeftBound()) /
830-
gra.kernel.numEltPerGRF<Type_UB>();
831-
}
832-
833-
// Add potential bundle conflicts
834-
if (dcls[0] && dcls[1]) {
835-
gra.addBundleConflictDcl(dcls[0], dcls[1], offset[0] - offset[1]);
836-
gra.addBundleConflictDcl(dcls[1], dcls[0], offset[1] - offset[0]);
837-
}
838-
839-
return;
840-
}
841-
842809
void BankConflictPass::setupBankConflictsforMad(G4_INST *inst) {
843810
BankConflict srcBC[3];
844811
unsigned offset[3];
@@ -1055,10 +1022,10 @@ void BankConflictPass::setupBankConflictsForBBTGL(G4_BB *bb,
10551022
} else {
10561023
setupBankConflictsforMad(inst);
10571024
}
1058-
} else if ((gra.forceBCR || gra.twoSrcBundleBCR) && !forGlobal &&
1025+
} else if (gra.forceBCR && !forGlobal &&
10591026
inst->getNumSrc() == 2) {
10601027
threeSourceInstNum++;
1061-
setupBundleConflictsforTwoSrcsInst(inst);
1028+
setupBankConflictsforMad(inst);
10621029
}
10631030
}
10641031

@@ -10136,21 +10103,6 @@ bool GlobalRA::tryHybridRA() {
1013610103
copyMissingAlignment();
1013710104
BankConflictPass bc(*this, false);
1013810105

10139-
if (twoSrcBundleBCR) {
10140-
LivenessAnalysis liveAnalysis(*this, G4_GRF | G4_INPUT);
10141-
liveAnalysis.computeLiveness();
10142-
10143-
if (!liveAnalysis.getNumSelectedVar()) {
10144-
return false;
10145-
}
10146-
10147-
RPE rpe(*this, &liveAnalysis);
10148-
rpe.run();
10149-
if (rpe.getMaxRP() >= kernel.getNumRegTotal() - 24) {
10150-
// No two src bundle conflict reduction if high register pressure
10151-
twoSrcBundleBCR = false;
10152-
}
10153-
}
1015410106

1015510107
LocalRA lra(bc, *this);
1015610108
if (lra.localRA()) {

visa/GraphColor.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ class BankConflictPass {
7171

7272
void setupBankConflictsforTwoGRFs(G4_INST *inst);
7373
void setupBankConflictsforMad(G4_INST *inst);
74-
void setupBundleConflictsforTwoSrcsInst(G4_INST *inst);
7574
void setupBankConflictsForBB(G4_BB *bb, unsigned &threeSourceInstNum,
7675
unsigned &sendInstNum, unsigned numRegLRA,
7776
unsigned &internalConflict);
@@ -1488,7 +1487,6 @@ class GlobalRA {
14881487
bool useLocalRA = false;
14891488
bool favorBCR = false;
14901489
bool forceBCR = false;
1491-
bool twoSrcBundleBCR = false;
14921490
uint32_t nextSpillOffset = 0;
14931491
uint32_t scratchOffset = 0;
14941492

@@ -1785,12 +1783,6 @@ class GlobalRA {
17851783
allocVar(dcl).bundleConflicts.clear();
17861784
}
17871785

1788-
void clearAllBundleConflictDcl() {
1789-
for (auto dcl : kernel.Declares) {
1790-
clearBundleConflictDcl(dcl);
1791-
}
1792-
}
1793-
17941786
const std::vector<BundleConflict> &
17951787
getBundleConflicts(const G4_Declare *dcl) const {
17961788
return getVar(dcl).bundleConflicts;
@@ -1929,7 +1921,6 @@ class GlobalRA {
19291921
verifyAugmentation = std::make_unique<VerifyAugmentation>();
19301922
}
19311923
forceBCR = kernel.getOption(vISA_forceBCR);
1932-
twoSrcBundleBCR = kernel.getOption(vISA_twoSrcBCR);
19331924
// Set callWA condition.
19341925
// Call return ip and mask need wa only for non-entry functions. As call
19351926
// WA also needs a temp, we conservatively add WA for

visa/LocalRA.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ bool LocalRA::localRAPass(bool doRoundRobin, bool doSplitLLR) {
359359
gra.useHybridRAwithSpill && !doRoundRobin);
360360
}
361361

362-
if (needGlobalRA && (doRoundRobin || gra.twoSrcBundleBCR)) {
362+
if (needGlobalRA && doRoundRobin) {
363363
undoLocalRAAssignments(true);
364364
}
365365

@@ -392,7 +392,7 @@ bool LocalRA::localRA() {
392392
bool reduceBCInRR = false;
393393

394394
if (builder.getOption(vISA_LocalBankConflictReduction) &&
395-
(builder.hasBankCollision() || gra.twoSrcBundleBCR)) {
395+
builder.hasBankCollision()) {
396396
reduceBCInRR = bc.setupBankConflictsForKernel(
397397
doRoundRobin, reduceBCInTAandFF, numRegLRA, highInternalConflict);
398398
}
@@ -428,7 +428,7 @@ bool LocalRA::localRA() {
428428
}
429429

430430
if (!doRoundRobin) {
431-
if ((gra.forceBCR || gra.twoSrcBundleBCR) && doBCR) {
431+
if (gra.forceBCR && doBCR) {
432432
RA_TRACE(std::cout << "\t--first-fit BCR RA\n");
433433
needGlobalRA = localRAPass(false, doSplitLLR);
434434
}
@@ -442,8 +442,6 @@ bool LocalRA::localRA() {
442442
globalLRSize = 0;
443443
}
444444
specialAlign();
445-
gra.clearAllBundleConflictDcl();
446-
gra.twoSrcBundleBCR = false;
447445
needGlobalRA = localRAPass(false, doSplitLLR);
448446
}
449447
gra.favorBCR |= doBCR && kernel.useAutoGRFSelection() &&

visa/include/VISAOptionsDefs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ DEF_VISA_OPTION(vISA_AbortOnSpillThreshold, ET_INT32, "-abortOnSpill", UNUSED,
330330
0)
331331
DEF_VISA_OPTION(vISA_enableBCR, ET_BOOL, "-enableBCR", UNUSED, false)
332332
DEF_VISA_OPTION(vISA_forceBCR, ET_BOOL, "-forceBCR", UNUSED, false)
333-
DEF_VISA_OPTION(vISA_twoSrcBCR, ET_BOOL, "-twoSrcBCR", UNUSED, false)
334333
DEF_VISA_OPTION(vISA_NewAugmentation, ET_BOOL_TRUE, "-newaugmentation",
335334
"USAGE: -newaugmentation "
336335
"enable using augmentation with holes",

0 commit comments

Comments
 (0)