Skip to content

Commit

Permalink
[IGC vISA] Fix the write-combine atomic block issue which breaks the…
Browse files Browse the repository at this point in the history
… rule that "Source GRF register are different and do not overlap with destination GRF register"

Fix the write-combine atomic block issue which breaks the rule that "Source GRF register are different and do not overlap with destination GRF register"
  • Loading branch information
fangliu2020 authored and igcbot committed Oct 10, 2023
1 parent 5e5a31e commit b5f5458
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions visa/LocalScheduler/LocalScheduler_G4IR.h
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,9 @@ class windowWriteCombine {
}

auto dst = inst->getDst();
// 1, dst cannot be null and cannot cross GRF boundary
if (!dst || dst->asDstRegRegion()->isCrossGRFDst(inst->getBuilder())) {
// 1, dst cannot cross GRF boundary
if (!dst->isGreg() ||
dst->asDstRegRegion()->isCrossGRFDst(inst->getBuilder())) {
return false;
}

Expand Down Expand Up @@ -739,6 +740,15 @@ class windowWriteCombine {
if (inst->getCondMod())
return false;

// 9, Source GRF register are different and do not overlap with destination
// GRF register.
if (src->isGreg()) {
int srcRegStart = src->getLinearizedStart() / grfSize;
int srcRegEnd = src->getLinearizedEnd() / grfSize;
if (srcRegStart <= dstReg && dstReg <= srcRegEnd)
return false;
}

return true;
}

Expand Down

0 comments on commit b5f5458

Please sign in to comment.