Skip to content

Commit ee8d050

Browse files
committed
Internal feature
Change-Id: I5167e91b0b58ed4b37583e27a83606c11ce4ebc6
1 parent f61ab6d commit ee8d050

File tree

4 files changed

+26
-32
lines changed

4 files changed

+26
-32
lines changed

visa/Gen4_IR.cpp

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5272,32 +5272,25 @@ bool GlobalRA::areAllDefsNoMask(G4_Declare* dcl)
52725272
{
52735273
bool retval = true;
52745274
auto maskUsed = getMask(dcl);
5275-
if (maskUsed != NULL)
5275+
if (maskUsed != NULL &&
5276+
getAugmentationMask(dcl) != AugmentationMasks::NonDefault)
52765277
{
5277-
if (maskUsed == (unsigned char*)allDefsNoMask)
5278+
auto byteSize = dcl->getByteSize();
5279+
for (unsigned int i = 0; i < byteSize; i++)
52785280
{
5279-
retval = true;
5280-
}
5281-
else if (maskUsed == (unsigned char*)allDefsNotNoMask)
5282-
{
5283-
retval = false;
5284-
}
5285-
else
5286-
{
5287-
auto byteSize = dcl->getByteSize();
5288-
for (unsigned int i = 0; i < byteSize; i++)
5281+
if (maskUsed[i] != NOMASK_BYTE)
52895282
{
5290-
if (maskUsed[i] != NOMASK_BYTE)
5291-
{
5292-
retval = false;
5293-
break;
5294-
}
5283+
retval = false;
5284+
break;
52955285
}
52965286
}
52975287
}
52985288
else
52995289
{
5300-
retval = false;
5290+
if (getAugmentationMask(dcl) == AugmentationMasks::NonDefault)
5291+
retval = true;
5292+
else
5293+
retval = false;
53015294
}
53025295
return retval;
53035296
}

visa/Gen4_IR.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ void resetRightBound(vISA::G4_Operand* opnd);
147147
#pragma warning (disable: 4996)
148148
#endif
149149

150-
extern const char* allDefsNoMask;
151-
extern const char* allDefsNotNoMask;
152-
153150
namespace vISA
154151
{
155152
// forward declaration

visa/GraphColor.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,9 +3263,11 @@ void Augmentation::markNonDefaultDstRgn(G4_INST* inst, G4_Operand* opnd)
32633263
// has some special checks.
32643264
if (inst->isSend())
32653265
{
3266+
if (gra.getAugmentationMask(dcl) == AugmentationMasks::NonDefault)
3267+
{
3268+
return;
3269+
}
32663270
updateDstMask(inst, false);
3267-
G4_Declare* dcl = dst->getBase()->asRegVar()->getDeclare();
3268-
dcl = dcl->getRootDeclare();
32693271
if (isDefaultMaskDcl(dcl, kernel.getSimdSize(), AugmentationMasks::Default16Bit))
32703272
{
32713273
gra.setAugmentationMask(dcl, AugmentationMasks::Default16Bit);
@@ -9114,6 +9116,14 @@ bool GlobalRA::hybridRA(bool doBankConflictReduction, bool highInternalConflict,
91149116
return true;
91159117
}
91169118

9119+
bool canDoLRA(G4_Kernel& kernel)
9120+
{
9121+
bool ret = true;
9122+
9123+
9124+
return ret;
9125+
}
9126+
91179127
//
91189128
// graph coloring entry point. returns nonzero if RA fails
91199129
//
@@ -9170,7 +9180,7 @@ int GlobalRA::coloringRegAlloc()
91709180
bool doBankConflictReduction = false;
91719181
bool highInternalConflict = false;
91729182

9173-
if (builder.getOption(vISA_LocalRA) && !isReRAPass())
9183+
if (builder.getOption(vISA_LocalRA) && !isReRAPass() && canDoLRA(kernel))
91749184
{
91759185
startTimer(TIMER_LOCAL_RA);
91769186
bool doLocalRR = builder.getOption(vISA_LocalRARoundRobin);
@@ -9537,6 +9547,7 @@ int GlobalRA::coloringRegAlloc()
95379547
verifyAugmentation->verify();
95389548
}
95399549

9550+
95409551
break; // done
95419552
}
95429553
}

visa/LocalRA.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ extern unsigned int getStackCallRegSize(bool reserveStackCallRegs);
5151
extern void getForbiddenGRFs(vector<unsigned int>& regNum, const Options *opt, unsigned stackCallRegSize, unsigned reserveSpillSize, unsigned reservedRegNum);
5252
extern void getCallerSaveGRF(vector<unsigned int>& regNum, G4_Kernel* kernel);
5353

54-
const char* allDefsNoMask = "ALL DEFS NO MASK";
55-
const char* allDefsNotNoMask = "ALL DEFS NOT NO MASK";
56-
5754
LocalRA::LocalRA(G4_Kernel& k, bool& h, BankConflictPass& b, GlobalRA& g) :
5855
kernel(k), builder(*k.fg.builder), highInternalConflict(h),
5956
mem(k.fg.builder->mem), bc(b), gra(g)
@@ -1181,14 +1178,10 @@ void LocalRA::markReferencesInOpnd(G4_Operand* opnd, bool isEOT, INST_LIST_ITER
11811178
{
11821179
if (opnd->getInst()->isWriteEnableInst() == false)
11831180
{
1184-
gra.setMask(topdcl, (unsigned char*)allDefsNotNoMask);
11851181
}
11861182
else
11871183
{
1188-
if (gra.getMask(topdcl) == NULL)
1189-
{
1190-
gra.setMask(topdcl, (unsigned char*)allDefsNoMask);
1191-
}
1184+
gra.setAugmentationMask(topdcl, AugmentationMasks::NonDefault);
11921185
}
11931186
}
11941187
}

0 commit comments

Comments
 (0)