Lines Matching defs:operand
40 /// refers to something registered on the operation itself, e.g. an operand,
81 /// This class represents a variable that refers to an operand argument.
297 /// This class represents a specific resolver for an operand or result type.
328 /// If the type is resolved based upon another operand or result, this is
331 /// If the type is resolved based upon another operand or result, this is
386 /// A flag indicating if all operand/result types were seen. If the format
412 /// The index of the buildable type, if valid, for every operand and result.
555 /// The code snippet used to generate a parser call for an operand.
557 /// {0}: The name of the operand.
566 ::mlir::OpAsmParser::UnresolvedOperand operand;
568 parser.parseOptionalOperand(operand);
572 {0}Operands.push_back(operand);
582 /// operand.
584 /// {0}: The name of the operand.
809 /// Get the name used for the type list for the given type directive operand.
813 if (auto *operand = dyn_cast<OperandVariable>(arg)) {
814 lengthKind = getArgumentLengthKind(operand->getVar());
815 return operand->getVar()->name;
899 } else if (auto *operand = dyn_cast<OperandVariable>(element)) {
900 StringRef name = operand->getVar()->name;
901 if (operand->getVar()->isVariableLength()) {
905 if (operand->getVar()->isVariadicOfVariadic()) {
970 } else if (auto *operand = dyn_cast<OperandVariable>(param)) {
971 StringRef name = operand->getVar()->name;
972 ArgumentLengthKind lengthKind = getArgumentLengthKind(operand->getVar());
1035 // * Set the location of operand variables.
1037 if (auto *operand = dyn_cast<OperandVariable>(param)) {
1038 auto *var = operand->getVar();
1066 if (auto *operand = dyn_cast<OperandVariable>(input)) {
1067 if (!operand->getVar()->isOptional())
1073 operand->getVar()->name);
1115 } else if (auto *operand = dyn_cast<OperandVariable>(param)) {
1116 const NamedTypeConstraint *var = operand->getVar();
1399 // Generate the code to resolve the operand/result types and successors now
1575 } else if (auto *operand = dyn_cast<OperandVariable>(element)) {
1576 ArgumentLengthKind lengthKind = getArgumentLengthKind(operand->getVar());
1577 StringRef name = operand->getVar()->name;
1659 .Case<OperandVariable, ResultVariable>([&](auto operand) {
1661 operand->getVar()->constraint.getCppType(),
1664 .Default([&](auto operand) {
1758 // Emit the operand type resolutions.
1773 // Handle the case where all operand types are grouped together with
1776 // If `operands` was specified, use the full operand list directly.
1784 // Otherwise, use llvm::concat to merge the disjoint operand lists together.
1789 llvm::interleaveComma(op.getOperands(), body, [&](auto &operand) {
1790 body << operand.name << "Operands";
1805 // Group all of the operand types together to perform the resolution all at
1829 NamedTypeConstraint &operand = op.getOperand(i);
1830 body << " if (parser.resolveOperands(" << operand.name << "Operands, ";
1832 // Resolve the type of this operand.
1834 emitTypeResolver(operandType, operand.name);
1836 body << ", " << operand.name
1884 auto interleaveFn = [&](const NamedTypeConstraint &operand) {
1885 // If the operand is variadic emit the parsed size.
1886 if (operand.isVariableLength())
1887 body << "static_cast<int32_t>(" << operand.name << "Operands.size())";
1905 for (const NamedTypeConstraint &operand : op.getOperands()) {
1906 if (!operand.isVariadicOfVariadic())
1913 operand.constraint.getVariadicOfVariadicSegmentSizeAttr(),
1914 operand.name);
1920 operand.constraint.getVariadicOfVariadicSegmentSizeAttr(),
1921 operand.name);
2162 } else if (auto *operand = dyn_cast<OperandVariable>(element)) {
2163 body << op.getGetterName(operand->getVar()->name) << "()";
2176 auto *operand = dyn_cast<OperandVariable>(typeOperand);
2177 auto *var = operand ? operand->getVar()
2231 /// Generate the C++ for an operand to a (*-)type directive.
2239 auto *operand = dyn_cast<OperandVariable>(arg);
2240 auto *var = operand ? operand->getVar() : cast<ResultVariable>(arg)->getVar();
2561 } else if (auto *operand = dyn_cast<OperandVariable>(element)) {
2562 if (operand->getVar()->isVariadicOfVariadic()) {
2564 << op.getGetterName(operand->getVar()->name)
2569 } else if (operand->getVar()->isOptional()) {
2571 << op.getGetterName(operand->getVar()->name) << "())\n"
2574 body << " _odsPrinter << " << op.getGetterName(operand->getVar()->name)
2603 if (auto *operand = dyn_cast<OperandVariable>(dir->getArg())) {
2604 if (operand->getVar()->isVariadicOfVariadic()) {
2609 op.getGetterName(operand->getVar()->name));
2615 if (auto *operand = dyn_cast<OperandVariable>(dir->getArg()))
2616 var = operand->getVar();
2617 else if (auto *operand = dyn_cast<ResultVariable>(dir->getArg()))
2618 var = operand->getVar();
2758 /// Check for inferable type resolution based on another operand, result, or
2894 const NamedTypeConstraint *operand = operandVar->getVar();
2895 return operand->isOptional() || operand->isVariadic() ||
2896 operand->isVariadicOfVariadic();
3052 NamedTypeConstraint &operand = op.getOperand(i);
3054 // Check that the operand itself is in the format.
3055 if (!fmt.allOperands && !seenOperands.count(&operand)) {
3057 "operand #" + Twine(i) + ", named '" +
3058 operand.name + "', not found",
3059 "suggest adding a '$" + operand.name +
3063 // Check that the operand type is in the format, or that it can be inferred.
3077 std::optional<StringRef> builder = operand.constraint.getBuilderCall();
3078 if (!builder || (fmt.allOperands && operand.isVariableLength())) {
3081 "type of operand #" + Twine(i) + ", named '" + operand.name +
3085 operand.name + ")' directive to the " + "custom assembly format");
3218 // Check to see if this value matches a resolved operand or result type.
3237 // Check to see if there is an operand or result to use for the resolution.
3245 // Set the resolvers for each operand and result.
3311 if (const NamedTypeConstraint *operand = findArg(op.getOperands(), name)) {
3313 if (fmt.allOperands || !seenOperands.insert(operand).second)
3314 return emitError(loc, "operand '" + name + "' is already bound");
3315 } else if (ctx == RefDirectiveContext && !seenOperands.count(operand)) {
3316 return emitError(loc, "operand '" + name +
3319 return create<OperandVariable>(operand);
3456 // Parse the main operand.
3624 FailureOr<FormatElement *> operand;
3627 failed(operand = parseTypeDirectiveOperand(loc, isRefChild)) ||
3632 return create<TypeDirective>(*operand);
3657 loc, "'type' directive operand expects variable or directive operand");