Skip to content

Commit 4517723

Browse files
pratikasharigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 999667c
Use max PTSS supported when using stack calls as estimating size needed to store BE stack is not always possible. Use max PTSS supported when using stack calls as estimating size needed to store BE stack is not always possible.
1 parent ad03f8e commit 4517723

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

visa/GraphColor.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10375,7 +10375,7 @@ int GlobalRA::coloringRegAlloc()
1037510375
builder.kernel.fg.frameSizeInOWord > 0;
1037610376
jitInfo->hasStackcalls = kernel.fg.getHasStackCalls();
1037710377

10378-
if (jitInfo->hasStackcalls && builder.getIsKernel()) {
10378+
if (builder.kernel.fg.frameSizeInOWord != 0) {
1037910379
// jitInfo->spillMemUsed is the entire visa stack size. Consider the caller/callee
1038010380
// save size if having caller/callee save
1038110381
// globalScratchOffset in unit of byte, others in Oword
@@ -10389,16 +10389,12 @@ int GlobalRA::coloringRegAlloc()
1038910389
// callerSaveAreaOffset -> ---------------------
1039010390
// | caller save |
1039110391
// paramOverflowAreaOffset -> ---------------------
10392+
jitInfo->spillMemUsed =
10393+
builder.kernel.fg.frameSizeInOWord * 16;
1039210394

10393-
// Since it is difficult to predict amount of space needed to store stack, we
10394-
// reserve maximum possible PTSS supported by platform.
10395-
auto maxPTSS = kernel.fg.builder->getMaxPTSS();
10396-
jitInfo->spillMemUsed = maxPTSS;
10397-
10398-
// reserve spillMemUsed #bytes at upper end of PTSS
10399-
kernel.getGTPinData()->setScratchNextFree(maxPTSS - kernel.getGTPinData()->getNumBytesScratchUse());
10400-
}
10401-
else {
10395+
// reserve spillMemUsed #bytes before 8kb boundary
10396+
kernel.getGTPinData()->setScratchNextFree(8*1024 - kernel.getGTPinData()->getNumBytesScratchUse());
10397+
} else {
1040210398
jitInfo->spillMemUsed = spillMemUsed;
1040310399
kernel.getGTPinData()->setScratchNextFree(spillMemUsed);
1040410400
}

visa/HWCaps.inc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -850,16 +850,4 @@ SPDX-License-Identifier: MIT
850850
{
851851
return getPlatform() <= GENX_TGLLP;
852852
}
853-
854-
unsigned int getMaxPTSS() const
855-
{
856-
if (getPlatform() >= GENX_TGLLP)
857-
{
858-
// Max PTSS supported is 256kb
859-
return 256 * 1024;
860-
}
861-
862-
// Max PTSS supported is 2MB
863-
return 2 * 1024 * 1024;
864-
}
865853
// end HW capabilities

0 commit comments

Comments
 (0)