Skip to content

Commit 44e3044

Browse files
AnBodrovapszymich
authored andcommitted
Changes in code.
1 parent 2976cc3 commit 44e3044

File tree

3 files changed

+1
-63
lines changed

3 files changed

+1
-63
lines changed

visa/GraphColor.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9768,11 +9768,6 @@ int GlobalRA::coloringRegAlloc() {
97689768

97699769
LivenessAnalysis liveAnalysis(*this, G4_GRF | G4_INPUT);
97709770
liveAnalysis.computeLiveness();
9771-
#ifndef DLL_MODE
9772-
if (stopAfter("Global_RA_liveness")) {
9773-
return VISA_EARLY_EXIT;
9774-
}
9775-
#endif // DLL_MODE
97769771
if (builder.getOption(vISA_dumpLiveness)) {
97779772
liveAnalysis.dump();
97789773
}

visa/RegAlloc.cpp

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -370,55 +370,6 @@ void LivenessAnalysis::detectNeverDefinedVarRows() {
370370
}
371371
}
372372

373-
// #1 - (P166) sel (M1, 8) V2(0,0)<1> 0x1:d 0x0:d
374-
// #2 - (W) mov(M1, 8) V1(0,0)<1> 0x0:ud
375-
// #3 - (W) mov (M1, 1) V3 0x1:ud
376-
// #4 - add (M1, 8) V1(0,0)<1> V2(0,0)<1;1,0> V3(0,0)<0;1,0>
377-
//
378-
// In above 3d program, V1 is written once using WriteEnable and and once without
379-
// WriteEnable. A var must be treated as KILLED only for widest def. In this case,
380-
// widest def of V1 is one with WriteEnable set. Although def of V1 in inst# 4
381-
// writes all enabled channels, it may not be as wide as WriteEnable in inst#1.
382-
// Marking #4 as KILL allows RA to use same register for V1 and V3 which can be
383-
// incorrect if all but lowest channel are enabled. Because in this case lowest
384-
// channel data would be overwritten by V3 def.
385-
//
386-
// In this method, we gather all variables written with WriteEnable and refer to
387-
// this list when computing pseudo_kill. Note that WriteEnable takes effect only
388-
// in divergent context. In other words, for ESIMD target, all channels are enabled
389-
// at thread dispatch. Whereas for 3d, even entry BB is considered to be divergent.
390-
void LivenessAnalysis::collectNoMaskVars() {
391-
for (auto bb : gra.kernel.fg) {
392-
for (auto inst : *bb) {
393-
if (!inst->isWriteEnableInst())
394-
continue;
395-
396-
auto inDivergentContext = [&]() {
397-
// 3d is always in divergent context
398-
// ESIMD is divergent only in BBs that are explicitly divergent
399-
return fg.getKernel()->getInt32KernelAttr(Attributes::ATTR_Target) ==
400-
VISA_3D ||
401-
!bb->isAllLaneActive();
402-
};
403-
404-
G4_Operand *opnd = nullptr;
405-
if (livenessClass(G4_GRF))
406-
opnd = inst->getDst();
407-
else if (livenessClass(G4_FLAG))
408-
opnd = inst->getCondMod();
409-
410-
if (opnd && opnd->getBase() && opnd->getBase()->isRegAllocPartaker() &&
411-
inDivergentContext()) {
412-
defWriteEnable.insert(opnd->getTopDcl());
413-
}
414-
}
415-
}
416-
}
417-
418-
bool LivenessAnalysis::doesVarNeedNoMaskForKill(const G4_Declare* dcl) const {
419-
return defWriteEnable.count(dcl) == 0 ? false : true;
420-
}
421-
422373
//
423374
// compute liveness of reg vars
424375
// Each reg var indicates a region within the register file. As such, the case
@@ -498,7 +449,6 @@ void LivenessAnalysis::computeLiveness() {
498449
def_out[i].clear();
499450
}
500451

501-
collectNoMaskVars();
502452
if (livenessClass(G4_GRF))
503453
detectNeverDefinedVarRows();
504454

@@ -1161,9 +1111,6 @@ bool LivenessAnalysis::writeWholeRegion(const G4_BB *bb, const G4_INST *inst,
11611111
return false;
11621112
}
11631113

1164-
if (doesVarNeedNoMaskForKill(primaryDcl) && !inst->isWriteEnableInst())
1165-
return false;
1166-
11671114
return true;
11681115
}
11691116

@@ -1193,8 +1140,7 @@ void LivenessAnalysis::footprintDst(const G4_BB *bb, const G4_INST *i,
11931140
BitSet *dstfootprint) const {
11941141
if (dstfootprint && !(i->isPartialWrite()) &&
11951142
((bb->isAllLaneActive() || i->isWriteEnableInst() == true) ||
1196-
(gra.kernel.getInt32KernelAttr(Attributes::ATTR_Target) == VISA_3D &&
1197-
!doesVarNeedNoMaskForKill(opnd->getTopDcl())))) {
1143+
gra.kernel.getInt32KernelAttr(Attributes::ATTR_Target) == VISA_3D)) {
11981144
// Bitwise OR left-bound/right-bound with dst footprint to indicate
11991145
// bytes that are written in to
12001146
opnd->updateFootPrint(*dstfootprint, true, *fg.builder);

visa/RegAlloc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class LivenessAnalysis {
6161
0; // the selected reg file kind for performing liveness
6262
const PointsToAnalysis &pointsToAnalysis;
6363
std::unordered_map<G4_Declare *, BitSet> neverDefinedRows;
64-
std::unordered_set<const G4_Declare *> defWriteEnable;
6564

6665
void computeGenKillandPseudoKill(G4_BB *bb, SparseBitSet &def_out,
6766
SparseBitSet &use_in, SparseBitSet &use_gen,
@@ -85,8 +84,6 @@ class LivenessAnalysis {
8584
static void footprintSrc(const G4_INST *i, G4_Operand *opnd,
8685
BitSet *srcfootprint);
8786
void detectNeverDefinedVarRows();
88-
void collectNoMaskVars();
89-
bool doesVarNeedNoMaskForKill(const G4_Declare* dcl) const;
9087

9188
public:
9289
GlobalRA &gra;

0 commit comments

Comments
 (0)