Skip to content

Commit 4dd81d4

Browse files
aparshin-inteligcbot
authored andcommitted
VC should produce debuggable kernels by default
This commit enables compilation of kernels that are suitable for HW debug by default. BTI index zero is considered reserved (for SIP surface access by the debugger). Note, that to do a proper debug session one still has to either inject breakpoint bits to the first instruction of a kernel (This is enabled by "-g" currently) or to somehow postpone kernel execution by other means (by passing extra parameters to runtime or DCD).
1 parent d52c3f9 commit 4dd81d4

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

IGC/Options/include/igc/Options/VCInternalOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ def stats_file : PlainSeparate<"stats-file">,
5656
def : PlainJoined<"stats-file=">, Alias<stats_file>,
5757
HelpText<"Alias for -stats-file">;
5858

59+
def fdisable_debuggable_kernels : PlainFlag<"vc-disable-debuggable-kernels">,
60+
HelpText<"Disable emission of debuggable kernels for legacy path">;
61+
5962
def gpu_scope_fence : PlainFlag<"gpu-scope-fence-on-single-tile">,
6063
HelpText<"Allow the use of \"GPU\" fence scope on single-tile GPUs">;
6164
def flush_l3_for_global : PlainFlag<"flush-l3-for-global">,

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ struct CompileOptions {
7373
bool NoVecDecomp = false;
7474
// -g
7575
bool ExtendedDebuggingSupport = false;
76-
// emit kernels that can interact with debugger
77-
bool EmitDebuggableKernels = false;
76+
// emit kernels that can interact with debugger, can be disabled by
77+
// -vc-disable-debuggable-kernels internal option
78+
bool EmitDebuggableKernels = true;
7879
// -fno-jump-tables
7980
bool NoJumpTables = false;
8081
// -ftranslate-legacy-memory-intrinsics

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void initializeGenXBackendConfigPass(PassRegistry &PR);
5050
// configuration. Some values are default-initialized from cl options.
5151
struct GenXBackendOptions {
5252
// EmitDebuggable Kernels (allocate SIP Surface)
53-
bool DebuggabilityEmitDebuggableKernels = false;
53+
bool DebuggabilityEmitDebuggableKernels = true;
5454
// Legacy path requires kernel to reserve BTI=0
5555
bool DebuggabilityForLegacyPath = false;
5656
// Emit breakpoints at the start of each kernel

IGC/VectorCompiler/lib/Driver/Driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,8 @@ static Error fillApiOptions(const opt::ArgList &ApiOptions,
619619

620620
if (ApiOptions.hasArg(OPT_no_vector_decomposition))
621621
Opts.NoVecDecomp = true;
622-
if (ApiOptions.hasArg(OPT_emit_debug)) {
622+
if (ApiOptions.hasArg(OPT_emit_debug))
623623
Opts.ExtendedDebuggingSupport = true;
624-
Opts.EmitDebuggableKernels = true;
625-
}
626624
if (ApiOptions.hasArg(OPT_vc_fno_struct_splitting))
627625
Opts.DisableStructSplitting = true;
628626
if (ApiOptions.hasArg(OPT_vc_fno_jump_tables))
@@ -701,6 +699,8 @@ static Error fillInternalOptions(const opt::ArgList &InternalOptions,
701699
Opts.UseBindlessBuffers = true;
702700
if (InternalOptions.hasArg(OPT_emit_zebin_visa_sections))
703701
Opts.EmitZebinVisaSections = true;
702+
if (InternalOptions.hasArg(OPT_fdisable_debuggable_kernels))
703+
Opts.EmitDebuggableKernels = false;
704704

705705
if (opt::Arg *A = InternalOptions.getLastArg(OPT_binary_format)) {
706706
StringRef Val = A->getValue();

0 commit comments

Comments
 (0)