Commit ee8d0508 authored by pratik ashar's avatar pratik ashar

Internal feature

Change-Id: I5167e91b0b58ed4b37583e27a83606c11ce4ebc6
parent f61ab6d7
......@@ -5272,32 +5272,25 @@ bool GlobalRA::areAllDefsNoMask(G4_Declare* dcl)
{
bool retval = true;
auto maskUsed = getMask(dcl);
if (maskUsed != NULL)
if (maskUsed != NULL &&
getAugmentationMask(dcl) != AugmentationMasks::NonDefault)
{
if (maskUsed == (unsigned char*)allDefsNoMask)
auto byteSize = dcl->getByteSize();
for (unsigned int i = 0; i < byteSize; i++)
{
retval = true;
}
else if (maskUsed == (unsigned char*)allDefsNotNoMask)
{
retval = false;
}
else
{
auto byteSize = dcl->getByteSize();
for (unsigned int i = 0; i < byteSize; i++)
if (maskUsed[i] != NOMASK_BYTE)
{
if (maskUsed[i] != NOMASK_BYTE)
{
retval = false;
break;
}
retval = false;
break;
}
}
}
else
{
retval = false;
if (getAugmentationMask(dcl) == AugmentationMasks::NonDefault)
retval = true;
else
retval = false;
}
return retval;
}
......
......@@ -147,9 +147,6 @@ void resetRightBound(vISA::G4_Operand* opnd);
#pragma warning (disable: 4996)
#endif
extern const char* allDefsNoMask;
extern const char* allDefsNotNoMask;
namespace vISA
{
// forward declaration
......
......@@ -3263,9 +3263,11 @@ void Augmentation::markNonDefaultDstRgn(G4_INST* inst, G4_Operand* opnd)
// has some special checks.
if (inst->isSend())
{
if (gra.getAugmentationMask(dcl) == AugmentationMasks::NonDefault)
{
return;
}
updateDstMask(inst, false);
G4_Declare* dcl = dst->getBase()->asRegVar()->getDeclare();
dcl = dcl->getRootDeclare();
if (isDefaultMaskDcl(dcl, kernel.getSimdSize(), AugmentationMasks::Default16Bit))
{
gra.setAugmentationMask(dcl, AugmentationMasks::Default16Bit);
......@@ -9114,6 +9116,14 @@ bool GlobalRA::hybridRA(bool doBankConflictReduction, bool highInternalConflict,
return true;
}
bool canDoLRA(G4_Kernel& kernel)
{
bool ret = true;
return ret;
}
//
// graph coloring entry point. returns nonzero if RA fails
//
......@@ -9170,7 +9180,7 @@ int GlobalRA::coloringRegAlloc()
bool doBankConflictReduction = false;
bool highInternalConflict = false;
if (builder.getOption(vISA_LocalRA) && !isReRAPass())
if (builder.getOption(vISA_LocalRA) && !isReRAPass() && canDoLRA(kernel))
{
startTimer(TIMER_LOCAL_RA);
bool doLocalRR = builder.getOption(vISA_LocalRARoundRobin);
......@@ -9537,6 +9547,7 @@ int GlobalRA::coloringRegAlloc()
verifyAugmentation->verify();
}
break; // done
}
}
......
......@@ -51,9 +51,6 @@ extern unsigned int getStackCallRegSize(bool reserveStackCallRegs);
extern void getForbiddenGRFs(vector<unsigned int>& regNum, const Options *opt, unsigned stackCallRegSize, unsigned reserveSpillSize, unsigned reservedRegNum);
extern void getCallerSaveGRF(vector<unsigned int>& regNum, G4_Kernel* kernel);
const char* allDefsNoMask = "ALL DEFS NO MASK";
const char* allDefsNotNoMask = "ALL DEFS NOT NO MASK";
LocalRA::LocalRA(G4_Kernel& k, bool& h, BankConflictPass& b, GlobalRA& g) :
kernel(k), builder(*k.fg.builder), highInternalConflict(h),
mem(k.fg.builder->mem), bc(b), gra(g)
......@@ -1181,14 +1178,10 @@ void LocalRA::markReferencesInOpnd(G4_Operand* opnd, bool isEOT, INST_LIST_ITER
{
if (opnd->getInst()->isWriteEnableInst() == false)
{
gra.setMask(topdcl, (unsigned char*)allDefsNotNoMask);
}
else
{
if (gra.getMask(topdcl) == NULL)
{
gra.setMask(topdcl, (unsigned char*)allDefsNoMask);
}
gra.setAugmentationMask(topdcl, AugmentationMasks::NonDefault);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment