Lines Matching refs:operands

73   ArrayRef<uint32_t> operands;  in deserialize()  local
78 if (failed(sliceInstruction(opcode, operands))) in deserialize()
81 if (failed(processInstruction(opcode, operands))) in deserialize()
156 spirv::Deserializer::processCapability(ArrayRef<uint32_t> operands) { in processCapability() argument
157 if (operands.size() != 1) in processCapability()
160 auto cap = spirv::symbolizeCapability(operands[0]); in processCapability()
162 return emitError(unknownLoc, "unknown capability: ") << operands[0]; in processCapability()
213 spirv::Deserializer::processMemoryModel(ArrayRef<uint32_t> operands) { in processMemoryModel() argument
214 if (operands.size() != 2) in processMemoryModel()
219 opBuilder.getI32IntegerAttr(llvm::bit_cast<int32_t>(operands.front()))); in processMemoryModel()
222 opBuilder.getI32IntegerAttr(llvm::bit_cast<int32_t>(operands.back()))); in processMemoryModel()
339 spirv::Deserializer::processFunction(ArrayRef<uint32_t> operands) { in processFunction() argument
345 if (operands.size() != 4) { in processFunction()
348 Type resultType = getType(operands[0]); in processFunction()
351 << operands[0]; in processFunction()
354 uint32_t fnID = operands[1]; in processFunction()
359 auto fnControl = spirv::symbolizeFunctionControl(operands[2]); in processFunction()
361 return emitError(unknownLoc, "unknown Function Control: ") << operands[2]; in processFunction()
364 Type fnType = getType(operands[3]); in processFunction()
367 << operands[3]; in processFunction()
398 ArrayRef<uint32_t> operands; in processFunction() local
399 if (failed(sliceInstruction(opcode, operands, in processFunction()
409 if (operands.size() != 2) { in processFunction()
414 auto argDefinedType = getType(operands[0]); in processFunction()
422 if (getValue(operands[1])) { in processFunction()
424 << operands[1]; in processFunction()
427 valueMap[operands[1]] = argValue; in processFunction()
478 spirv::Deserializer::processFunctionEnd(ArrayRef<uint32_t> operands) { in processFunctionEnd() argument
480 if (!operands.empty()) { in processFunctionEnd()
548 spirv::Deserializer::processGlobalVariable(ArrayRef<uint32_t> operands) { in processGlobalVariable() argument
550 if (operands.size() < 3) { in processGlobalVariable()
557 auto type = getType(operands[wordIndex]); in processGlobalVariable()
560 << operands[wordIndex]; in processGlobalVariable()
571 auto variableID = operands[wordIndex]; in processGlobalVariable()
579 auto storageClass = static_cast<spirv::StorageClass>(operands[wordIndex]); in processGlobalVariable()
589 if (wordIndex < operands.size()) { in processGlobalVariable()
590 auto initializerOp = getGlobalVariable(operands[wordIndex]); in processGlobalVariable()
593 << operands[wordIndex] << "used as initializer"; in processGlobalVariable()
598 if (wordIndex != operands.size()) { in processGlobalVariable()
602 << wordIndex << " of " << operands.size() << " processed"; in processGlobalVariable()
626 LogicalResult spirv::Deserializer::processName(ArrayRef<uint32_t> operands) { in processName() argument
627 if (operands.size() < 2) { in processName()
630 if (!nameMap.lookup(operands[0]).empty()) { in processName()
632 << operands[0]; in processName()
635 StringRef name = decodeStringLiteral(operands, wordIndex); in processName()
636 if (wordIndex != operands.size()) { in processName()
640 nameMap[operands[0]] = name; in processName()
649 ArrayRef<uint32_t> operands) { in processType() argument
650 if (operands.empty()) { in processType()
657 if (typeMap.count(operands[0])) { in processType()
659 << operands[0]; in processType()
664 if (operands.size() != 1) in processType()
666 typeMap[operands[0]] = opBuilder.getNoneType(); in processType()
669 if (operands.size() != 1) in processType()
671 typeMap[operands[0]] = opBuilder.getI1Type(); in processType()
674 if (operands.size() != 3) in processType()
685 auto sign = operands[2] == 1 ? IntegerType::SignednessSemantics::Signed in processType()
687 typeMap[operands[0]] = IntegerType::get(context, operands[1], sign); in processType()
690 if (operands.size() != 2) in processType()
694 switch (operands[1]) { in processType()
706 << operands[1]; in processType()
708 typeMap[operands[0]] = floatTy; in processType()
711 if (operands.size() != 3) { in processType()
716 Type elementTy = getType(operands[1]); in processType()
719 << operands[1]; in processType()
721 typeMap[operands[0]] = VectorType::get({operands[2]}, elementTy); in processType()
724 return processOpTypePointer(operands); in processType()
727 return processArrayType(operands); in processType()
729 return processCooperativeMatrixType(operands); in processType()
731 return processFunctionType(operands); in processType()
733 return processImageType(operands); in processType()
735 return processSampledImageType(operands); in processType()
737 return processRuntimeArrayType(operands); in processType()
739 return processStructType(operands); in processType()
741 return processMatrixType(operands); in processType()
749 spirv::Deserializer::processOpTypePointer(ArrayRef<uint32_t> operands) { in processOpTypePointer() argument
750 if (operands.size() != 3) in processOpTypePointer()
753 auto pointeeType = getType(operands[2]); in processOpTypePointer()
756 << operands[2]; in processOpTypePointer()
758 uint32_t typePointerID = operands[0]; in processOpTypePointer()
759 auto storageClass = static_cast<spirv::StorageClass>(operands[1]); in processOpTypePointer()
803 spirv::Deserializer::processArrayType(ArrayRef<uint32_t> operands) { in processArrayType() argument
804 if (operands.size() != 3) { in processArrayType()
809 Type elementTy = getType(operands[1]); in processArrayType()
812 << operands[1]; in processArrayType()
817 auto countInfo = getConstant(operands[2]); in processArrayType()
820 << operands[2] << "can only come from normal constant right now"; in processArrayType()
830 typeMap[operands[0]] = spirv::ArrayType::get( in processArrayType()
831 elementTy, count, typeDecorations.lookup(operands[0])); in processArrayType()
836 spirv::Deserializer::processFunctionType(ArrayRef<uint32_t> operands) { in processFunctionType() argument
837 assert(!operands.empty() && "No operands for processing function type"); in processFunctionType()
838 if (operands.size() == 1) { in processFunctionType()
841 auto returnType = getType(operands[1]); in processFunctionType()
846 for (size_t i = 2, e = operands.size(); i < e; ++i) { in processFunctionType()
847 auto ty = getType(operands[i]); in processFunctionType()
857 typeMap[operands[0]] = FunctionType::get(context, argTypes, returnTypes); in processFunctionType()
862 spirv::Deserializer::processCooperativeMatrixType(ArrayRef<uint32_t> operands) { in processCooperativeMatrixType() argument
863 if (operands.size() != 5) { in processCooperativeMatrixType()
868 Type elementTy = getType(operands[1]); in processCooperativeMatrixType()
872 << operands[1]; in processCooperativeMatrixType()
875 auto scope = spirv::symbolizeScope(getConstantInt(operands[2]).getInt()); in processCooperativeMatrixType()
879 << operands[2]; in processCooperativeMatrixType()
882 unsigned rows = getConstantInt(operands[3]).getInt(); in processCooperativeMatrixType()
883 unsigned columns = getConstantInt(operands[4]).getInt(); in processCooperativeMatrixType()
885 typeMap[operands[0]] = spirv::CooperativeMatrixNVType::get( in processCooperativeMatrixType()
891 spirv::Deserializer::processRuntimeArrayType(ArrayRef<uint32_t> operands) { in processRuntimeArrayType() argument
892 if (operands.size() != 2) { in processRuntimeArrayType()
895 Type memberType = getType(operands[1]); in processRuntimeArrayType()
899 << operands[1]; in processRuntimeArrayType()
901 typeMap[operands[0]] = spirv::RuntimeArrayType::get( in processRuntimeArrayType()
902 memberType, typeDecorations.lookup(operands[0])); in processRuntimeArrayType()
907 spirv::Deserializer::processStructType(ArrayRef<uint32_t> operands) { in processStructType() argument
910 if (operands.empty()) { in processStructType()
914 if (operands.size() == 1) { in processStructType()
916 typeMap[operands[0]] = in processStructType()
917 spirv::StructType::getEmpty(context, nameMap.lookup(operands[0]).str()); in processStructType()
925 for (auto op : llvm::drop_begin(operands, 1)) { in processStructType()
941 if (memberDecorationMap.count(operands[0])) { in processStructType()
942 auto &allMemberDecorations = memberDecorationMap[operands[0]]; in processStructType()
968 uint32_t structID = operands[0]; in processStructType()
995 spirv::Deserializer::processMatrixType(ArrayRef<uint32_t> operands) { in processMatrixType() argument
996 if (operands.size() != 3) { in processMatrixType()
1002 Type elementTy = getType(operands[1]); in processMatrixType()
1006 << operands[1]; in processMatrixType()
1009 uint32_t colsCount = operands[2]; in processMatrixType()
1010 typeMap[operands[0]] = spirv::MatrixType::get(elementTy, colsCount); in processMatrixType()
1015 spirv::Deserializer::processTypeForwardPointer(ArrayRef<uint32_t> operands) { in processTypeForwardPointer() argument
1016 if (operands.size() != 2) in processTypeForwardPointer()
1020 typeForwardPointerIDs.insert(operands[0]); in processTypeForwardPointer()
1028 spirv::Deserializer::processImageType(ArrayRef<uint32_t> operands) { in processImageType() argument
1030 if (operands.size() != 8) in processImageType()
1035 Type elementTy = getType(operands[1]); in processImageType()
1038 << operands[1]; in processImageType()
1040 auto dim = spirv::symbolizeDim(operands[2]); in processImageType()
1043 << operands[2]; in processImageType()
1045 auto depthInfo = spirv::symbolizeImageDepthInfo(operands[3]); in processImageType()
1048 << operands[3]; in processImageType()
1050 auto arrayedInfo = spirv::symbolizeImageArrayedInfo(operands[4]); in processImageType()
1053 << operands[4]; in processImageType()
1055 auto samplingInfo = spirv::symbolizeImageSamplingInfo(operands[5]); in processImageType()
1057 return emitError(unknownLoc, "unknown MS for OpTypeImage: ") << operands[5]; in processImageType()
1059 auto samplerUseInfo = spirv::symbolizeImageSamplerUseInfo(operands[6]); in processImageType()
1062 << operands[6]; in processImageType()
1064 auto format = spirv::symbolizeImageFormat(operands[7]); in processImageType()
1067 << operands[7]; in processImageType()
1069 typeMap[operands[0]] = spirv::ImageType::get( in processImageType()
1076 spirv::Deserializer::processSampledImageType(ArrayRef<uint32_t> operands) { in processSampledImageType() argument
1077 if (operands.size() != 2) in processSampledImageType()
1080 Type elementTy = getType(operands[1]); in processSampledImageType()
1084 << operands[1]; in processSampledImageType()
1086 typeMap[operands[0]] = spirv::SampledImageType::get(elementTy); in processSampledImageType()
1094 LogicalResult spirv::Deserializer::processConstant(ArrayRef<uint32_t> operands, in processConstant() argument
1098 if (operands.size() < 2) { in processConstant()
1102 if (operands.size() < 3) { in processConstant()
1107 Type resultType = getType(operands[0]); in processConstant()
1110 << operands[0]; in processConstant()
1115 if (operands.size() == 4) { in processConstant()
1122 if (operands.size() == 3) { in processConstant()
1134 auto resultID = operands[1]; in processConstant()
1150 } words = {operands[2], operands[3]}; in processConstant()
1153 value = APInt(bitwidth, operands[2], /*isSigned=*/true); in processConstant()
1183 } words = {operands[2], operands[3]}; in processConstant()
1186 value = APFloat(llvm::bit_cast<float>(operands[2])); in processConstant()
1188 APInt data(16, operands[2]); in processConstant()
1209 bool isTrue, ArrayRef<uint32_t> operands, bool isSpec) { in processConstantBool() argument
1210 if (operands.size() != 2) { in processConstantBool()
1218 auto resultID = operands[1]; in processConstantBool()
1231 spirv::Deserializer::processConstantComposite(ArrayRef<uint32_t> operands) { in processConstantComposite() argument
1232 if (operands.size() < 2) { in processConstantComposite()
1236 if (operands.size() < 3) { in processConstantComposite()
1241 Type resultType = getType(operands[0]); in processConstantComposite()
1244 << operands[0]; in processConstantComposite()
1248 elements.reserve(operands.size() - 2); in processConstantComposite()
1249 for (unsigned i = 2, e = operands.size(); i < e; ++i) { in processConstantComposite()
1250 auto elementInfo = getConstant(operands[i]); in processConstantComposite()
1253 << operands[i] << " must come from a normal constant"; in processConstantComposite()
1258 auto resultID = operands[1]; in processConstantComposite()
1276 spirv::Deserializer::processSpecConstantComposite(ArrayRef<uint32_t> operands) { in processSpecConstantComposite() argument
1277 if (operands.size() < 2) { in processSpecConstantComposite()
1281 if (operands.size() < 3) { in processSpecConstantComposite()
1286 Type resultType = getType(operands[0]); in processSpecConstantComposite()
1289 << operands[0]; in processSpecConstantComposite()
1292 auto resultID = operands[1]; in processSpecConstantComposite()
1296 elements.reserve(operands.size() - 2); in processSpecConstantComposite()
1297 for (unsigned i = 2, e = operands.size(); i < e; ++i) { in processSpecConstantComposite()
1298 auto elementInfo = getSpecConstant(operands[i]); in processSpecConstantComposite()
1311 spirv::Deserializer::processSpecConstantOperation(ArrayRef<uint32_t> operands) { in processSpecConstantOperation() argument
1312 if (operands.size() < 3) in processSpecConstantOperation()
1316 uint32_t resultTypeID = operands[0]; in processSpecConstantOperation()
1322 uint32_t resultID = operands[1]; in processSpecConstantOperation()
1323 spirv::Opcode enclosedOpcode = static_cast<spirv::Opcode>(operands[2]); in processSpecConstantOperation()
1328 SmallVector<uint32_t>{operands.begin() + 3, operands.end()}}); in processSpecConstantOperation()
1396 spirv::Deserializer::processConstantNull(ArrayRef<uint32_t> operands) { in processConstantNull() argument
1397 if (operands.size() != 2) { in processConstantNull()
1402 Type resultType = getType(operands[0]); in processConstantNull()
1405 << operands[0]; in processConstantNull()
1408 auto resultID = operands[1]; in processConstantNull()
1441 LogicalResult spirv::Deserializer::processBranch(ArrayRef<uint32_t> operands) { in processBranch() argument
1446 if (operands.size() != 1) { in processBranch()
1450 auto *target = getOrCreateBlock(operands[0]); in processBranch()
1462 spirv::Deserializer::processBranchConditional(ArrayRef<uint32_t> operands) { in processBranchConditional() argument
1468 if (operands.size() != 3 && operands.size() != 5) { in processBranchConditional()
1474 auto condition = getValue(operands[0]); in processBranchConditional()
1475 auto *trueBlock = getOrCreateBlock(operands[1]); in processBranchConditional()
1476 auto *falseBlock = getOrCreateBlock(operands[2]); in processBranchConditional()
1479 if (operands.size() == 5) { in processBranchConditional()
1480 weights = std::make_pair(operands[3], operands[4]); in processBranchConditional()
1495 LogicalResult spirv::Deserializer::processLabel(ArrayRef<uint32_t> operands) { in processLabel() argument
1500 if (operands.size() != 1) { in processLabel()
1504 auto labelID = operands[0]; in processLabel()
1519 spirv::Deserializer::processSelectionMerge(ArrayRef<uint32_t> operands) { in processSelectionMerge() argument
1524 if (operands.size() < 2) { in processSelectionMerge()
1530 auto *mergeBlock = getOrCreateBlock(operands[0]); in processSelectionMerge()
1532 auto selectionControl = operands[1]; in processSelectionMerge()
1545 spirv::Deserializer::processLoopMerge(ArrayRef<uint32_t> operands) { in processLoopMerge() argument
1550 if (operands.size() < 3) { in processLoopMerge()
1555 auto *mergeBlock = getOrCreateBlock(operands[0]); in processLoopMerge()
1556 auto *continueBlock = getOrCreateBlock(operands[1]); in processLoopMerge()
1558 uint32_t loopControl = operands[2]; in processLoopMerge()
1571 LogicalResult spirv::Deserializer::processPhi(ArrayRef<uint32_t> operands) { in processPhi() argument
1576 if (operands.size() < 4) { in processPhi()
1582 Type blockArgType = getType(operands[0]); in processPhi()
1584 valueMap[operands[1]] = blockArg; in processPhi()
1587 << " id = " << operands[1] << " of type " << blockArgType << "\n"); in processPhi()
1591 for (unsigned i = 2, e = operands.size(); i < e; i += 2) { in processPhi()
1592 uint32_t value = operands[i]; in processPhi()
1593 Block *predecessor = getOrCreateBlock(operands[i + 1]); in processPhi()
2055 spirv::Deserializer::processDebugLine(ArrayRef<uint32_t> operands) { in processDebugLine() argument
2061 if (operands.size() != 3) in processDebugLine()
2063 debugLine = DebugLine{operands[0], operands[1], operands[2]}; in processDebugLine()
2070 spirv::Deserializer::processDebugString(ArrayRef<uint32_t> operands) { in processDebugString() argument
2071 if (operands.size() < 2) in processDebugString()
2074 if (!debugInfoMap.lookup(operands[0]).empty()) in processDebugString()
2077 << operands[0]; in processDebugString()
2080 StringRef debugString = decodeStringLiteral(operands, wordIndex); in processDebugString()
2081 if (wordIndex != operands.size()) in processDebugString()
2085 debugInfoMap[operands[0]] = debugString; in processDebugString()