Skip to content

Commit 2c560b0

Browse files
pratikasharigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 3a79aa4
No change No change
1 parent 2ea7d9f commit 2c560b0

File tree

5 files changed

+6
-55
lines changed

5 files changed

+6
-55
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4490,15 +4490,6 @@ namespace IGC
44904490
SaveOption(vISA_TotalGRFNum, context->getNumGRFPerThread());
44914491
}
44924492

4493-
if (m_program->HasStackCalls())
4494-
{
4495-
bool ZEBinEnabled = IGC_IS_FLAG_ENABLED(EnableZEBinary) || context->getCompilerOption().EnableZEBinary;
4496-
4497-
// pass higher ABI version when using ZEBinary
4498-
if (ZEBinEnabled)
4499-
SaveOption(vISA_StackCallABIVer, (uint32_t)2);
4500-
}
4501-
45024493
//
45034494
// Setting number of GRF and threads per EU is restricted to OCL only
45044495
// Number of threads can be set by:

IGC/ZEBinWriter/zebin/source/ZEELFObjectBuilder.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -815,15 +815,8 @@ void ELFWriter::writeHeader()
815815
// e_ident[EI_VERSION]
816816
m_W.OS << char(ELF::EV_CURRENT);
817817

818-
// e_ident[EI_OSABI]
819-
m_W.OS << char(ELF::ELFOSABI_NONE);
820-
821-
// ABI version is hard coded right now. In future, if more ABI versions exist then revisit this.
822-
// e_ident[EI_ABIVERSION]
823-
m_W.OS << char(1);
824-
825818
// e_ident padding
826-
m_W.OS.write_zeros(ELF::EI_NIDENT - ELF::EI_PAD);
819+
m_W.OS.write_zeros(ELF::EI_NIDENT - ELF::EI_OSABI);
827820

828821
// e_type: Currently IGC always emits a relocatable file
829822
m_W.write<uint16_t>(ELF::ET_REL);

visa/G4_Kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ KernelDebugInfo* G4_Kernel::getKernelDebugInfo()
864864

865865
unsigned G4_Kernel::getStackCallStartReg() const
866866
{
867-
// Last 3 (or 2) GRFs reserved for stack call purpose
867+
// Last 3 GRFs to be used as scratch
868868
unsigned totalGRFs = getNumRegTotal();
869869
unsigned startReg = totalGRFs - numReservedABIGRF();
870870
return startReg;

visa/G4_Kernel.hpp

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ class G4_Kernel
347347
return getKernelAttrs()->getInt32KernelAttr(aID);
348348
}
349349
bool getOption(vISAOptions opt) const { return m_options->getOption(opt); }
350-
uint32_t getuInt32Option(vISAOptions opt) const { return m_options->getuInt32Option(opt); }
351350
void computeChannelSlicing();
352351
void calculateSimdSize();
353352
G4_ExecSize getSimdSize() { return simdSize; }
@@ -392,26 +391,10 @@ class G4_Kernel
392391
unsigned calleeSaveStart() const;
393392
unsigned getNumCalleeSaveRegs() const;
394393

395-
enum StackCallABIVersion
396-
{
397-
VER_1 = 1, // This version is used pre-zebin
398-
VER_2 = 2, // This version is used for zebin
399-
};
400-
401394
// return the number of reserved GRFs for stack call ABI
402395
// the reserved registers are at the end of the GRF file (e.g., r125-r127)
403-
// for some architectures/ABI version, we dont need a copy of r0 and
404-
// instructions can directly refer to r0 in code (eg, sends).
405396
uint32_t numReservedABIGRF() const {
406-
if (getuInt32Option(vISA_StackCallABIVer) == VER_1)
407-
return 3;
408-
else
409-
{
410-
// for ABI version > 1,
411-
if (getOption(vISA_PreserveR0InR0))
412-
return 2;
413-
return 3;
414-
}
397+
return 3;
415398
}
416399

417400
// purpose of the GRFs reserved for stack call ABI
@@ -420,30 +403,15 @@ class G4_Kernel
420403
const int ThreadHeaderGRF = 2;
421404

422405
uint32_t getFPSPGRF() const{
423-
// For ABI V1 return r125.
424-
// For ABI V2 return r127.
425-
if(getuInt32Option(vISA_StackCallABIVer) == VER_1)
426-
return getStackCallStartReg() + FPSPGRF;
427-
else
428-
return (getNumRegTotal() - 1) - FPSPGRF;
406+
return getStackCallStartReg() + FPSPGRF;
429407
}
430408

431409
uint32_t getSpillHeaderGRF() const{
432-
// For ABI V1 return r126.
433-
// For ABI V2 return r126.
434-
if (getuInt32Option(vISA_StackCallABIVer) == VER_1)
435-
return getStackCallStartReg() + SpillHeaderGRF;
436-
else
437-
return (getNumRegTotal() - 1) - SpillHeaderGRF;
410+
return getStackCallStartReg() + SpillHeaderGRF;
438411
}
439412

440413
uint32_t getThreadHeaderGRF() const{
441-
// For ABI V1 return r127.
442-
// For ABI V2 return r125.
443-
if (getuInt32Option(vISA_StackCallABIVer) == VER_1)
444-
return getStackCallStartReg() + ThreadHeaderGRF;
445-
else
446-
return (getNumRegTotal() - 1) - ThreadHeaderGRF;
414+
return getStackCallStartReg() + ThreadHeaderGRF;
447415
}
448416

449417
void renameAliasDeclares();

visa/include/VISAOptionsDefs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ DEF_VISA_OPTION(vISA_CodePatch, ET_INT32, "-codePatch", UNUSED, 0)
135135
DEF_VISA_OPTION(vISA_Linker, ET_INT32, "-linker", UNUSED, 0)
136136
DEF_VISA_OPTION(vISA_lscEnableImmOffsFor, ET_INT32, "-lscEnableImmOffsFor", UNUSED, 0x3001E)
137137
DEF_VISA_OPTION(vISA_PreserveR0InR0, ET_BOOL, "-preserver0", UNUSED, false)
138-
DEF_VISA_OPTION(vISA_StackCallABIVer, ET_INT32, "-abiver", UNUSED, 1)
139138

140139
//=== RA options ===
141140
DEF_VISA_OPTION(vISA_RoundRobin, ET_BOOL, "-noroundrobin", UNUSED, true)

0 commit comments

Comments
 (0)