Skip to content

Commit

Permalink
Sanity check for size of indirectly accessed G4_Declares in
Browse files Browse the repository at this point in the history
VISA verifier

Indirectly accessed variable size cannot equal or exceed total GRF
size as allocation is guaranteed to fail in that case.
  • Loading branch information
pratikashar authored and igcbot committed Jul 25, 2023
1 parent e0e7ff6 commit 490df0b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions visa/IsaVerification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,16 @@ void vISAVerifier::verifyVariableDecl(unsigned declID) {
break; // Prevent gcc warning
}

REPORT_HEADER(options,
!var->dcl->getAddressed() ||
var->getSize() < irBuilder->kernel.getNumRegTotal() *
irBuilder->kernel.getGRFSize(),
"V%d (size = %d bytes) is indirectly addressed and spans "
"complete GRF file of %d GRFs. This cannot be allocated by "
"RA.",
declID + numPreDefinedVars, var->getSize(),
irBuilder->kernel.getNumRegTotal() *
irBuilder->kernel.getGRFSize());
REPORT_HEADER(options,
var->num_elements != 0 &&
var->num_elements <= irBuilder->getMaxVariableSize(),
Expand Down

0 comments on commit 490df0b

Please sign in to comment.