Skip to content

Commit 8c3c9dd

Browse files
pratikasharigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 91e5e73
Address review comment.
1 parent e3f8b5f commit 8c3c9dd

File tree

5 files changed

+4
-54
lines changed

5 files changed

+4
-54
lines changed

IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,8 @@ bool PrivateMemoryResolution::resolveAllocaInstructions(bool privateOnStack)
814814

815815
// Construct an empty DebugLoc.
816816
IF_DEBUG_INFO(DebugLoc entryDebugLoc);
817+
// Assign with the function location if available.
818+
IF_DEBUG_INFO_IF(DISubprogram *subprogram = m_currFunction->getSubprogram(), entryDebugLoc = DebugLoc::get(subprogram->getLine(), 0, subprogram););
817819
IF_DEBUG_INFO(entryBuilder.SetCurrentDebugLocation(entryDebugLoc));
818820

819821
if (privateOnStack)
@@ -920,7 +922,7 @@ bool PrivateMemoryResolution::resolveAllocaInstructions(bool privateOnStack)
920922
// correctly. So instead, we set DebugLoc for the instructions generated by lowering
921923
// alloca to mark that they are part of the prologue.
922924
// Note: As per Amjad, later LLVM version has a fix for this in llvm/lib/Transforms/Utils/InlineFunction.cpp.
923-
IF_DEBUG_INFO(builder.SetCurrentDebugLocation(pAI->getDebugLoc()));
925+
IF_DEBUG_INFO(builder.SetCurrentDebugLocation(entryDebugLoc));
924926

925927
// Get buffer information from the analysis
926928
unsigned int scalarBufferOffset = m_ModAllocaInfo->getConstBufferOffset(pAI);

IGC/DebugInfo/DwarfDebug.hpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -634,29 +634,7 @@ namespace IGC
634634

635635
// Store label for each %ip
636636
llvm::DenseMap<unsigned int, llvm::MCSymbol*> LabelsBeforeIp;
637-
638-
// function, inlinedAt
639-
llvm::DenseMap<llvm::DISubprogram*, llvm::SmallPtrSet <llvm::DILocation*, 5>> prologueEnd;
640637
public:
641-
bool prologueEndExists(llvm::DISubprogram* sp, llvm::DILocation* dl, bool add)
642-
{
643-
auto it = prologueEnd.find(sp);
644-
if (it == prologueEnd.end())
645-
{
646-
if (add)
647-
prologueEnd[sp].insert(dl);
648-
return false;
649-
}
650-
651-
if (it->second.find(dl) != it->second.end())
652-
return true;
653-
654-
if (add)
655-
it->second.insert(dl);
656-
657-
return false;
658-
}
659-
660638
bool isStmtExists(unsigned int line, llvm::DILocation* inlinedAt, bool add)
661639
{
662640
auto it = isStmtSet.find(line);

IGC/DebugInfo/VISADebugEmitter.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ IN THE SOFTWARE.
4848
#include "DwarfDebug.hpp"
4949
#include "StreamEmitter.hpp"
5050
#include "VISAModule.hpp"
51-
#include "GenISAIntrinsics/GenIntrinsicInst.h"
5251

5352
#include "Probe/Assertion.h"
5453
#include "secure_mem.h"
@@ -233,8 +232,7 @@ std::vector<char> DebugEmitter::Finalize(bool finalize, DbgDecoder* decodedDbg)
233232
}
234233
}
235234

236-
if (instIt != VISAIndexToInst.end() &&
237-
m_pVISAModule->IsExecutableInst(*instIt->second))
235+
if (instIt != VISAIndexToInst.end())
238236
{
239237
auto loc = instIt->second->getDebugLoc();
240238
if (loc)
@@ -249,12 +247,6 @@ std::vector<char> DebugEmitter::Finalize(bool finalize, DbgDecoder* decodedDbg)
249247
{
250248
Flags |= DWARF2_FLAG_IS_STMT;
251249
}
252-
253-
if (!m_pDwarfDebug->prologueEndExists(loc.get()->getScope()->getSubprogram(),
254-
loc.getInlinedAt(), true))
255-
{
256-
Flags |= DWARF2_FLAG_PROLOGUE_END;
257-
}
258250
m_pStreamEmitter->EmitDwarfLocDirective(src, loc.getLine(), loc.getCol(), Flags, 0, 0, scope->getFilename());
259251

260252
prevSrcLoc = loc;

IGC/DebugInfo/VISAModule.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -239,21 +239,6 @@ const std::string& VISAModule::GetTargetTriple() const
239239
return m_triple;
240240
}
241241

242-
bool VISAModule::IsExecutableInst(const llvm::Instruction& inst)
243-
{
244-
// Return false if inst is dbg info intrinsic or if it is
245-
// catch all intrinsic. In both of these cases, we dont want
246-
// to emit associated debug loc since there is no machine
247-
// code generated for them.
248-
if (IsCatchAllIntrinsic(&inst))
249-
return false;
250-
251-
if (llvm::isa<DbgInfoIntrinsic>(inst))
252-
return false;
253-
254-
return true;
255-
}
256-
257242
void VISAModule::buildDirectElfMaps(const IGC::DbgDecoder& VD)
258243
{
259244
const auto* co = getCompileUnit(VD);
@@ -263,10 +248,6 @@ void VISAModule::buildDirectElfMaps(const IGC::DbgDecoder& VD)
263248
{
264249
const Instruction* pInst = *II;
265250

266-
// store VISA mapping only if pInst generates Gen code
267-
if (!IsExecutableInst(*pInst))
268-
continue;
269-
270251
InstInfoMap::const_iterator itr = m_instInfoMap.find(pInst);
271252
if (itr == m_instInfoMap.end())
272253
continue;

IGC/DebugInfo/VISAModule.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,6 @@ namespace IGC
439439
return false;
440440
}
441441

442-
/// @brief return false if inst is a placeholder instruction
443-
bool IsExecutableInst(const llvm::Instruction& inst);
444-
445442
bool isDirectElfInput = false;
446443
// Store first VISA index->llvm::Instruction mapping
447444
std::map<unsigned int, const llvm::Instruction*> VISAIndexToInst;

0 commit comments

Comments
 (0)