Skip to content

Commit 669fbb0

Browse files
bcheng0127igcbot
authored andcommitted
_Disable compaction for O0 compilation
Debugger need disable compaction so that it can update the instructions. To do test, add key DumpASMToConsole so that IGC can dump asm code.
1 parent 2d39298 commit 669fbb0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4041,6 +4041,10 @@ namespace IGC
40414041
bool preserveR0 = false;
40424042

40434043
bool isOptDisabled = context->getModuleMetaData()->compOpt.OptDisable;
4044+
if (IGC_IS_FLAG_ENABLED(EnableVISADebug) || isOptDisabled)
4045+
{
4046+
SaveOption(vISA_Compaction, false);
4047+
}
40444048

40454049
// Set up options. This must be done before creating any variable/instructions
40464050
// since some of the options affect IR building.
@@ -4441,6 +4445,10 @@ namespace IGC
44414445
SaveOption(vISA_GenerateISAASM, true);
44424446
SaveOption(vISA_ISAASMToConsole, true);
44434447
}
4448+
if (IGC_IS_FLAG_ENABLED(DumpASMToConsole))
4449+
{
4450+
SaveOption(vISA_asmToConsole, true);
4451+
}
44444452
if (IGC_IS_FLAG_ENABLED(AddExtraIntfInfo))
44454453
{
44464454
SaveOption(vISA_AddExtraIntfInfo, true);

IGC/common/igc_flags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ DECLARE_IGC_REGKEY(bool, EnableVISANoBXMLEncoder, false, "Enable VISA No-B
4040
DECLARE_IGC_REGKEY(bool, EnableIGAEncoder, false, "Enable VISA IGA encoder", false)
4141
DECLARE_IGC_REGKEY(bool, EnableVISADumpCommonISA, false, "Enable VISA Dump Common ISA", true)
4242
DECLARE_IGC_REGKEY(bool, DumpVISAASMToConsole, false, "Dump VISAASM to console and do early exit", true)
43+
DECLARE_IGC_REGKEY(bool, DumpASMToConsole, false, "Dump ASM to console and do early exit", true)
4344
DECLARE_IGC_REGKEY(bool, EnableVISABinary, false, "Enable VISA Binary", true)
4445
DECLARE_IGC_REGKEY(bool, EnableVISAOutput, false, "Enable VISA GenISA output", true)
4546
DECLARE_IGC_REGKEY(bool, EnableVISASlowpath, false, "Enable VISA Slowpath. Needed to dump .visaasm", true)

0 commit comments

Comments
 (0)