Skip to content

Commit 5162e70

Browse files
iwwuigcbot
authored andcommitted
Enhance checking on UseVMaskPredicate feature
Execute createVMaskPred and UseVMaskPred for patchable PS only
1 parent 115eb70 commit 5162e70

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4704,11 +4704,17 @@ void EmitPass::emitOutput(llvm::GenIntrinsicInst* inst)
47044704

47054705
void EmitPass::createVMaskPred(CVariable*& predicate)
47064706
{
4707+
if (!m_currShader->IsPatchablePS())
4708+
return;
4709+
4710+
if (predicate != nullptr)
4711+
return;
4712+
47074713
uint32_t debug = IGC_GET_FLAG_VALUE(VMaskPredDebug);
47084714
if (debug < 1)
47094715
return;
47104716

4711-
if (IGC_IS_FLAG_ENABLED(UseVMaskPredicate) && (predicate == nullptr))
4717+
if (IGC_IS_FLAG_ENABLED(UseVMaskPredicate))
47124718
{
47134719
// Copy VMASK to a predicate
47144720
// (W) mov (1|M0) f0.0<1>:ud sr0.3<0;1,0>:ud
@@ -4727,13 +4733,18 @@ void EmitPass::createVMaskPred(CVariable*& predicate)
47274733

47284734
void EmitPass::UseVMaskPred()
47294735
{
4736+
if (!m_currShader->IsPatchablePS())
4737+
return;
4738+
4739+
if (!m_vMaskPredForSubplane)
4740+
return;
4741+
47304742
uint32_t debug = IGC_GET_FLAG_VALUE(VMaskPredDebug);
47314743
if (debug < 2)
47324744
return;
47334745

47344746
bool subspan = m_encoder->IsSubSpanDestination();
4735-
if (IGC_IS_FLAG_ENABLED(UseVMaskPredicate) && m_vMaskPredForSubplane &&
4736-
subspan && !m_destination->IsUniform())
4747+
if (IGC_IS_FLAG_ENABLED(UseVMaskPredicate) && subspan && !m_destination->IsUniform())
47374748
{
47384749
m_encoder->SetPredicate(m_vMaskPredForSubplane);
47394750
}

0 commit comments

Comments
 (0)