Skip to content

Commit fd980e3

Browse files
bcheng0127igcbot
authored andcommitted
Fix the bug in flag register spill/fill clean up
1 parent b091f92 commit fd980e3

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

visa/GraphColor.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10767,6 +10767,12 @@ bool FlagSpillCleanup::initializeFlagScratchAccess(
1076710767
}
1076810768
FlagLineraizedStartAndEnd(topDcl_1, scratchAccess->linearizedStart, scratchAccess->linearizedEnd);
1076910769
scratchAccess->flagOpnd = dst;
10770+
if (inst->getPredicate())
10771+
{
10772+
scratchAccess->removeable = false; //Partil spill/fill cannot be removed
10773+
scratchAccess->instKilled = true; //Not really killed, mark so that the instruction depends on current one will not be removed.
10774+
}
10775+
1077010776
return true;
1077110777
}
1077210778
}
@@ -10791,6 +10797,12 @@ bool FlagSpillCleanup::initializeFlagScratchAccess(
1079110797
scratchAccess->isSpill = true;
1079210798
FlagLineraizedStartAndEnd(topDcl_2, scratchAccess->linearizedStart, scratchAccess->linearizedEnd);
1079310799
scratchAccess->flagOpnd = src;
10800+
if (inst->getPredicate())
10801+
{
10802+
scratchAccess->removeable = false; //Partil spill/fill cannot be removed
10803+
scratchAccess->instKilled = true; //Not really killed, mark so that the instruction depends on current one will not be removed.
10804+
}
10805+
1079410806
return true;
1079510807
}
1079610808
}
@@ -11129,7 +11141,7 @@ void FlagSpillCleanup::regFillClean(
1112911141
// Since the reuse happens from front to end.
1113011142
// If the pre scratchAccess is killed, current candidate can not reuse previous register any more
1113111143
if (!scratchAccess->instKilled &&
11132-
(scratchAccess->removeable || scratchAccess->directKill))
11144+
(scratchAccess->removeable && scratchAccess->directKill))
1113311145
{
1113411146
if (scratchAccess->prePreScratchAccess)
1113511147
{
@@ -11251,9 +11263,7 @@ void FlagSpillCleanup::spillFillCodeCleanFlag(
1125111263
SCRATCH_PTR_VEC candidateList;
1125211264
FlowGraph& fg = kernel.fg;
1125311265

11254-
//#ifdef _DEBUG
1125511266
int candidate_size = 0;
11256-
//#endif
1125711267
for (auto bb : fg)
1125811268
{
1125911269
INST_LIST_ITER inst_it = bb->begin();

0 commit comments

Comments
 (0)