Commit 67f22b3a authored by pratik ashar's avatar pratik ashar Committed by gbsbuild

Fix issue of missing line numbers for some instructions. This was traced

to line numbers not being emitted for phi instructions generating
constants

Change-Id: I9c3f3f1192bfba3602a0f7cae74c7a8696adc487
parent deeb9ee2
......@@ -531,18 +531,17 @@ bool EmitPass::runOnFunction(llvm::Function &F)
if (I != E)
{
auto llvmInst = (*I).m_root;
IF_DEBUG_INFO_IF(m_pDebugEmitter, m_pDebugEmitter->BeginInstruction(llvmInst);)
// before inserting the terminator, initialize constant pool & insert the de-ssa moves
if (isa<BranchInst>((*I).m_root))
{
m_encoder->SetSecondHalf(false);
// insert constant initializations.
IF_DEBUG_INFO_IF(m_pDebugEmitter, m_pDebugEmitter->BeginEncodingMark();)
InitConstant(block.bb);
IF_DEBUG_INFO_IF(m_pDebugEmitter, m_pDebugEmitter->EndEncodingMark();)
// insert the de-ssa movs.
IF_DEBUG_INFO_IF(m_pDebugEmitter, m_pDebugEmitter->BeginEncodingMark();)
MovPhiSources(block.bb);
IF_DEBUG_INFO_IF(m_pDebugEmitter, m_pDebugEmitter->EndEncodingMark();)
}
// If slicing happens, then recalculate the number of instances.
......@@ -560,21 +559,18 @@ bool EmitPass::runOnFunction(llvm::Function &F)
if (numInstance < 2)
{
m_encoder->SetSecondHalf(false);
IF_DEBUG_INFO_IF(m_pDebugEmitter, m_pDebugEmitter->BeginInstruction((*I).m_root);)
(*I).m_pattern->Emit(this, init);
IF_DEBUG_INFO_IF(m_pDebugEmitter, m_pDebugEmitter->EndInstruction((*I).m_root);)
++I;
}
else
{
IF_DEBUG_INFO_IF(m_pDebugEmitter, m_pDebugEmitter->BeginInstruction((*I).m_root);)
m_encoder->SetSecondHalf(false);
(*I).m_pattern->Emit(this, init);
m_encoder->SetSecondHalf(true);
(*I).m_pattern->Emit(this, init);
IF_DEBUG_INFO_IF(m_pDebugEmitter, m_pDebugEmitter->EndInstruction((*I).m_root);)
++I;
}
IF_DEBUG_INFO_IF(m_pDebugEmitter, m_pDebugEmitter->EndInstruction(llvmInst);)
}
}
if (llvmtoVISADump)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment