Skip to content

Commit 1a1f79d

Browse files
mmereckiigcbot
authored andcommitted
Skip generation of mov instructions for undef PHI sources
There is no need to create the mov instructions for `undef` PHI sources.
1 parent c654498 commit 1a1f79d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,8 @@ void EmitPass::MovPhiSources(llvm::BasicBlock *aBB) {
13831383
if (isa<UndefValue>(Src)) {
13841384
if (IGC_IS_FLAG_ENABLED(AssignZeroToUndefPhiNodes)) {
13851385
Src = Constant::getNullValue(Src->getType());
1386+
} else if (IGC_IS_FLAG_ENABLED(DisableMovOfUndefPhiSources)) {
1387+
continue;
13861388
}
13871389
}
13881390

IGC/common/igc_flags.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,8 @@ DECLARE_IGC_REGKEY(DWORD, MinimumValidAddress, 0,
927927
true)
928928
DECLARE_IGC_REGKEY(bool, AssignZeroToUndefPhiNodes, false,
929929
"Assigns a null value to such a phi node which has an undefined value during emitting vISA", false)
930+
DECLARE_IGC_REGKEY(bool, DisableMovOfUndefPhiSources, true, "Do not emit VISA mov instructions for undef PHI sources",
931+
false)
930932
DECLARE_IGC_REGKEY_ENUM(InjectPrintfFlag, 0, "Inject printf debugging flag", INJECT_PRINTF_OPTIONS, true)
931933
DECLARE_IGC_REGKEY(DWORD, AdHoc, 0,
932934
"Unassigned debug key that can be used for experiments. Do not commit usages of this regkey", false)

0 commit comments

Comments
 (0)