Skip to content

Commit 4f153ac

Browse files
aparshin-inteligcbot
authored andcommitted
fixup erroneous assertion in epilogue generation
---------------------------
1 parent 69f0d9b commit 4f153ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXPrologEpilogInsertion.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,9 @@ void GenXPrologEpilogInsertion::generateFunctionEpilog(Function &F,
399399
}
400400
RetSize = DL->getTypeSizeInBits(RetVal->getType()) / genx::ByteBits;
401401
std::vector<Value *> Worklist;
402+
bool UndefReturn = false;
402403
if (isa<StructType>(RetVal->getType())) {
404+
UndefReturn = isa<UndefValue>(RetVal);
403405
while (auto *InsValue = dyn_cast<InsertValueInst>(RetVal)) {
404406
RetVal = InsValue->getOperand(0);
405407
if (InsValue->getOperand(1)->getType()->getScalarType()->isIntegerTy(1))
@@ -408,7 +410,7 @@ void GenXPrologEpilogInsertion::generateFunctionEpilog(Function &F,
408410
}
409411
} else
410412
Worklist.push_back(RetVal);
411-
IGC_ASSERT(!Worklist.empty());
413+
IGC_ASSERT(UndefReturn || !Worklist.empty());
412414
for (auto *Ins : Worklist) {
413415
Instruction *InstToReplaceIn = &I;
414416
unsigned Offset = 0;

0 commit comments

Comments
 (0)