Skip to content

Commit d4965c8

Browse files
pratikashargfxbot
authored andcommitted
Add reg key EnableOneStepElf. Fix a bug
where some Gen offsets were missing in debug_ranges section. Change-Id: I17daa9d265d9b2218a195d50153d1924a03060ba
1 parent c9e6e77 commit d4965c8

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

IGC/Compiler/DebugInfo/VISAModule.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,16 @@ std::vector<std::pair<unsigned int, unsigned int>> VISAModule::getGenISARange(co
768768
std::vector<std::pair<unsigned int, unsigned int>> GenISARange;
769769
bool endNextInst = false;
770770

771+
auto getNextInst = [](const llvm::Instruction* start)
772+
{
773+
// Return consecutive instruction in llvm IR.
774+
// Iterate to next BB if required.
775+
if (start->getNextNode())
776+
return start->getNextNode();
777+
else
778+
return &(start->getParent()->getNextNode()->front());
779+
};
780+
771781
while (1)
772782
{
773783
if (!start || !end || endNextInst)
@@ -780,7 +790,7 @@ std::vector<std::pair<unsigned int, unsigned int>> VISAModule::getGenISARange(co
780790
InstInfoMap::const_iterator itr = m_instInfoMap.find(start);
781791
if (itr == m_instInfoMap.end())
782792
{
783-
start = start->getNextNode();
793+
start = getNextInst(start);
784794
continue;
785795
}
786796
auto startVISAOffset = itr->second.m_offset;
@@ -815,7 +825,7 @@ std::vector<std::pair<unsigned int, unsigned int>> VISAModule::getGenISARange(co
815825
}
816826
}
817827

818-
start = start->getNextNode();
828+
start = getNextInst(start);
819829
}
820830

821831
class Comp

IGC/Compiler/DebugInfo/VISAModule.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ class VISAModule
332332
{
333333
auto n = new VISAModule(s);
334334

335-
if (n->m_pShader->GetContext()->m_DriverInfo.SupportElfFormat())
335+
if (n->m_pShader->GetContext()->m_DriverInfo.SupportElfFormat() ||
336+
IGC_GET_FLAG_VALUE(EnableOneStepElf))
336337
{
337338
n->isDirectElfInput = true;
338339
}

IGC/common/igc_flags.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ DECLARE_IGC_REGKEY(bool, ForceSubroutineForEmulation, false, "Force subroutin
310310
DECLARE_IGC_REGKEY(int, ByPassAllocaSizeHeuristic, 0, "Force some Alloca to pass the pressure heuristic until the given size")
311311
DECLARE_IGC_REGKEY(DWORD, MemOptWindowSize, 150, "Change the size of the window in which we allow load/stores to be coalesced. We keep it limited in order to avoid creating long liveranges. Default value is 150")
312312
DECLARE_IGC_REGKEY(bool, ForceNoFP64bRegioning, false, "force regioning rules for FP and 64b FPU instructions")
313+
DECLARE_IGC_REGKEY(bool, EnableOneStepElf, false, "Enable generation of direct elf mapping src->Gen ISA")
313314

314315
DECLARE_IGC_GROUP("Generating precompiled headers")
315316
DECLARE_IGC_REGKEY(bool, ApplyConservativeRastWAHeader, true,

0 commit comments

Comments
 (0)