Skip to content

Commit 50b9cb8

Browse files
bcheng0127sys_zuul
authored andcommitted
Add assert for the case where variable size is larger than GRF file size.
Change-Id: I174692b6f48129bdaf2c73077b7d0059dcb4825e
1 parent 93463de commit 50b9cb8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

visa/RegAlloc.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,22 @@ void PointsToAnalysis::doPointsToAnalysis(FlowGraph& fg)
385385
}
386386
}
387387

388+
#ifndef NDEBUG
389+
for (unsigned i = 0; i < numAddrs; i++)
390+
{
391+
REGVAR_VECTOR& vec = pointsToSets[addrPointsToSetIndex[i]];
392+
unsigned indirectVarSize = 0;
393+
for (REGVAR_VECTOR::iterator it = vec.begin();
394+
it != vec.end();
395+
it++)
396+
{
397+
G4_RegVar* cur = (*it);
398+
indirectVarSize += cur->getDeclare()->getByteSize();
399+
}
400+
assert((indirectVarSize < (unsigned)getGRFSize()* fg.getKernel()->getNumRegTotal()) && "indirected variables' size is larger than GRF file size");
401+
}
402+
#endif
403+
388404
#ifdef DEBUG_VERBOSE_ON
389405
for (unsigned int i = 0; i < numBBs; i++)
390406
{

0 commit comments

Comments
 (0)