Skip to content

Commit 14c2926

Browse files
committed
[Autobackout][FuncReg]Revert of change: 30f1cf4
Add GTPin flags to support L0 driver path Change-Id: I5a7df274eb2befe44f081a5dd3c958769688296a
1 parent dff87fb commit 14c2926

File tree

7 files changed

+27
-109
lines changed

7 files changed

+27
-109
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,14 +3807,6 @@ namespace IGC
38073807
{
38083808
SaveOption(vISA_ReRAPostSchedule, true);
38093809
}
3810-
if (ClContext->m_InternalOptions.GTPinGRFInfo)
3811-
{
3812-
SaveOption(vISA_GetFreeGRFInfo, true);
3813-
}
3814-
if (ClContext->m_InternalOptions.GTPinScratchAreaSize)
3815-
{
3816-
SaveOption(vISA_GTPinScratchAreaSize, ClContext->m_InternalOptions.GTPinScratchAreaSizeValue);
3817-
}
38183810
}
38193811

38203812
bool EnableBarrierInstCounterBits = false;

IGC/Compiler/CodeGenPublic.h

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,10 @@ namespace IGC
10831083
IntelDisableA64WA = true;
10841084
}
10851085

1086+
if (strstr(options, "-intel-gtpin-rera"))
1087+
{
1088+
DoReRA = true;
1089+
}
10861090
if (strstr(options, "-intel-no-prera-scheduling"))
10871091
{
10881092
IntelEnablePreRAScheduling = false;
@@ -1117,26 +1121,6 @@ namespace IGC
11171121
}
11181122
}
11191123
}
1120-
1121-
// GTPin flags used by L0 driver runtime
1122-
if (strstr(options, "-gtpin-rera"))
1123-
{
1124-
DoReRA = true;
1125-
}
1126-
if (strstr(options, "-gtpin-grf-info"))
1127-
{
1128-
GTPinGRFInfo = true;
1129-
}
1130-
if (const char* op = strstr(options, "-gtpin-scratch-area-size"))
1131-
{
1132-
GTPinScratchAreaSize = true;
1133-
const char* optionVal = op + strlen("-gtpin-scratch-area-size");
1134-
if ((*optionVal == '=' || *optionVal == ' ') && isdigit(*(optionVal + 1)))
1135-
{
1136-
++optionVal;
1137-
GTPinScratchAreaSizeValue = atoi(optionVal);
1138-
}
1139-
}
11401124
}
11411125

11421126

@@ -1155,9 +1139,6 @@ namespace IGC
11551139
bool PreferBindlessImages = false;
11561140
bool IntelForceGlobalMemoryAllocation = false;
11571141
bool hasNoLocalToGeneric = false;
1158-
bool GTPinGRFInfo = false;
1159-
bool GTPinScratchAreaSize = false;
1160-
uint32_t GTPinScratchAreaSizeValue = 0;
11611142

11621143
// -1 : initial value that means it is not set from cmdline
11631144
// 0-5: valid values set from the cmdline

visa/BuildCISAIRImpl.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -378,18 +378,7 @@ int CISA_IR_Builder::AddKernel(VISAKernel *& kernel, const char* kernelName)
378378
m_kernels.push_back(kerneltemp);
379379
m_kernel->setVersion((unsigned char)this->m_header.major_version, (unsigned char)this->m_header.minor_version);
380380
m_kernel->InitializeKernel(kernelName);
381-
382-
if (m_options.getOption(vISA_ReRAPostSchedule) || m_options.getOption(vISA_GetFreeGRFInfo)
383-
|| m_options.getuInt32Option(vISA_GTPinScratchAreaSize) > 0)
384-
{
385-
// GTPin init set by L0 driver through flags
386-
m_kernel->SetGTPinInit(nullptr);
387-
}
388-
else
389-
{
390-
// GTPin init set by buffer from IGC
391-
m_kernel->SetGTPinInit(getGtpinInit());
392-
}
381+
m_kernel->SetGTPinInit(getGtpinInit());
393382
this->m_kernel_count++;
394383

395384
if (m_options.getOption(vISA_IsaAssembly))

visa/FlowGraph.cpp

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7014,7 +7014,6 @@ void gtPinData::setGTPinInit(void* buffer)
70147014
{
70157015
MUST_BE_TRUE(sizeof(gtpin::igc::igc_init_t) <= 200, "Check size of igc_init_t");
70167016
gtpin_init = (gtpin::igc::igc_init_t*)buffer;
7017-
gtpinInitFromL0 = false;
70187017

70197018
if (gtpin_init->re_ra)
70207019
kernel.getOptions()->setOption(vISA_ReRAPostSchedule, true);
@@ -7068,11 +7067,6 @@ unsigned int gtPinData::getPerThreadNextOff()
70687067

70697068
void* gtPinData::getGTPinInfoBuffer(unsigned int &bufferSize)
70707069
{
7071-
if (!gtpinInitFromL0 && !kernel.hasGTPinInit())
7072-
{
7073-
return nullptr;
7074-
}
7075-
70767070
gtpin::igc::igc_init_t t;
70777071
std::vector<unsigned char> buffer;
70787072
unsigned int numTokens = 0;
@@ -7082,53 +7076,26 @@ void* gtPinData::getGTPinInfoBuffer(unsigned int &bufferSize)
70827076
memset(&t, 0, sizeof(t));
70837077

70847078
t.version = gtpin::igc::GTPIN_IGC_INTERFACE_VERSION;
7085-
if (gtpinInitFromL0)
7079+
if (gtpin_init->grf_info)
70867080
{
7087-
if (kernel.getOption(vISA_GetFreeGRFInfo))
7088-
{
7089-
if (!stackABI)
7090-
t.grf_info = 1;
7091-
numTokens++;
7092-
}
7093-
7094-
if (kernel.getOption(vISA_ReRAPostSchedule))
7095-
{
7096-
if (!stackABI)
7097-
t.re_ra = 1;
7098-
}
7099-
7100-
if (kernel.getOptions()->getOption(vISA_GenerateDebugInfo))
7101-
t.srcline_mapping = 1;
7102-
7103-
if (kernel.getOptions()->getuInt32Option(vISA_GTPinScratchAreaSize) > 0)
7104-
{
7105-
t.scratch_area_size = kernel.getOptions()->getuInt32Option(vISA_GTPinScratchAreaSize);
7106-
numTokens++;
7107-
}
7081+
if (!stackABI)
7082+
t.grf_info = 1;
7083+
numTokens++;
71087084
}
7109-
else
7110-
{
7111-
if (gtpin_init->grf_info)
7112-
{
7113-
if (!stackABI)
7114-
t.grf_info = 1;
7115-
numTokens++;
7116-
}
71177085

7118-
if (gtpin_init->re_ra)
7119-
{
7120-
if (!stackABI)
7121-
t.re_ra = 1;
7122-
}
7086+
if (gtpin_init->re_ra)
7087+
{
7088+
if(!stackABI)
7089+
t.re_ra = 1;
7090+
}
71237091

7124-
if (gtpin_init->srcline_mapping && kernel.getOptions()->getOption(vISA_GenerateDebugInfo))
7125-
t.srcline_mapping = 1;
7092+
if (gtpin_init->srcline_mapping && kernel.getOptions()->getOption(vISA_GenerateDebugInfo))
7093+
t.srcline_mapping = 1;
71267094

7127-
if (gtpin_init->scratch_area_size > 0)
7128-
{
7129-
t.scratch_area_size = gtpin_init->scratch_area_size;
7130-
numTokens++;
7131-
}
7095+
if (gtpin_init->scratch_area_size > 0)
7096+
{
7097+
t.scratch_area_size = gtpin_init->scratch_area_size;
7098+
numTokens++;
71327099
}
71337100

71347101
// For payload offsets

visa/FlowGraph.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,9 +1312,6 @@ class gtPinData
13121312
unsigned int getCrossThreadNextOff();
13131313
unsigned int getPerThreadNextOff();
13141314

1315-
void setGTPinInitFromL0(bool val) { gtpinInitFromL0 = val; }
1316-
bool isGTPinInitFromL0() { return gtpinInitFromL0; }
1317-
13181315
private:
13191316
G4_Kernel& kernel;
13201317
std::set<G4_INST*> markedInsts;
@@ -1326,7 +1323,6 @@ class gtPinData
13261323
// Member stores next free scratch slot
13271324
unsigned int nextScratchFree = 0;
13281325

1329-
bool gtpinInitFromL0 = false;
13301326
gtpin::igc::igc_init_t* gtpin_init = nullptr;
13311327

13321328
G4_BB* perThreadPayloadBB = nullptr;
@@ -1470,8 +1466,7 @@ class G4_Kernel
14701466
hasAddrTaken = false;
14711467
kernelDbgInfo = nullptr;
14721468
if (options->getOption(vISAOptions::vISA_ReRAPostSchedule) ||
1473-
options->getOption(vISAOptions::vISA_GetFreeGRFInfo) ||
1474-
options->getuInt32Option(vISAOptions::vISA_GTPinScratchAreaSize) > 0)
1469+
options->getOption(vISAOptions::vISA_GetFreeGRFInfo))
14751470
{
14761471
allocGTPinData();
14771472
}

visa/VISAKernelImpl.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7921,14 +7921,6 @@ int VISAKernelImpl::SetGTPinInit(void* buffer)
79217921
gtpin->setGTPinInit(buffer);
79227922
}
79237923
}
7924-
else
7925-
{
7926-
auto gtpin = m_kernel->getGTPinData();
7927-
if (gtpin)
7928-
{
7929-
gtpin->setGTPinInitFromL0(true);
7930-
}
7931-
}
79327924

79337925
return VISA_SUCCESS;
79347926
}
@@ -7938,10 +7930,13 @@ int VISAKernelImpl::GetGTPinBuffer(void*& buffer, unsigned int& size)
79387930
buffer = nullptr;
79397931
size = 0;
79407932

7941-
auto gtpin = m_kernel->getGTPinData();
7942-
if (gtpin)
7933+
if (m_kernel->hasGTPinInit())
79437934
{
7944-
buffer = gtpin->getGTPinInfoBuffer(size);
7935+
auto gtpin = m_kernel->getGTPinData();
7936+
if (gtpin)
7937+
{
7938+
buffer = gtpin->getGTPinInfoBuffer(size);
7939+
}
79457940
}
79467941

79477942
return VISA_SUCCESS;

visa/include/VISAOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ DEF_VISA_OPTION(vISA_isParseMode, ET_BOOL, NULLSTR, UNUSED
210210
// rerun RA post scheduling for gtpin
211211
DEF_VISA_OPTION(vISA_ReRAPostSchedule, ET_BOOL, "-rerapostschedule", UNUSED, false)
212212
DEF_VISA_OPTION(vISA_GetFreeGRFInfo, ET_BOOL, "-getfreegrfinfo", UNUSED, false)
213-
DEF_VISA_OPTION(vISA_GTPinScratchAreaSize,ET_INT32, "-GTPinScratchAreaSize", "USAGE: -GTPinScratchAreaSize <size>\n", 0)
214213

215214
//=== HW Workarounds ===
216215
DEF_VISA_OPTION(vISA_clearScratchWritesBeforeEOT, ET_BOOL, NULLSTR, UNUSED, false)

0 commit comments

Comments
 (0)