@@ -66,8 +66,8 @@ using namespace ::IGC;
66
66
67
67
// / CompileUnit - Compile unit constructor.
68
68
CompileUnit::CompileUnit (unsigned UID, DIE* D, DICompileUnit* Node,
69
- StreamEmitter* A, IGC::DwarfDebug* DW)
70
- : UniqueID(UID), Node(Node), CUDie(D), Asm(A), DD(DW),
69
+ StreamEmitter* A, VISAModule* M, IGC::DwarfDebug* DW)
70
+ : UniqueID(UID), Node(Node), CUDie(D), Asm(A), m_pModule(M), DD(DW),
71
71
IndexTyDie(0 ), DebugInfoOffset(0 )
72
72
{
73
73
DIEIntegerOne = new (DIEValueAllocator)DIEInteger (1 );
@@ -221,7 +221,7 @@ void CompileUnit::addSInt(DIEBlock* Die, Optional<dwarf::Form> Form, int64_t Int
221
221
// / table.
222
222
void CompileUnit::addString (DIE* Die, dwarf::Attribute Attribute, StringRef String)
223
223
{
224
- if (DD-> IsDirectElfInput () )
224
+ if (m_pModule-> isDirectElfInput )
225
225
{
226
226
// Emit string inlined
227
227
auto Str = new (DIEValueAllocator) DIEInlinedString (String);
@@ -1751,7 +1751,7 @@ DIE* CompileUnit::constructVariableDIE(DbgVariable& DV, bool isScopeAbstract)
1751
1751
unsigned Offset = DV.getDotDebugLocOffset ();
1752
1752
if (Offset != ~0U )
1753
1753
{
1754
- if (DD-> IsDirectElfInput () )
1754
+ if (m_pModule-> isDirectElfInput )
1755
1755
{
1756
1756
// Copy over references ranges to DotLocDebugEntries
1757
1757
Offset = DD->CopyDebugLoc (Offset);
@@ -1786,9 +1786,7 @@ DIE* CompileUnit::constructVariableDIE(DbgVariable& DV, bool isScopeAbstract)
1786
1786
1787
1787
void CompileUnit::buildLocation (const llvm::Instruction* pDbgInst, DbgVariable& DV, IGC::DIE* VariableDie)
1788
1788
{
1789
- auto F = pDbgInst->getParent ()->getParent ();
1790
- auto VISAModule = DD->GetVISAModule (F);
1791
- VISAVariableLocation Loc = VISAModule->GetVariableLocation (pDbgInst);
1789
+ VISAVariableLocation Loc = m_pModule->GetVariableLocation (pDbgInst);
1792
1790
1793
1791
// Variable can be immdeiate or in a location (but not both)
1794
1792
if (Loc.IsImmediate ())
@@ -1805,15 +1803,15 @@ void CompileUnit::buildLocation(const llvm::Instruction* pDbgInst, DbgVariable&
1805
1803
else
1806
1804
{
1807
1805
VISAModule::DataVector rawData;
1808
- VISAModule ->GetConstantData (pConstVal, rawData);
1806
+ m_pModule ->GetConstantData (pConstVal, rawData);
1809
1807
addConstantData (VariableDie, rawData.data (), rawData.size ());
1810
1808
}
1811
1809
DV.setDIE (VariableDie);
1812
1810
return ;
1813
1811
}
1814
1812
1815
1813
bool addDecoration = false ;
1816
- if (VISAModule ->isDirectElfInput )
1814
+ if (m_pModule ->isDirectElfInput )
1817
1815
{
1818
1816
if (Loc.HasSurface ())
1819
1817
{
@@ -1904,7 +1902,7 @@ void CompileUnit::buildLocation(const llvm::Instruction* pDbgInst, DbgVariable&
1904
1902
{
1905
1903
// Add description stating whether variable was vectorized in VISA
1906
1904
addString (VariableDie, dwarf::DW_AT_description, " vectorized" );
1907
- uint16_t simdSize = VISAModule ->GetSIMDSize ();
1905
+ uint16_t simdSize = m_pModule ->GetSIMDSize ();
1908
1906
addString (VariableDie, dwarf::DW_AT_description,
1909
1907
simdSize == 8 ? " simd8" : simdSize == 16 ? " simd16" : " ???" );
1910
1908
}
@@ -1981,7 +1979,6 @@ void CompileUnit::buildSampler(DbgVariable& var, DIE* die, VISAVariableLocation*
1981
1979
1982
1980
void CompileUnit::buildSLM (DbgVariable& var, DIE* die, VISAVariableLocation* loc)
1983
1981
{
1984
- auto VISAMod = const_cast <VISAModule*>(loc->GetVISAModule ());
1985
1982
if (loc->IsRegister ())
1986
1983
{
1987
1984
DIEBlock* Block = new (DIEValueAllocator)DIEBlock ();
@@ -1990,7 +1987,7 @@ void CompileUnit::buildSLM(DbgVariable& var, DIE* die, VISAVariableLocation* loc
1990
1987
{
1991
1988
DbgDecoder::VarInfo varInfo;
1992
1989
auto regNum = loc->GetRegister ();
1993
- VISAMod ->getVarInfo (" V" , regNum, varInfo);
1990
+ m_pModule ->getVarInfo (" V" , regNum, varInfo);
1994
1991
1995
1992
if (varInfo.lrs .size () == 0 )
1996
1993
return ;
@@ -2062,8 +2059,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
2062
2059
{
2063
2060
DbgDecoder::VarInfo varInfo;
2064
2061
auto regNum = loc->GetRegister ();
2065
- auto VISAMod = const_cast <VISAModule*>(loc->GetVISAModule ());
2066
- VISAMod->getVarInfo (" V" , regNum, varInfo);
2062
+ m_pModule->getVarInfo (" V" , regNum, varInfo);
2067
2063
2068
2064
if (varInfo.lrs .size () == 0 )
2069
2065
return ;
@@ -2081,7 +2077,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
2081
2077
{
2082
2078
unsigned int subReg = varInfo.lrs .front ().getGRF ().subRegNum ;
2083
2079
auto offsetInBits = subReg * 8 ;
2084
- auto sizeInBits = (VISAMod ->m_pShader ->getGRFSize () * 8 ) - offsetInBits;
2080
+ auto sizeInBits = (m_pModule ->m_pShader ->getGRFSize () * 8 ) - offsetInBits;
2085
2081
2086
2082
addUInt (Block, dwarf::DW_FORM_data1, dwarf::DW_OP_bit_piece);
2087
2083
addUInt (Block, dwarf::DW_FORM_udata, sizeInBits);
@@ -2103,7 +2099,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
2103
2099
}
2104
2100
else
2105
2101
{
2106
- uint16_t grfSize = (uint16_t )VISAMod ->m_pShader ->getGRFSize ();
2102
+ uint16_t grfSize = (uint16_t )m_pModule ->m_pShader ->getGRFSize ();
2107
2103
uint16_t varSizeInBits = loc->IsInMemory () ? (uint16_t )Asm->GetPointerSize () * 8 : (uint16_t )var.getBasicSize (DD);
2108
2104
uint16_t varSizeInReg = (uint16_t )(loc->IsInMemory () && varSizeInBits < 32 ) ? 32 : varSizeInBits;
2109
2105
uint16_t numOfRegs = ((varSizeInReg * (uint16_t )DD->simdWidth ) > (grfSize * 8 )) ?
@@ -2141,7 +2137,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
2141
2137
}
2142
2138
else
2143
2139
{
2144
- uint16_t grfSize = (uint16_t )VISAMod ->m_pShader ->getGRFSize ();
2140
+ uint16_t grfSize = (uint16_t )m_pModule ->m_pShader ->getGRFSize ();
2145
2141
uint16_t varSizeInBits = loc->IsInMemory () ? (uint16_t )Asm->GetPointerSize () * 8 : (uint16_t )var.getBasicSize (DD);
2146
2142
uint16_t varSizeInReg = (uint16_t )(loc->IsInMemory () && varSizeInBits < 32 ) ? 32 : varSizeInBits;
2147
2143
uint16_t numOfRegs = ((varSizeInReg * (uint16_t )DD->simdWidth ) > (grfSize * 8 )) ?
0 commit comments