Skip to content

Commit

Permalink
Fix Joint Matrix mangling for CompositeConstruct
Browse files Browse the repository at this point in the history
Joint Matrix mangling in SPIRV reader did not take into
account return type for CompositeConstruct. It led
to assertion when CompositeConstruct with different
sizes matrices were used from the same compilation module.
  • Loading branch information
YuriPlyakhin authored and igcbot committed Aug 31, 2023
1 parent d4adf45 commit 691e0ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3182,11 +3182,13 @@ SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
std::vector<Type *> ArgTys = { CV[0]->getType() };
std::vector<Value *> Args = { CV[0] };

Type *T = transType( BV->getType() );
auto *ResMatTy = static_cast<SPIRVTypeJointMatrixINTEL *>(BV->getType());
Type *T = transType( ResMatTy );
FunctionType *builtinTy = FunctionType::get( T, ArgTys, false );

auto BI = static_cast<SPIRVInstruction *>( BV );
std::string builtinName( getSPIRVBuiltinName( BV->getOpCode(), BI, ArgTys, "JointMatrixINTEL" ) );
std::string suffix = "JointMatrixINTEL_" + ResMatTy->getMangledName();
std::string builtinName( getSPIRVBuiltinName( BV->getOpCode(), BI, ArgTys, suffix ) );
Function *Func = cast<Function>( M->getOrInsertFunction( builtinName, builtinTy ) );

CallInst *CI = CallInst::Create( Func, Args, "matrix", BB );
Expand Down

0 comments on commit 691e0ef

Please sign in to comment.