Skip to content

Commit 822a082

Browse files
krystian-andrzejewskiigcbot
authored andcommitted
Assigning null values for undef phi nodes
This change is to give an option to assigns a null value to such a phi node which has an undefined value during emitting vISA.
1 parent 118d136 commit 822a082

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,14 @@ void EmitPass::MovPhiSources(llvm::BasicBlock* aBB)
15991599

16001600
if (isa<UndefValue>(Src))
16011601
{
1602-
continue;
1602+
if (IGC_IS_FLAG_ENABLED(AssignZeroToUndefPhiNodes))
1603+
{
1604+
Src = Constant::getNullValue(Src->getType());
1605+
}
1606+
else
1607+
{
1608+
continue;
1609+
}
16031610
}
16041611

16051612
Value* dstRootV = m_deSSA ? m_deSSA->getRootValue(PN) : PN;

IGC/common/igc_flags.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ DECLARE_IGC_REGKEY(bool, UseVMaskPredicateForLoads, true, "Use VMask as predicat
468468
DECLARE_IGC_REGKEY(bool, UseVMaskPredicateForIndirectMove, true, "Use VMask as predicate for subspan usage (indirect mov only)", true)
469469
DECLARE_IGC_REGKEY(bool, StackOverflowDetection, false, "Inserts checks for stack overflow when stack calls are used.", true)
470470
DECLARE_IGC_REGKEY(bool, BufferBoundsChecking, false, "Setting this to 1 (true) enables buffer bounds checking", false)
471-
DECLARE_IGC_REGKEY(DWORD, MinimumValidAddress, 0, "If it's greater than 0, it enables minimal valid address checking where the threshold is the given value (in hex).", false)
471+
DECLARE_IGC_REGKEY(DWORD, MinimumValidAddress, 0, "If it's greater than 0, it enables minimal valid address checking where the threshold is the given value (in hex).", false)
472+
DECLARE_IGC_REGKEY(bool, AssignZeroToUndefPhiNodes, false, "Assigns a null value to such a phi node which has an undefined value during emitting vISA", false)
472473

473474
DECLARE_IGC_GROUP("IGC Features")
474475
DECLARE_IGC_REGKEY(bool, EnableOCLSIMD16, true, "Enable OCL SIMD16 mode", true)

0 commit comments

Comments
 (0)