@@ -10767,6 +10767,12 @@ bool FlagSpillCleanup::initializeFlagScratchAccess(
10767
10767
}
10768
10768
FlagLineraizedStartAndEnd (topDcl_1, scratchAccess->linearizedStart , scratchAccess->linearizedEnd );
10769
10769
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
+
10770
10776
return true ;
10771
10777
}
10772
10778
}
@@ -10791,6 +10797,12 @@ bool FlagSpillCleanup::initializeFlagScratchAccess(
10791
10797
scratchAccess->isSpill = true ;
10792
10798
FlagLineraizedStartAndEnd (topDcl_2, scratchAccess->linearizedStart , scratchAccess->linearizedEnd );
10793
10799
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
+
10794
10806
return true ;
10795
10807
}
10796
10808
}
@@ -11129,7 +11141,7 @@ void FlagSpillCleanup::regFillClean(
11129
11141
// Since the reuse happens from front to end.
11130
11142
// If the pre scratchAccess is killed, current candidate can not reuse previous register any more
11131
11143
if (!scratchAccess->instKilled &&
11132
- (scratchAccess->removeable || scratchAccess->directKill ))
11144
+ (scratchAccess->removeable && scratchAccess->directKill ))
11133
11145
{
11134
11146
if (scratchAccess->prePreScratchAccess )
11135
11147
{
@@ -11251,9 +11263,7 @@ void FlagSpillCleanup::spillFillCodeCleanFlag(
11251
11263
SCRATCH_PTR_VEC candidateList;
11252
11264
FlowGraph& fg = kernel.fg ;
11253
11265
11254
- // #ifdef _DEBUG
11255
11266
int candidate_size = 0 ;
11256
- // #endif
11257
11267
for (auto bb : fg)
11258
11268
{
11259
11269
INST_LIST_ITER inst_it = bb->begin ();
0 commit comments