Skip to content

Commit

Permalink
Changes in code.
Browse files Browse the repository at this point in the history
  • Loading branch information
bcheng0127 authored and igcbot committed Sep 17, 2022
1 parent 832cfe5 commit 1b59692
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
28 changes: 1 addition & 27 deletions visa/LocalRA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,31 +545,6 @@ void LocalRA::resetMasks()
}
}

unsigned int LocalRA::getLargestInputGRF()
{
unsigned int largestInput = 0;

for (auto dcl : kernel.Declares)
{
//Find out the largest GRF regsiter occupied by input variable
//In case overlap with reserved registers
if ((dcl->getRegFile() == G4_INPUT || dcl->isLiveIn()) &&
dcl->isOutput() == false &&
!(dcl->getRegVar()->isAreg()) &&
dcl->getRegVar()->isPhyRegAssigned())
{
G4_RegVar* var = dcl->getRegVar();
unsigned int regNum = var->getPhyReg()->asGreg()->getRegNum();
unsigned int regOff = var->getPhyRegOff();
unsigned int largestGRF = (regNum * kernel.numEltPerGRF<Type_UW>() +
(regOff * dcl->getElemSize()) / G4_WSIZE + dcl->getWordSize() - 1) / (kernel.numEltPerGRF<Type_UW>());
largestInput = largestInput < largestGRF ? largestGRF : largestInput;
}
}

return largestInput;
}

void LocalRA::blockOutputPhyRegs()
{
for (auto dcl : kernel.Declares)
Expand Down Expand Up @@ -794,8 +769,7 @@ bool LocalRA::assignUniqueRegisters(bool twoBanksRA, bool twoDirectionsAssign, b
std::unordered_set<unsigned int> emptyForbidden;
auto varSplitPass = gra.getVarSplitPass();

unsigned int largestInput = getLargestInputGRF();
if (((nextEOTGRF < (kernel.getNumRegTotal() - 16)) || (nextEOTGRF < largestInput)) && builder.hasEOTGRFBinding() )
if (nextEOTGRF < 112 && builder.hasEOTGRFBinding())
{
// we can't guarantee unique assignments for all the EOT sources
// punt to global RA
Expand Down
1 change: 0 additions & 1 deletion visa/LocalRA.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ namespace vISA
void trivialAssignRA(bool& needGlobalRA, bool threeSourceCandidate);
bool localRAPass(bool doRoundRobin, bool doSplitLLR);
void resetMasks();
unsigned int getLargestInputGRF();
void blockOutputPhyRegs();
void removeUnrequiredLifetimeOps();
bool assignUniqueRegisters(bool twoBanksRA, bool twoDirectionsAssign, bool hybridWithSpill);
Expand Down

0 comments on commit 1b59692

Please sign in to comment.