From 691e0ef8e312bb9863d9186f97ea7126a3b87256 Mon Sep 17 00:00:00 2001 From: Yury Plyakhin Date: Thu, 31 Aug 2023 00:36:32 +0000 Subject: [PATCH] Fix Joint Matrix mangling for CompositeConstruct 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. --- IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp index 92c701a73131..e78dd21e92a3 100644 --- a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp +++ b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp @@ -3182,11 +3182,13 @@ SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F, std::vector ArgTys = { CV[0]->getType() }; std::vector Args = { CV[0] }; - Type *T = transType( BV->getType() ); + auto *ResMatTy = static_cast(BV->getType()); + Type *T = transType( ResMatTy ); FunctionType *builtinTy = FunctionType::get( T, ArgTys, false ); auto BI = static_cast( 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( M->getOrInsertFunction( builtinName, builtinTy ) ); CallInst *CI = CallInst::Create( Func, Args, "matrix", BB );