@@ -66,8 +66,8 @@ using namespace ::IGC;
6666
6767// / CompileUnit - Compile unit constructor.
6868CompileUnit::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),
7171 IndexTyDie(0 ), DebugInfoOffset(0 )
7272{
7373 DIEIntegerOne = new (DIEValueAllocator)DIEInteger (1 );
@@ -221,7 +221,7 @@ void CompileUnit::addSInt(DIEBlock* Die, Optional<dwarf::Form> Form, int64_t Int
221221// / table.
222222void CompileUnit::addString (DIE* Die, dwarf::Attribute Attribute, StringRef String)
223223{
224- if (DD-> IsDirectElfInput () )
224+ if (m_pModule-> isDirectElfInput )
225225 {
226226 // Emit string inlined
227227 auto Str = new (DIEValueAllocator) DIEInlinedString (String);
@@ -1751,7 +1751,7 @@ DIE* CompileUnit::constructVariableDIE(DbgVariable& DV, bool isScopeAbstract)
17511751 unsigned Offset = DV.getDotDebugLocOffset ();
17521752 if (Offset != ~0U )
17531753 {
1754- if (DD-> IsDirectElfInput () )
1754+ if (m_pModule-> isDirectElfInput )
17551755 {
17561756 // Copy over references ranges to DotLocDebugEntries
17571757 Offset = DD->CopyDebugLoc (Offset);
@@ -1786,9 +1786,7 @@ DIE* CompileUnit::constructVariableDIE(DbgVariable& DV, bool isScopeAbstract)
17861786
17871787void CompileUnit::buildLocation (const llvm::Instruction* pDbgInst, DbgVariable& DV, IGC::DIE* VariableDie)
17881788{
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);
17921790
17931791 // Variable can be immdeiate or in a location (but not both)
17941792 if (Loc.IsImmediate ())
@@ -1805,15 +1803,15 @@ void CompileUnit::buildLocation(const llvm::Instruction* pDbgInst, DbgVariable&
18051803 else
18061804 {
18071805 VISAModule::DataVector rawData;
1808- VISAModule ->GetConstantData (pConstVal, rawData);
1806+ m_pModule ->GetConstantData (pConstVal, rawData);
18091807 addConstantData (VariableDie, rawData.data (), rawData.size ());
18101808 }
18111809 DV.setDIE (VariableDie);
18121810 return ;
18131811 }
18141812
18151813 bool addDecoration = false ;
1816- if (VISAModule ->isDirectElfInput )
1814+ if (m_pModule ->isDirectElfInput )
18171815 {
18181816 if (Loc.HasSurface ())
18191817 {
@@ -1904,7 +1902,7 @@ void CompileUnit::buildLocation(const llvm::Instruction* pDbgInst, DbgVariable&
19041902 {
19051903 // Add description stating whether variable was vectorized in VISA
19061904 addString (VariableDie, dwarf::DW_AT_description, " vectorized" );
1907- uint16_t simdSize = VISAModule ->GetSIMDSize ();
1905+ uint16_t simdSize = m_pModule ->GetSIMDSize ();
19081906 addString (VariableDie, dwarf::DW_AT_description,
19091907 simdSize == 8 ? " simd8" : simdSize == 16 ? " simd16" : " ???" );
19101908 }
@@ -1981,7 +1979,6 @@ void CompileUnit::buildSampler(DbgVariable& var, DIE* die, VISAVariableLocation*
19811979
19821980void CompileUnit::buildSLM (DbgVariable& var, DIE* die, VISAVariableLocation* loc)
19831981{
1984- auto VISAMod = const_cast <VISAModule*>(loc->GetVISAModule ());
19851982 if (loc->IsRegister ())
19861983 {
19871984 DIEBlock* Block = new (DIEValueAllocator)DIEBlock ();
@@ -1990,7 +1987,7 @@ void CompileUnit::buildSLM(DbgVariable& var, DIE* die, VISAVariableLocation* loc
19901987 {
19911988 DbgDecoder::VarInfo varInfo;
19921989 auto regNum = loc->GetRegister ();
1993- VISAMod ->getVarInfo (" V" , regNum, varInfo);
1990+ m_pModule ->getVarInfo (" V" , regNum, varInfo);
19941991
19951992 if (varInfo.lrs .size () == 0 )
19961993 return ;
@@ -2062,8 +2059,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
20622059{
20632060 DbgDecoder::VarInfo varInfo;
20642061 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);
20672063
20682064 if (varInfo.lrs .size () == 0 )
20692065 return ;
@@ -2081,7 +2077,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
20812077 {
20822078 unsigned int subReg = varInfo.lrs .front ().getGRF ().subRegNum ;
20832079 auto offsetInBits = subReg * 8 ;
2084- auto sizeInBits = (VISAMod ->m_pShader ->getGRFSize () * 8 ) - offsetInBits;
2080+ auto sizeInBits = (m_pModule ->m_pShader ->getGRFSize () * 8 ) - offsetInBits;
20852081
20862082 addUInt (Block, dwarf::DW_FORM_data1, dwarf::DW_OP_bit_piece);
20872083 addUInt (Block, dwarf::DW_FORM_udata, sizeInBits);
@@ -2103,7 +2099,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
21032099 }
21042100 else
21052101 {
2106- uint16_t grfSize = (uint16_t )VISAMod ->m_pShader ->getGRFSize ();
2102+ uint16_t grfSize = (uint16_t )m_pModule ->m_pShader ->getGRFSize ();
21072103 uint16_t varSizeInBits = loc->IsInMemory () ? (uint16_t )Asm->GetPointerSize () * 8 : (uint16_t )var.getBasicSize (DD);
21082104 uint16_t varSizeInReg = (uint16_t )(loc->IsInMemory () && varSizeInBits < 32 ) ? 32 : varSizeInBits;
21092105 uint16_t numOfRegs = ((varSizeInReg * (uint16_t )DD->simdWidth ) > (grfSize * 8 )) ?
@@ -2141,7 +2137,7 @@ void CompileUnit::buildGeneral(DbgVariable& var, DIE* die, VISAVariableLocation*
21412137 }
21422138 else
21432139 {
2144- uint16_t grfSize = (uint16_t )VISAMod ->m_pShader ->getGRFSize ();
2140+ uint16_t grfSize = (uint16_t )m_pModule ->m_pShader ->getGRFSize ();
21452141 uint16_t varSizeInBits = loc->IsInMemory () ? (uint16_t )Asm->GetPointerSize () * 8 : (uint16_t )var.getBasicSize (DD);
21462142 uint16_t varSizeInReg = (uint16_t )(loc->IsInMemory () && varSizeInBits < 32 ) ? 32 : varSizeInBits;
21472143 uint16_t numOfRegs = ((varSizeInReg * (uint16_t )DD->simdWidth ) > (grfSize * 8 )) ?
0 commit comments