Skip to content

Commit 7795f70

Browse files
pratikasharigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 06b617f
Disable spill space compression for VISA_3D target as it only considers conventional interference graph when deciding to share spill slots between spilled variables. Disable spill space compression for VISA_3D target as it only considers conventional interference graph when deciding to share spill slots between spilled variables.
1 parent 5596ef9 commit 7795f70

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

visa/GraphColor.cpp

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10339,16 +10339,7 @@ int GlobalRA::coloringRegAlloc()
1033910339
// depending on spill offset. oword is supported for PVC but it is not emitted in
1034010340
// favor of LSC.
1034110341
|| builder.supportsLSC());
10342-
10343-
// spill compression implementation considers only interference graph when deciding
10344-
// to share spill slots. 3d programs may have variables in Default bucket that dont
10345-
// interfere but cannot be assigned same spill slot. for correctness, this is turned
10346-
// off for 3d. in order to support this for 3d, we would've to consider augmentation
10347-
// live-intervals in spill compression implementation. currently, augmentation is
10348-
// required only when target is VISA_3D. for VC target it is safe to keep spill
10349-
// compression enabled.
10350-
bool enableSpillSpaceCompression = builder.getOption(vISA_SpillSpaceCompression) &&
10351-
kernel.getInt32KernelAttr(Attributes::ATTR_Target) != VISA_3D;
10342+
bool enableSpillSpaceCompression = builder.getOption(vISA_SpillSpaceCompression);
1035210343

1035310344
uint32_t nextSpillOffset = 0;
1035410345
uint32_t scratchOffset = 0;
@@ -10644,6 +10635,23 @@ int GlobalRA::coloringRegAlloc()
1064410635
return VISA_SPILL;
1064510636
}
1064610637

10638+
if (iterationNo == 0 &&
10639+
enableSpillSpaceCompression &&
10640+
kernel.getInt32KernelAttr(Attributes::ATTR_Target) == VISA_3D &&
10641+
!hasStackCall)
10642+
{
10643+
unsigned spillSize = 0;
10644+
const LIVERANGE_LIST& spilledLRs = coloring.getSpilledLiveRanges();
10645+
for (auto lr : spilledLRs)
10646+
{
10647+
spillSize += lr->getDcl()->getByteSize();
10648+
}
10649+
if ((int)(spillSize * 1.5) < (SCRATCH_MSG_LIMIT - globalScratchOffset))
10650+
{
10651+
enableSpillSpaceCompression = false;
10652+
}
10653+
}
10654+
1064710655
startTimer(TimerID::SPILL);
1064810656
SpillManagerGRF spillGRF(*this,
1064910657
nextSpillOffset,

0 commit comments

Comments
 (0)