Skip to content

Commit 8145d87

Browse files
MateuszMotylInteligcbot
authored andcommitted
Changes in code.
1 parent cb0e983 commit 8145d87

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

IGC/VectorCompiler/igcdeps/src/TranslationInterface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ static void adjustDumpOptions(vc::CompileOptions &Opts) {
330330
Opts.DumpAsm = true;
331331
Opts.DumpDebugInfo = true;
332332
}
333+
334+
if (IGC_IS_FLAG_ENABLED(PrintInstOffsetInShaderDumpAsm))
335+
Opts.DumpInstOffset = true;
333336
}
334337

335338
static void adjustHashOptions(vc::CompileOptions &Opts,

IGC/VectorCompiler/include/vc/Driver/Driver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ struct CompileOptions {
122122
bool DumpIR = false;
123123
bool DumpAsm = false;
124124
bool DumpDebugInfo = false;
125+
bool DumpInstOffset = false;
125126

126127
bool TimePasses = false;
127128
bool ShowStats = false;

IGC/VectorCompiler/include/vc/Support/BackendConfig.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ struct GenXBackendOptions {
9393
// Whether to enable dumps of kernel debug information
9494
bool EnableDebugInfoDumps = false;
9595
std::string DebugInfoDumpsNameOverride;
96+
// Add instruction offsets as comments in the final assembly
97+
bool EnableInstOffsetDumps = false;
9698

9799
bool ForceArrayPromotion = false;
98100

@@ -314,6 +316,8 @@ struct GenXBackendConfigResult {
314316
return Options.DebugInfoDumpsNameOverride;
315317
}
316318

319+
bool emitInstOffsets() const { return Options.EnableInstOffsetDumps; }
320+
317321
bool isArrayPromotionForced() const { return Options.ForceArrayPromotion; }
318322

319323
bool localizeLiveRangesForAccUsage() const {

IGC/VectorCompiler/lib/Driver/Driver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ static GenXBackendOptions createBackendOptions(const vc::CompileOptions &Opts) {
247247
BackendOpts.EnableAsmDumps = Opts.DumpAsm;
248248
BackendOpts.EnableIsaDumps = Opts.DumpIsa;
249249
BackendOpts.EnableDebugInfoDumps = Opts.DumpDebugInfo;
250+
BackendOpts.EnableInstOffsetDumps = Opts.DumpInstOffset;
250251
BackendOpts.Dumper = Opts.Dumper.get();
251252
BackendOpts.ShaderOverrider = Opts.ShaderOverrider.get();
252253
BackendOpts.DisableStructSplitting = Opts.DisableStructSplitting;

IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5855,6 +5855,9 @@ collectFinalizerArgs(StringSaver &Saver, const GenXSubtarget &ST,
58555855
addArgument("-output");
58565856
addArgument("-binary");
58575857
}
5858+
if (BC.emitInstOffsets())
5859+
addArgument("-printInstOffsetInAsm");
5860+
58585861
if (ST.needsWANoMaskFusedEU() && !DisableNoMaskWA)
58595862
addArgument("-noMaskWA");
58605863

0 commit comments

Comments
 (0)