Skip to content

Commit df256df

Browse files
petechouigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 502f555
Reland the WA that emits a NOP after branch instruction to support single stepping in debugger. The WA is enabled only when compiling with -O0 currently.
1 parent 13d376f commit df256df

File tree

5 files changed

+0
-55
lines changed

5 files changed

+0
-55
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5105,12 +5105,6 @@ namespace IGC
51055105
if (IGC_IS_FLAG_ENABLED(deadLoopForFloatException)) {
51065106
SaveOption(vISA_AddIEEEExceptionTrap, true);
51075107
}
5108-
5109-
// WA to support single stepping in debugger. Currently only enabled it
5110-
// when compiling with -O0.
5111-
if (isOptDisabled && m_program->m_Platform->WaAddNopAfterBranchInst()) {
5112-
SaveOption(vISA_GenerateNopAfterCFInst, true);
5113-
}
51145108
} // InitVISABuilderOptions
51155109

51165110
// Get a unqiue label for inline asm instruction blocks at the module level.

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,18 +1494,5 @@ unsigned int roundUpTgsmSize(DWORD size) const
14941494
return iSTD::RoundPower2(size) * blockSize;
14951495
}
14961496

1497-
bool WaAddNopAfterBranchInst() const
1498-
{
1499-
if (m_platformInfo.eProductFamily == IGFX_PVC)
1500-
return true;
1501-
1502-
if (m_platformInfo.eProductFamily == IGFX_DG2 &&
1503-
(GFX_IS_DG2_G11_CONFIG(m_platformInfo.usDeviceID) ||
1504-
GFX_IS_DG2_G12_CONFIG(m_platformInfo.usDeviceID)))
1505-
return true;
1506-
1507-
return false;
1508-
}
1509-
15101497
};
15111498
}//namespace IGC

visa/Optimizer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ class Optimizer {
260260
void applyNamedBarrierWA(INST_LIST_ITER it, G4_BB *bb);
261261
void insertIEEEExceptionTrap();
262262
void expandIEEEExceptionTrap(INST_LIST_ITER it, G4_BB *bb);
263-
void insertNopAfterCFInst(BB_LIST_ITER ib, INST_LIST_ITER it);
264263

265264
typedef std::vector<vISA::G4_INST *> InstListType;
266265
// create instruction sequence to calculate call offset from ip

visa/SWWA.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3337,36 +3337,6 @@ void Optimizer::expandIEEEExceptionTrap(INST_LIST_ITER it, G4_BB *bb) {
33373337
*it = restoreFlag;
33383338
}
33393339

3340-
void Optimizer::insertNopAfterCFInst(BB_LIST_ITER ib, INST_LIST_ITER ii) {
3341-
// If the CF inst is not the last inst of current BB, simply insert
3342-
// a nop after it. Otherwise, insert a dummy BB to hold a nop between
3343-
// the current BB and the fall-through BB.
3344-
G4_BB *bb = *ib;
3345-
G4_INST *inst = *ii;
3346-
if (inst != bb->back()) {
3347-
bb->insertAfter(ii, builder.createNop(InstOpt_NoOpt));
3348-
} else {
3349-
G4_BB *dummyBB = fg.createNewBBWithLabel("CFInstWA_BB");
3350-
dummyBB->push_back(builder.createNop(InstOpt_NoOpt));
3351-
BB_LIST_ITER nextBI = std::next(ib);
3352-
fg.insert(nextBI, dummyBB);
3353-
// Update the pred/succ edges accordingly.
3354-
bb->setPhysicalSucc(dummyBB);
3355-
dummyBB->setPhysicalPred(bb);
3356-
if (nextBI != fg.end()) {
3357-
G4_BB *nextBB = *nextBI;
3358-
dummyBB->setPhysicalSucc(nextBB);
3359-
nextBB->setPhysicalPred(dummyBB);
3360-
if (std::any_of(bb->Succs.begin(), bb->Succs.end(),
3361-
[=](G4_BB *succ) { return succ == nextBB; } )) {
3362-
fg.removePredSuccEdges(bb, nextBB);
3363-
fg.addPredSuccEdges(bb, dummyBB);
3364-
fg.addPredSuccEdges(dummyBB, nextBB);
3365-
}
3366-
}
3367-
}
3368-
}
3369-
33703340
// For a subroutine, insert a dummy move with {Switch} option immediately
33713341
// before the first non-label instruction in BB. Otherwie, for a following
33723342
// basic block, insert a dummy move before *any* instruction to ensure that
@@ -3797,9 +3767,6 @@ void Optimizer::HWWorkaround() {
37973767
if (inst->isIEEEExceptionTrap())
37983768
expandIEEEExceptionTrap(ii, bb);
37993769

3800-
if (inst->isCFInst() && builder.getOption(vISA_GenerateNopAfterCFInst))
3801-
insertNopAfterCFInst(ib, ii);
3802-
38033770
ii++;
38043771
}
38053772
}

visa/include/VISAOptionsDefs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,6 @@ DEF_VISA_OPTION(vISA_noIndirectSrcForCompressedInstWA, ET_BOOL,
641641
DEF_VISA_OPTION(vISA_GenerateDebugInfo, ET_BOOL, "-generateDebugInfo", UNUSED,
642642
false)
643643
DEF_VISA_OPTION(vISA_setStartBreakPoint, ET_BOOL, "-setstartbp", UNUSED, false)
644-
DEF_VISA_OPTION(vISA_GenerateNopAfterCFInst, ET_BOOL,
645-
"-generateNopAfterCFInst", UNUSED, false)
646644
DEF_VISA_OPTION(vISA_InsertHashMovs, ET_BOOL, NULLSTR, UNUSED, false)
647645
DEF_VISA_OPTION(vISA_InsertDummyMovForHWRSWA, ET_BOOL, "-insertRSDummyMov",
648646
UNUSED, false)

0 commit comments

Comments
 (0)