Skip to content

Commit 373a3b6

Browse files
pratikasharsys_zuul
authored andcommitted
[Autobackout][FuncReg]Revert of change: 0a08292
Initial support for stackcall in debug info. Change-Id: Ieee0ea5916babd0b11fa269d37b99625e25338a2
1 parent bfa9646 commit 373a3b6

16 files changed

+77
-631
lines changed

IGC/Compiler/CISACodeGen/DebugInfo.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,6 @@ bool DebugInfoPass::runOnModule(llvm::Module& M)
143143
return p1.first < p2.first;
144144
});
145145

146-
for (auto& m : sortedVISAModules)
147-
{
148-
m_pDebugEmitter->AddVISAModFunc(m.second.second, m.second.first);
149-
}
150-
151146
for (auto& m : sortedVISAModules)
152147
{
153148
isOneStepElf |= m.second.second->isDirectElfInput;

IGC/Compiler/DebugInfo/DwarfCompileUnit.cpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ using namespace ::IGC;
6666

6767
/// CompileUnit - Compile unit constructor.
6868
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),
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.
222222
void 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

17871787
void 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

19821980
void 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)) ?

IGC/Compiler/DebugInfo/DwarfCompileUnit.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ namespace IGC
8080

8181
/// Asm - Target of Dwarf emission.
8282
StreamEmitter* Asm;
83+
/// m_pModule - VISA processed module
84+
VISAModule* m_pModule;
8385

8486
// Holders for some common dwarf information.
8587
IGC::DwarfDebug* DD;
@@ -114,7 +116,7 @@ namespace IGC
114116

115117
public:
116118
CompileUnit(unsigned UID, DIE* D, llvm::DICompileUnit* CU,
117-
StreamEmitter* A, IGC::DwarfDebug* DW);
119+
StreamEmitter* A, VISAModule* M, IGC::DwarfDebug* DW);
118120
~CompileUnit();
119121

120122
// Accessors.

0 commit comments

Comments
 (0)