Skip to content

Commit 9dc92d3

Browse files
bcheng0127igcbot
authored andcommitted
Keep DPAS macro block if there is
Provide option to keep existing dpas macro in the post RA instruction scheduling
1 parent 4c1ed2b commit 9dc92d3

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

visa/LocalScheduler/LocalScheduler_G4IR.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,8 +1183,8 @@ bool DDD::hasReadSuppression(G4_INST *prevInst, G4_INST *nextInst,
11831183
}
11841184

11851185

1186-
bool DDD::hasSameSourceOneDPAS(G4_INST *curInst, G4_INST *nextInst,
1187-
BitSet &liveDst, BitSet &liveSrc) const {
1186+
bool DDD::canInSameDPASMacro(G4_INST *curInst, G4_INST *nextInst,
1187+
BitSet &liveDst, BitSet &liveSrc, bool sameSrcOneOnly) const {
11881188
G4_InstDpas *curDpasInst = curInst->asDpasInst();
11891189
G4_InstDpas *nextDpasInst = nextInst->asDpasInst();
11901190
// Actually cur and next are in reverse order, but we should be able to check
@@ -1227,7 +1227,7 @@ bool DDD::hasSameSourceOneDPAS(G4_INST *curInst, G4_INST *nextInst,
12271227
}
12281228

12291229
// Not same src1 register
1230-
if (i == 1 && c_srcLB != n_srcLB) {
1230+
if (sameSrcOneOnly && i == 1 && c_srcLB != n_srcLB) {
12311231
return false;
12321232
}
12331233
}
@@ -1375,7 +1375,14 @@ DDD::DDD(G4_BB *bb, const LatencyTable &lt, G4_Kernel *k, PointsToAnalysis &p)
13751375
// dpas macro
13761376
while (nextInst->isDpas()) {
13771377
bool canGroup = false;
1378-
canGroup = hasSameSourceOneDPAS(curInst, nextInst, liveDst, liveSrc);
1378+
if (getOptions()->getOption(vISA_KeepDPASMacroInSchedule)) {
1379+
canGroup = canInSameDPASMacro(curInst, nextInst, liveDst,
1380+
liveSrc, false);
1381+
} else {
1382+
canGroup =
1383+
canInSameDPASMacro(curInst, nextInst, liveDst,
1384+
liveSrc, true);
1385+
}
13791386
if (!canGroup)
13801387
break;
13811388

visa/LocalScheduler/LocalScheduler_G4IR.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ class DDD {
334334
bool multipSuppression) const;
335335

336336
private:
337-
bool hasSameSourceOneDPAS(G4_INST *curInst, G4_INST *nextInst,
338-
BitSet &liveDst, BitSet &liveSrc) const;
337+
bool canInSameDPASMacro(G4_INST *curInst, G4_INST *nextInst,
338+
BitSet &liveDst, BitSet &liveSrc,
339+
bool sameSrcOneOnly) const;
339340

340341
public:
341342
DDD(G4_BB *bb, const LatencyTable &lt, G4_Kernel *k, PointsToAnalysis &p);

visa/include/VISAOptionsDefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ DEF_VISA_OPTION(vISA_EnableDPASTokenReduction, ET_BOOL, "-DPASTokenReduction",
518518
DEF_VISA_OPTION(vISA_EnableDPASBundleConflictReduction, ET_BOOL,
519519
"-DPASBundleReduction", UNUSED, true)
520520
DEF_VISA_OPTION(vISA_NoDPASMacro, ET_BOOL, "-noDPASMacro", UNUSED, false)
521-
DEF_VISA_OPTION(vISA_forceDPASMacro, ET_BOOL, "-forceDPASMacro", "DEPRECATED, is a nop", false)
521+
DEF_VISA_OPTION(vISA_KeepDPASMacroInSchedule, ET_BOOL, "-keepDPASMacroInSchedule", UNUSED, false)
522522
DEF_VISA_OPTION(vISA_TrueDepOnly, ET_BOOL, "-trueDepOnly", UNUSED, false)
523523
DEF_VISA_OPTION(vISA_SplitMov64, ET_INT32, "-SplitMov64",
524524
"USAGE: -SplitMov64 (0|1|2)\n", 0)

0 commit comments

Comments
 (0)