Skip to content

Commit 05f8284

Browse files
bcheng0127igcbot
authored andcommitted
Add bundle conflict for none-dpas three source instructions
Add bundle conflict for none-dpas three source instructions
1 parent 8041eec commit 05f8284

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

visa/GraphColor.cpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,17 @@ void BankConflictPass::setupBankConflictsforMad(G4_INST* inst)
960960
}
961961
}
962962

963+
if (dcls[0] && dcls[1])
964+
{
965+
gra.addBundleConflictDcl(dcls[0], dcls[1], offset[0] - offset[1]);
966+
gra.addBundleConflictDcl(dcls[1], dcls[0], offset[1] - offset[0]);
967+
}
968+
if (dcls[1] && dcls[2])
969+
{
970+
gra.addBundleConflictDcl(dcls[2], dcls[1], offset[2] - offset[1]);
971+
gra.addBundleConflictDcl(dcls[1], dcls[2], offset[1] - offset[2]);
972+
}
973+
963974
for (int k = 0; k < 2; k++)
964975
{
965976
for (int i = 2; i != -1; i--)
@@ -7057,9 +7068,14 @@ bool GraphColor::regAlloc(
70577068
if (!success && doBankConflictReduction)
70587069
{
70597070
resetTemporaryRegisterAssignments();
7060-
kernel.getOptions()->setOption(vISA_enableBundleCR, false);
7061-
assignColors(FIRST_FIT, false, false);
7062-
kernel.getOptions()->setOption(vISA_enableBundleCR, true);
7071+
success = assignColors(FIRST_FIT, false, false);
7072+
if (!success)
7073+
{
7074+
resetTemporaryRegisterAssignments();
7075+
kernel.getOptions()->setOption(vISA_enableBundleCR, false);
7076+
assignColors(FIRST_FIT, false, false);
7077+
kernel.getOptions()->setOption(vISA_enableBundleCR, true);
7078+
}
70637079
}
70647080
}
70657081
}

visa/LocalRA.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,9 @@ bool LocalRA::localRA()
514514
globalLRSize = 0;
515515
}
516516
evenAlign();
517+
kernel.getOptions()->setOption(vISA_enableBundleCR, false);
517518
needGlobalRA = localRAPass(false, doSplitLLR);
519+
kernel.getOptions()->setOption(vISA_enableBundleCR, true);
518520
}
519521
}
520522

@@ -700,6 +702,11 @@ inline static unsigned short getOccupiedBundle(IR_Builder& builder, GlobalRA& gr
700702
unsigned int evenBankNum = 0;
701703
unsigned int oddBankNum = 0;
702704

705+
if (!(builder.getOption(vISA_enableBundleCR) && builder.getOption(vISA_forceBCR)))
706+
{
707+
return occupiedBundles;
708+
}
709+
703710
if (!builder.hasDPAS() || !builder.getOption(vISA_EnableDPASBundleConflictReduction))
704711
{
705712
return 0;

0 commit comments

Comments
 (0)