@@ -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, VISAModule* M, IGC::DwarfDebug* DW)
70
- : UniqueID(UID), Node(Node), CUDie(D), Asm(A), m_pModule(M), DD(DW),
69
+ StreamEmitter* A, IGC::DwarfDebug* DW)
70
+ : UniqueID(UID), Node(Node), CUDie(D), Asm(A), 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 (m_pModule-> isDirectElfInput )
224
+ if (DD-> IsDirectElfInput () )
225
225
{
226
226
// Emit string inlined
227
227
auto Str = new (DIEValueAllocator) DIEInlinedString (String);
@@ -1743,7 +1743,7 @@ DIE* CompileUnit::constructVariableDIE(DbgVariable& DV, bool isScopeAbstract)
1743
1743
unsigned Offset = DV.getDotDebugLocOffset ();
1744
1744
if (Offset != ~0U )
1745
1745
{
1746
- if (m_pModule-> isDirectElfInput )
1746
+ if (DD-> IsDirectElfInput () )
1747
1747
{
1748
1748
// Copy over references ranges to DotLocDebugEntries
1749
1749
Offset = DD->CopyDebugLoc (Offset);
@@ -1778,7 +1778,9 @@ DIE* CompileUnit::constructVariableDIE(DbgVariable& DV, bool isScopeAbstract)
1778
1778
1779
1779
void CompileUnit::buildLocation (const llvm::Instruction* pDbgInst, DbgVariable& DV, IGC::DIE* VariableDie)
1780
1780
{
1781
- VISAVariableLocation Loc = m_pModule->GetVariableLocation (pDbgInst);
1781
+ auto F = pDbgInst->getParent ()->getParent ();
1782
+ auto VISAModule = DD->GetVISAModule (F);
1783
+ VISAVariableLocation Loc = VISAModule->GetVariableLocation (pDbgInst);
1782
1784
1783
1785
// Variable can be immdeiate or in a location (but not both)
1784
1786
if (Loc.IsImmediate ())
@@ -1795,15 +1797,15 @@ void CompileUnit::buildLocation(const llvm::Instruction* pDbgInst, DbgVariable&
1795
1797
else
1796
1798
{
1797
1799
VISAModule::DataVector rawData;
1798
- m_pModule ->GetConstantData (pConstVal, rawData);
1800
+ VISAModule ->GetConstantData (pConstVal, rawData);
1799
1801
addConstantData (VariableDie, rawData.data (), rawData.size ());
1800
1802
}
1801
1803
DV.setDIE (VariableDie);
1802
1804
return ;
1803
1805
}
1804
1806
1805
1807
bool addDecoration = false ;
1806
- if (m_pModule ->isDirectElfInput )
1808
+ if (VISAModule ->isDirectElfInput )
1807
1809
{
1808
1810
if (Loc.HasSurface ())
1809
1811
{
@@ -1894,7 +1896,7 @@ void CompileUnit::buildLocation(const llvm::Instruction* pDbgInst, DbgVariable&
1894
1896
{
1895
1897
// Add description stating whether variable was vectorized in VISA
1896
1898
addString (VariableDie, dwarf::DW_AT_description, " vectorized" );
1897
- uint16_t simdSize = m_pModule ->GetSIMDSize ();
1899
+ uint16_t simdSize = VISAModule ->GetSIMDSize ();
1898
1900
addString (VariableDie, dwarf::DW_AT_description,
1899
1901
simdSize == 8 ? " simd8" : simdSize == 16 ? " simd16" : " ???" );
1900
1902
}
@@ -1971,6 +1973,7 @@ void CompileUnit::buildSampler(DbgVariable& var, DIE* die, VISAVariableLocation*
1971
1973
1972
1974
void CompileUnit::buildSLM (DbgVariable& var, DIE* die, VISAVariableLocation* loc)
1973
1975
{
1976
+ auto VISAMod = const_cast <VISAModule*>(loc->GetVISAModule ());
1974
1977
if (loc->IsRegister ())
1975
1978
{
1976
1979
DIEBlock* Block = new (DIEValueAllocator)DIEBlock ();
@@ -1979,7 +1982,7 @@ void CompileUnit::buildSLM(DbgVariable& var, DIE* die, VISAVariableLocation* loc
1979
1982
{
1980
1983
DbgDecoder::VarInfo varInfo;
1981
1984
auto regNum = loc->GetRegister ();
1982
- m_pModule ->getVarInfo (" V" , regNum, varInfo);
1985
+ VISAMod ->getVarInfo (" V" , regNum, varInfo);
1983
1986
1984
1987
Address addr;
1985
1988
addr.Set (Address::Space::eLocal, 0 , 0 );
@@ -2048,7 +2051,8 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
2048
2051
{
2049
2052
DbgDecoder::VarInfo varInfo;
2050
2053
auto regNum = loc->GetRegister ();
2051
- m_pModule->getVarInfo (" V" , regNum, varInfo);
2054
+ auto VISAMod = const_cast <VISAModule*>(loc->GetVISAModule ());
2055
+ VISAMod->getVarInfo (" V" , regNum, varInfo);
2052
2056
2053
2057
if (varInfo.isGRF ())
2054
2058
{
@@ -2063,7 +2067,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
2063
2067
{
2064
2068
unsigned int subReg = varInfo.getGRF ().subRegNum ;
2065
2069
auto offsetInBits = subReg * 8 ;
2066
- auto sizeInBits = (m_pModule ->m_pShader ->getGRFSize () * 8 ) - offsetInBits;
2070
+ auto sizeInBits = (VISAMod ->m_pShader ->getGRFSize () * 8 ) - offsetInBits;
2067
2071
2068
2072
addUInt (Block, dwarf::DW_FORM_data1, dwarf::DW_OP_bit_piece);
2069
2073
addUInt (Block, dwarf::DW_FORM_udata, sizeInBits);
@@ -2085,7 +2089,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
2085
2089
}
2086
2090
else
2087
2091
{
2088
- uint16_t grfSize = (uint16_t )m_pModule ->m_pShader ->getGRFSize ();
2092
+ uint16_t grfSize = (uint16_t )VISAMod ->m_pShader ->getGRFSize ();
2089
2093
uint16_t varSizeInBits = loc->IsInMemory () ? (uint16_t )Asm->GetPointerSize () * 8 : (uint16_t )var.getBasicSize (DD);
2090
2094
uint16_t varSizeInReg = (uint16_t )(loc->IsInMemory () && varSizeInBits < 32 ) ? 32 : varSizeInBits;
2091
2095
uint16_t numOfRegs = ((varSizeInReg * (uint16_t )DD->simdWidth ) > (grfSize * 8 )) ?
@@ -2123,7 +2127,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
2123
2127
}
2124
2128
else
2125
2129
{
2126
- uint16_t grfSize = (uint16_t )m_pModule ->m_pShader ->getGRFSize ();
2130
+ uint16_t grfSize = (uint16_t )VISAMod ->m_pShader ->getGRFSize ();
2127
2131
uint16_t varSizeInBits = loc->IsInMemory () ? (uint16_t )Asm->GetPointerSize () * 8 : (uint16_t )var.getBasicSize (DD);
2128
2132
uint16_t varSizeInReg = (uint16_t )(loc->IsInMemory () && varSizeInBits < 32 ) ? 32 : varSizeInBits;
2129
2133
uint16_t numOfRegs = ((varSizeInReg * (uint16_t )DD->simdWidth ) > (grfSize * 8 )) ?
0 commit comments