Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,12 +1061,30 @@ LogicalResult spirv::Deserializer::processCooperativeMatrixTypeKHR(
<< operands[2];
}

unsigned rows = getConstantInt(operands[3]).getInt();
unsigned columns = getConstantInt(operands[4]).getInt();
IntegerAttr rowsAttr = getConstantInt(operands[3]);
IntegerAttr columnsAttr = getConstantInt(operands[4]);
IntegerAttr useAttr = getConstantInt(operands[5]);

if (!rowsAttr)
return emitError(unknownLoc, "OpTypeCooperativeMatrixKHR `Rows` references "
"undefined constant <id> ")
<< operands[3];

if (!columnsAttr)
return emitError(unknownLoc, "OpTypeCooperativeMatrixKHR `Columns` "
"references undefined constant <id> ")
<< operands[4];

if (!useAttr)
return emitError(unknownLoc, "OpTypeCooperativeMatrixKHR `Use` references "
"undefined constant <id> ")
<< operands[5];

unsigned rows = rowsAttr.getInt();
unsigned columns = columnsAttr.getInt();

std::optional<spirv::CooperativeMatrixUseKHR> use =
spirv::symbolizeCooperativeMatrixUseKHR(
getConstantInt(operands[5]).getInt());
spirv::symbolizeCooperativeMatrixUseKHR(useAttr.getInt());
if (!use) {
return emitError(
unknownLoc,
Expand Down