Skip to content

Commit 003fc88

Browse files
MaciejGrudziazigcbot
authored andcommitted
Proper handling of null input on dpas intrinsic
Fix the handling of the null input argument of the dpas intrinsic
1 parent 911755f commit 003fc88

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7503,23 +7503,25 @@ namespace IGC
75037503

75047504
CVariable* input0 = nullptr;
75057505
CVariable* input1 = nullptr;
7506-
uint16_t newNumElemsSrc0 = (uint16_t)(visaNumLanes(toExecSize) * repeatCount);
7507-
IGC_ASSERT(newNumElemsSrc0 <= input->GetNumberElement());
7508-
input0 = m_program->GetNewVariable(
7509-
newNumElemsSrc0,
7510-
input->GetType(),
7511-
input->GetAlign(),
7512-
input->IsUniform(),
7513-
CName::NONE);
7514-
input1 = m_program->GetNewVariable(
7515-
newNumElemsSrc0,
7516-
input->GetType(),
7517-
input->GetAlign(),
7518-
input->IsUniform(),
7519-
CName::NONE);
7520-
// Starting offset is calculated from AliasOffset only (subVar not used).
7521-
uint32_t srcOfstBytesSrc0 = input->GetAliasOffset();
7522-
SplitPayloadToLowerSIMD(input, srcOfstBytesSrc0, repeatCount, input0, input1, visaNumLanes(fromExecSize));
7506+
if(input) {
7507+
uint16_t newNumElemsSrc0 = (uint16_t)(visaNumLanes(toExecSize) * repeatCount);
7508+
IGC_ASSERT(newNumElemsSrc0 <= input->GetNumberElement());
7509+
input0 = m_program->GetNewVariable(
7510+
newNumElemsSrc0,
7511+
input->GetType(),
7512+
input->GetAlign(),
7513+
input->IsUniform(),
7514+
CName::NONE);
7515+
input1 = m_program->GetNewVariable(
7516+
newNumElemsSrc0,
7517+
input->GetType(),
7518+
input->GetAlign(),
7519+
input->IsUniform(),
7520+
CName::NONE);
7521+
// Starting offset is calculated from AliasOffset only (subVar not used).
7522+
uint32_t srcOfstBytesSrc0 = input->GetAliasOffset();
7523+
SplitPayloadToLowerSIMD(input, srcOfstBytesSrc0, repeatCount, input0, input1, visaNumLanes(fromExecSize));
7524+
}
75237525

75247526
CVariable* dst0 = input0, * dst1 = input1;
75257527
if (dst != input)

0 commit comments

Comments
 (0)