Skip to content

Commit 2e8594a

Browse files
pratikasharigcbot
authored andcommitted
Add pseudo-kill when filling entire address taken variable
When an address taken variable is indirectly referenced, the compiler cannot statically determine which parts of the variable are being referenced. Therefore, it has to assume any part of the variable may be read/written. In case such a variable is spilled, we need to bring entire variable to registers in order to read/write to it. In some cases, aftering filling entire variable in a temporary, spill cleanup may optimize away some rows of this temporary because those rows may have never been defined. When this happens, subsequent liveness pass extends the filled temporary liveness above what is required. We insert a pseudo-kill instruction just before filling in the temporary so that even if some rows are eliminated, liveness pass models KILL location appropriately.
1 parent d7efa92 commit 2e8594a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

visa/SpillManagerGMRF.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3485,6 +3485,9 @@ void SpillManagerGRF::insertAddrTakenSpillAndFillCode(
34853485
G4_Declare *mRangeDcl = createAndInitMHeader(
34863486
(G4_RegVarTransient *)temp->getRegVar()->getBaseRegVar());
34873487

3488+
kernel->fg.builder->createPseudoKill(temp, PseudoKillType::Other,
3489+
true);
3490+
34883491
sendInSpilledRegVarPortions(fillGRFRangeDcl, mRangeDcl, 0,
34893492
temp->getNumRows(), 0);
34903493

0 commit comments

Comments
 (0)