Skip to content

Commit 0a81fa8

Browse files
pratikasharigcbot
authored andcommitted
Fix location attribution of join instructions in
VISA debug info. Also fixed a problem where spill/fill intrinsics were not correctly mapped to debug info after lowering them to LSC. Fix location attribution of join instructions in VISA debug info. Join instructions should not be attributed to instruction following them because that would make debugger stop at the join where necessary SIMD lanes havent been enabled. Also fixed a problem where spill/fill intrinsics were not correctly mapped to debug info after lowering them to LSC.
1 parent 26b5307 commit 0a81fa8

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

visa/FlowGraph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3068,7 +3068,7 @@ void FlowGraph::insertJoinToBB(G4_BB* bb, G4_ExecSize execSize, G4_Label* jip)
30683068
{
30693069
// insert join at the end
30703070
G4_INST* jInst = builder->createInternalCFInst(NULL, G4_join, execSize, jip, NULL, InstOpt_NoOpt);
3071-
bb->push_back(jInst);
3071+
bb->push_back(jInst, false);
30723072
}
30733073
else
30743074
{
@@ -3084,7 +3084,7 @@ void FlowGraph::insertJoinToBB(G4_BB* bb, G4_ExecSize execSize, G4_Label* jip)
30843084
else
30853085
{
30863086
G4_INST* jInst = builder->createInternalCFInst(NULL, G4_join, execSize, jip, NULL, InstOpt_NoOpt);
3087-
bb->insertBefore(iter, jInst);
3087+
bb->insertBefore(iter, jInst, false);
30883088
}
30893089
}
30903090
}

visa/G4_BB.hpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,22 @@ class G4_BB
119119
return instList.insert(iter, first, last);
120120
}
121121

122-
INST_LIST_ITER insertBefore(INST_LIST::iterator iter, G4_INST* inst)
122+
INST_LIST_ITER insertBefore(INST_LIST::iterator iter, G4_INST* inst,
123+
bool inheritDI = true)
123124
{
124-
if (iter != instList.end() && !inst->isCISAOffValid())
125+
if (inheritDI &&
126+
iter != instList.end() && !inst->isCISAOffValid())
125127
inst->inheritDIFrom(*iter);
126128
return instList.insert(iter, inst);
127129
}
128130

129-
INST_LIST_ITER insertAfter(INST_LIST::iterator iter, G4_INST* inst)
131+
INST_LIST_ITER insertAfter(INST_LIST::iterator iter, G4_INST* inst,
132+
bool inheritDI = true)
130133
{
131134
auto next = iter;
132135
++next;
133-
if (!inst->isCISAOffValid())
136+
if (inheritDI &&
137+
!inst->isCISAOffValid())
134138
{
135139
// Inheriting from iter seems more reasonable
136140
// since invoking invokeAfter on iter means
@@ -150,8 +154,8 @@ class G4_BB
150154
void clear() { instList.clear(); }
151155
void pop_back() { instList.pop_back(); }
152156
void pop_front() { instList.pop_front(); }
153-
void push_back(G4_INST* inst) {insertBefore(instList.end(), inst);}
154-
void push_front(G4_INST* inst) {insertBefore(instList.begin(), inst);}
157+
void push_back(G4_INST* inst, bool inheritDI = true) {insertBefore(instList.end(), inst, inheritDI);}
158+
void push_front(G4_INST* inst, bool inheritDI = true) {insertBefore(instList.begin(), inst, inheritDI);}
155159

156160
size_t size() const { return instList.size(); }
157161
bool empty() const { return instList.empty(); }

visa/SpillManagerGMRF.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5188,6 +5188,15 @@ void GlobalRA::expandSpillLSC(G4_BB* bb, INST_LIST_ITER& instIt)
51885188
spillOffset += numGRFToWrite * getGRFSize();
51895189
}
51905190

5191+
if (inst->getFP() &&
5192+
kernel.getOption(vISA_GenerateDebugInfo))
5193+
{
5194+
for (auto newInst : builder->instList)
5195+
{
5196+
kernel.getKernelDebugInfo()->updateExpandedIntrinsic(inst->asSpillIntrinsic(), newInst);
5197+
}
5198+
}
5199+
51915200
// Call WA and NoMask WA are mutual exclusive.
51925201
if (getEUFusionCallWAInsts().count(inst) > 0)
51935202
{
@@ -5281,6 +5290,15 @@ void GlobalRA::expandFillLSC(G4_BB* bb, INST_LIST_ITER& instIt)
52815290
fillOffset += responseLength * getGRFSize();
52825291
}
52835292

5293+
if (inst->getFP() &&
5294+
kernel.getOption(vISA_GenerateDebugInfo))
5295+
{
5296+
for (auto newInst : builder->instList)
5297+
{
5298+
kernel.getKernelDebugInfo()->updateExpandedIntrinsic(inst->asFillIntrinsic(), newInst);
5299+
}
5300+
}
5301+
52845302
// Call WA and NoMask WA are mutual exclusive.
52855303
if (getEUFusionCallWAInsts().count(inst) > 0)
52865304
{

0 commit comments

Comments
 (0)