Skip to content

Commit 347f63b

Browse files
jfuentesigcbot
authored andcommitted
Create new HW Debug pass to unify various functions
1 parent 0e101ff commit 347f63b

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

IGC/common/igc_flags.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ DECLARE_IGC_REGKEY(DWORD, GEPLSRNewInstructionThreshold, 32, "Threshold for max
286286
DECLARE_IGC_REGKEY(bool, EnableGEPLSRToPreheader, true, "Enables reduction to loop's preheader in GEP Loop Strength Reduction pass", false)
287287

288288
DECLARE_IGC_GROUP("Shader debugging")
289-
DECLARE_IGC_REGKEY(bool, CopyA0ToDBG0, false, " Copy a0 used for extended msg descriptor to dbg0 to help debug", false)
290-
DECLARE_IGC_REGKEY(bool, EnableDebugging, false, " Enable shader debugging for release internal", false)
289+
DECLARE_IGC_REGKEY(bool, CopyA0ToDBG0, false, " Copy a0 used for extended msg descriptor to dbg0 to help debug", false)
290+
DECLARE_IGC_REGKEY(bool, EnableDebugging, false, " Enable shader debugging for release internal", false)
291291
DECLARE_IGC_REGKEY_BITMASK(GenerateOptionsFile, 0, "Create Options.txt(usually for SIMD related bugs to narrow down shaders), in the shader dump folder.", SHADER_TYPE_MASKS, false)
292292
DECLARE_IGC_REGKEY(bool, ForceDisableShaderDebugHashCodeInKernel, false, "Disable hash code addition to the binary after EOT", false)
293293
DECLARE_IGC_REGKEY(bool, EnableHashMovsAtPrologue, false, "Rather than after EOT, insert hash code movs at shader entry", false)

visa/Optimizer.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@ void Optimizer::addSWSBInfo() {
338338
return;
339339
}
340340

341+
// Common pass for HW debug functions
342+
void Optimizer::HWDebug() {
343+
if (builder.getOption(vISA_InsertHashMovs))
344+
insertHashMovs();
345+
}
346+
341347
void Optimizer::insertHashMovs() {
342348
// As per request from IGC team, we want to conditionally insert
343349
// two mov instructions like following:
@@ -671,7 +677,7 @@ void Optimizer::initOptimizations() {
671677
OPT_INITIALIZE_PASS(localSchedule, vISA_LocalScheduling, TimerID::SCHEDULING);
672678
OPT_INITIALIZE_PASS(HWWorkaround, vISA_EnableAlways, TimerID::MISC_OPTS);
673679
OPT_INITIALIZE_PASS(fixEndIfWhileLabels, vISA_EnableAlways, TimerID::NUM_TIMERS);
674-
OPT_INITIALIZE_PASS(insertHashMovs, vISA_InsertHashMovs, TimerID::NUM_TIMERS);
680+
OPT_INITIALIZE_PASS(HWDebug, vISA_EnableAlways, TimerID::NUM_TIMERS);
675681
OPT_INITIALIZE_PASS(insertDummyMovForHWRSWA, vISA_InsertDummyMovForHWRSWA,
676682
TimerID::NUM_TIMERS);
677683
OPT_INITIALIZE_PASS(insertDummyCompactInst, vISA_InsertDummyCompactInst,
@@ -993,7 +999,7 @@ int Optimizer::optimization() {
993999
// the CFG assumption
9941000
runPass(PI_fixEndIfWhileLabels);
9951001

996-
runPass(PI_insertHashMovs);
1002+
runPass(PI_HWDebug);
9971003

9981004
runPass(PI_insertDummyMovForHWRSWA);
9991005

visa/Optimizer.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ class Optimizer {
134134
void dumpPayload();
135135
void collectStats();
136136
void createR0Copy();
137-
138137
void fixEndIfWhileLabels();
139138
void mergeScalarInst();
140139
void EmulateInt64Add() { ::EmulateInt64Add(builder, kernel); }
@@ -189,6 +188,8 @@ class Optimizer {
189188

190189
void accSubBeforeRA();
191190

191+
void HWDebug();
192+
192193

193194
// return true if BuiltInR0 gets a different allocation than r0
194195
bool R0CopyNeeded();
@@ -362,7 +363,7 @@ class Optimizer {
362363
PI_localSchedule,
363364
PI_HWWorkaround, // always
364365
PI_fixEndIfWhileLabels, // always
365-
PI_insertHashMovs,
366+
PI_HWDebug,
366367
PI_insertDummyMovForHWRSWA,
367368
PI_insertDummyCompactInst,
368369
PI_mergeScalarInst,

0 commit comments

Comments
 (0)