15#include "mlir/Transforms/DialectConversion.h"
16#include "llvm/Support/JSON.h"
19using namespace firrtl;
31 auto numOps =
op.getNumOperands();
33 if (numOps < n || numOps > m) {
34 auto err =
emitError() <<
" has " << numOps <<
" inputs instead of ";
38 err <<
" between " << n <<
" and " << m;
50 return emitError() <<
" missing output bundle";
51 if (b.getType().getNumElements() != n)
52 return emitError() <<
" has " << b.getType().getNumElements()
53 <<
" output elements instead of " << n;
59 if (
op.getParameters())
60 num =
op.getParameters().size();
61 if (num < n || num > n + c) {
62 auto d =
emitError() <<
" has " << num <<
" parameters instead of ";
66 d <<
" between " << n <<
" and " << (n + c);
73 for (
auto a :
op.getParameters()) {
74 auto param = cast<ParamDeclAttr>(a);
75 if (param.getName().getValue() == paramName) {
76 if (isa<StringAttr>(param.getValue()))
79 return emitError() <<
" has parameter '" << param.getName()
80 <<
"' which should be a string but is not";
85 return emitError() <<
" is missing parameter " << paramName;
90 for (
auto a :
op.getParameters()) {
91 auto param = cast<ParamDeclAttr>(a);
92 if (param.getName().getValue() == paramName) {
93 if (isa<IntegerAttr>(param.getValue()))
96 return emitError() <<
" has parameter '" << param.getName()
97 <<
"' which should be an integer but is not";
102 return emitError() <<
" is missing parameter " << paramName;
111class IntrinsicOpConversion final
116 IntrinsicOpConversion(TypeConverter &typeConverter, MLIRContext *
context,
117 const ConversionMapTy &conversions,
118 size_t &numConversions,
119 bool allowUnknownIntrinsics =
false)
121 numConversions(numConversions),
122 allowUnknownIntrinsics(allowUnknownIntrinsics) {}
125 matchAndRewrite(GenericIntrinsicOp op, OpAdaptor adaptor,
126 ConversionPatternRewriter &rewriter)
const override {
128 auto it = conversions.find(op.getIntrinsicAttr());
129 if (it == conversions.end()) {
130 if (!allowUnknownIntrinsics)
131 return op.emitError(
"unknown intrinsic ") << op.getIntrinsicAttr();
135 auto &conv = *it->second;
136 auto result = conv.checkAndConvert(
GenericIntrinsic(op), adaptor, rewriter);
137 if (succeeded(result))
143 const ConversionMapTy &conversions;
144 size_t &numConversions;
145 const bool allowUnknownIntrinsics;
154 bool allowUnknownIntrinsics) {
156 ConversionTarget target(*
context);
158 target.markUnknownOpDynamicallyLegal([](Operation *op) {
return true; });
159 if (allowUnknownIntrinsics)
160 target.addDynamicallyLegalOp<GenericIntrinsicOp>(
161 [
this](GenericIntrinsicOp op) {
162 return !
conversions.contains(op.getIntrinsicAttr());
165 target.addIllegalOp<GenericIntrinsicOp>();
169 TypeConverter typeConverter;
170 typeConverter.addConversion([](Type type) {
return type; });
171 auto firrtlBaseTypeMaterialization =
172 [](OpBuilder &builder,
FIRRTLBaseType resultType, ValueRange inputs,
173 Location loc) -> Value {
174 if (inputs.size() != 1)
176 auto inputType = type_dyn_cast<FIRRTLBaseType>(inputs.front().getType());
184 auto w = WireOp::create(builder, loc, resultType).getResult();
189 typeConverter.addSourceMaterialization(firrtlBaseTypeMaterialization);
191 typeConverter.addTargetMaterialization(firrtlBaseTypeMaterialization);
196 count, allowUnknownIntrinsics);
198 if (failed(mlir::applyPartialConversion(mod, target, std::move(
patterns))))
211 interface.populateIntrinsicLowerings(lowering);
222 using IntrinsicOpConverter::IntrinsicOpConverter;
231 using IntrinsicOpConverter::IntrinsicOpConverter;
240 using IntrinsicConverter::IntrinsicConverter;
248 PatternRewriter &rewriter)
override {
249 rewriter.replaceOpWithNewOp<PlusArgsTestIntrinsicOp>(
256 using IntrinsicConverter::IntrinsicConverter;
266 PatternRewriter &rewriter)
override {
268 auto newop = PlusArgsValueIntrinsicOp::create(
269 rewriter, gi.
op.getLoc(), bty.getElementTypePreservingConst(0),
270 bty.getElementTypePreservingConst(1),
272 rewriter.replaceOpWithNewOp<BundleCreateOp>(
273 gi.
op, bty, ValueRange({newop.getFound(), newop.getResult()}));
277class CirctClockGateConverter
280 using IntrinsicOpConverter::IntrinsicOpConverter;
283 if (gi.
op.getNumOperands() == 3) {
288 if (gi.
op.getNumOperands() == 2) {
292 gi.
emitError() <<
" has " << gi.
op.getNumOperands()
293 <<
" ports instead of 3 or 4";
298class CirctClockInverterConverter
301 using IntrinsicOpConverter::IntrinsicOpConverter;
311 using IntrinsicConverter::IntrinsicConverter;
320 PatternRewriter &rewriter)
override {
322 gi.
getParamValue<IntegerAttr>(
"POW_2").getValue().getZExtValue();
324 auto pow2Attr = rewriter.getI64IntegerAttr(pow2);
326 rewriter.replaceOpWithNewOp<ClockDividerIntrinsicOp>(
327 gi.
op, adaptor.getOperands()[0], pow2Attr);
331template <
typename OpTy>
343template <
typename OpTy>
356 using IntrinsicConverter::IntrinsicConverter;
365 PatternRewriter &rewriter)
override {
366 auto getI64Attr = [&](IntegerAttr val) {
368 return IntegerAttr();
369 return rewriter.getI64IntegerAttr(val.getValue().getZExtValue());
371 auto delay = getI64Attr(gi.
getParamValue<IntegerAttr>(
"delay"));
372 auto length = getI64Attr(gi.
getParamValue<IntegerAttr>(
"length"));
373 rewriter.replaceOpWithNewOp<LTLDelayIntrinsicOp>(
374 gi.
op, gi.
op.getResultTypes(), adaptor.getOperands()[0], delay, length);
380 using IntrinsicConverter::IntrinsicConverter;
393 PatternRewriter &rewriter)
override {
394 auto delay = rewriter.getI64IntegerAttr(
395 gi.
getParamValue<IntegerAttr>(
"delay").getValue().getZExtValue());
396 auto operands = adaptor.getOperands();
397 Value clock = operands[1];
398 rewriter.replaceOpWithNewOp<LTLPastIntrinsicOp>(
399 gi.
op, gi.
op.getResultTypes(), operands[0], delay, clock);
405 using IntrinsicConverter::IntrinsicConverter;
413 auto params = gi.
op.getParameters();
414 if (!params || params.empty())
417 auto param = cast<ParamDeclAttr>(*params.begin());
418 if (param.getName().getValue() !=
"edge") {
419 gi.
emitError() <<
" has unexpected parameter '" << param.getName()
420 <<
"', expected 'edge'";
423 if (!isa<StringAttr>(param.getValue())) {
424 gi.
emitError() <<
" has parameter '" << param.getName()
425 <<
"' which should be a string but is not";
432 GenericIntrinsicOpAdaptor adaptor,
433 PatternRewriter &rewriter)
override {
437 auto edge = EventControl::AtPosEdge;
439 auto parsedEdge = symbolizeEventControl(edgeAttr.getValue());
442 <<
" has invalid edge parameter '" << edgeAttr.getValue()
443 <<
"', expected one of [posedge, negedge, edge]";
447 auto operands = adaptor.getOperands();
448 rewriter.replaceOpWithNewOp<LTLClockIntrinsicOp>(
449 gi.
op, gi.
op.getResultTypes(), operands[0],
450 EventControlAttr::get(rewriter.getContext(), edge), operands[1]);
457 using IntrinsicConverter::IntrinsicConverter;
466 PatternRewriter &rewriter)
override {
467 auto getI64Attr = [&](IntegerAttr val) {
469 return IntegerAttr();
470 return rewriter.getI64IntegerAttr(val.getValue().getZExtValue());
472 auto base = getI64Attr(gi.
getParamValue<IntegerAttr>(
"base"));
473 auto more = getI64Attr(gi.
getParamValue<IntegerAttr>(
"more"));
474 rewriter.replaceOpWithNewOp<LTLRepeatIntrinsicOp>(
475 gi.
op, gi.
op.getResultTypes(), adaptor.getOperands()[0], base, more);
481 using IntrinsicConverter::IntrinsicConverter;
490 PatternRewriter &rewriter)
override {
491 auto getI64Attr = [&](IntegerAttr val) {
493 return IntegerAttr();
494 return rewriter.getI64IntegerAttr(val.getValue().getZExtValue());
496 auto base = getI64Attr(gi.
getParamValue<IntegerAttr>(
"base"));
497 auto more = getI64Attr(gi.
getParamValue<IntegerAttr>(
"more"));
498 rewriter.replaceOpWithNewOp<LTLGoToRepeatIntrinsicOp>(
499 gi.
op, gi.
op.getResultTypes(), adaptor.getOperands()[0], base, more);
505 using IntrinsicConverter::IntrinsicConverter;
514 PatternRewriter &rewriter)
override {
515 auto getI64Attr = [&](IntegerAttr val) {
517 return IntegerAttr();
518 return rewriter.getI64IntegerAttr(val.getValue().getZExtValue());
520 auto base = getI64Attr(gi.
getParamValue<IntegerAttr>(
"base"));
521 auto more = getI64Attr(gi.
getParamValue<IntegerAttr>(
"more"));
522 rewriter.replaceOpWithNewOp<LTLNonConsecutiveRepeatIntrinsicOp>(
523 gi.
op, gi.
op.getResultTypes(), adaptor.getOperands()[0], base, more);
530 using IntrinsicConverter::IntrinsicConverter;
539 PatternRewriter &rewriter)
override {
541 auto operands = adaptor.getOperands();
546 enable = operands[1];
548 rewriter.replaceOpWithNewOp<Op>(gi.
op, operands[0], enable, label);
553 using IntrinsicConverter::IntrinsicConverter;
561 PatternRewriter &rewriter)
override {
562 auto operands = adaptor.getOperands();
563 rewriter.replaceOpWithNewOp<Mux2CellIntrinsicOp>(gi.
op, operands[0],
564 operands[1], operands[2]);
569 using IntrinsicConverter::IntrinsicConverter;
577 PatternRewriter &rewriter)
override {
578 auto operands = adaptor.getOperands();
579 rewriter.replaceOpWithNewOp<Mux4CellIntrinsicOp>(
580 gi.
op, operands[0], operands[1], operands[2], operands[3], operands[4]);
584class CirctHasBeenResetConverter
587 using IntrinsicOpConverter::IntrinsicOpConverter;
598 using IntrinsicOpConverter::IntrinsicOpConverter;
606template <
class OpTy,
bool ifElseFatal = false>
609 using IntrinsicConverter::IntrinsicConverter;
612 GenericIntrinsicOpAdaptor adaptor,
613 PatternRewriter &rewriter)
override {
627 auto clock = adaptor.getOperands()[0];
628 auto predicate = adaptor.getOperands()[1];
629 auto enable = adaptor.getOperands()[2];
631 auto substitutions = adaptor.getOperands().drop_front(3);
632 auto name = label ? label.strref() :
"";
637 SmallVector<Value> allOperands;
639 SmallVector<Value> substitutionVec(substitutions.begin(),
640 substitutions.end());
642 substitutionVec, message, allOperands)))
646 message = rewriter.getStringAttr(
"");
647 allOperands.append(substitutions.begin(), substitutions.end());
650 auto op = rewriter.template replaceOpWithNewOp<OpTy>(
651 gi.
op, clock, predicate, enable, message, allOperands, name,
654 SmallVector<StringRef> guardStrings;
655 guards.strref().split(guardStrings,
';', -1,
657 rewriter.startOpModification(op);
658 op->setAttr(
"guards", rewriter.getStrArrayAttr(guardStrings));
659 rewriter.finalizeOpModification(op);
662 if constexpr (ifElseFatal) {
663 rewriter.startOpModification(op);
664 op->setAttr(
"format", rewriter.getStringAttr(
"ifElseFatal"));
665 rewriter.finalizeOpModification(op);
674 using IntrinsicConverter::IntrinsicConverter;
685 PatternRewriter &rewriter)
override {
689 auto clock = adaptor.getOperands()[0];
690 auto predicate = adaptor.getOperands()[1];
691 auto enable = adaptor.getOperands()[2];
693 auto name = label ? label.strref() :
"";
695 auto message = rewriter.getStringAttr(
"");
696 auto op = rewriter.replaceOpWithNewOp<CoverOp>(
697 gi.
op, clock, predicate, enable, message, ValueRange{}, name,
700 SmallVector<StringRef> guardStrings;
701 guards.strref().split(guardStrings,
';', -1,
703 rewriter.startOpModification(op);
704 op->setAttr(
"guards", rewriter.getStrArrayAttr(guardStrings));
705 rewriter.finalizeOpModification(op);
712 using IntrinsicConverter::IntrinsicConverter;
723 PatternRewriter &rewriter)
override {
728 auto predicate = adaptor.getOperands()[0];
729 auto enable = adaptor.getOperands()[1];
731 auto substitutions = adaptor.getOperands().drop_front(2);
732 auto name = label ? label.strref() :
"";
734 auto message = format ? format : rewriter.getStringAttr(
"");
735 auto op = rewriter.template replaceOpWithNewOp<UnclockedAssumeIntrinsicOp>(
736 gi.
op, predicate, enable, message, substitutions, name);
738 SmallVector<StringRef> guardStrings;
739 guards.strref().split(guardStrings,
';', -1,
741 rewriter.startOpModification(op);
742 op->setAttr(
"guards", rewriter.getStrArrayAttr(guardStrings));
743 rewriter.finalizeOpModification(op);
750 return !gi.
getParamValue<IntegerAttr>(
"isClocked").getValue().isZero();
754 using IntrinsicConverter::IntrinsicConverter;
762 auto isClocked = getIsClocked(gi);
774 PatternRewriter &rewriter)
override {
775 auto isClocked = getIsClocked(gi);
776 auto functionName = gi.
getParamValue<StringAttr>(
"functionName");
777 ArrayAttr inputNamesStrArray;
778 StringAttr outputStr = gi.
getParamValue<StringAttr>(
"outputName");
779 if (
auto inputNames = gi.
getParamValue<StringAttr>(
"inputNames")) {
780 SmallVector<StringRef> inputNamesTemporary;
781 inputNames.strref().split(inputNamesTemporary,
';', -1,
783 inputNamesStrArray = rewriter.getStrArrayAttr(inputNamesTemporary);
786 Value clock = isClocked ? adaptor.getOperands()[0] : Value();
787 Value enable = adaptor.getOperands()[
static_cast<size_t>(isClocked)];
790 adaptor.getOperands().drop_front(
static_cast<size_t>(isClocked) + 1);
792 rewriter.replaceOpWithNewOp<DPICallIntrinsicOp>(
793 gi.
op, gi.
op.getResultTypes(), functionName, inputNamesStrArray,
794 outputStr, clock, enable, inputs);
803A
tryGetAs(DictionaryAttr dict, Attribute root, StringRef key, Location loc,
804 Twine path = Twine()) {
805 return tryGetAsBase<A>(dict, root, key, loc,
"View 'info'",
806 "'info' attribute", path);
811std::optional<DictionaryAttr>
813 DictionaryAttr augmentedType, DictionaryAttr root,
814 StringAttr name, StringAttr defName,
815 std::optional<StringAttr> description, Twine path = {}) {
817 tryGetAs<StringAttr>(augmentedType, root,
"class", loc, path);
820 StringRef classBase = classAttr.getValue();
821 if (!classBase.consume_front(
"sifive.enterprise.grandcentral.Augmented")) {
823 "the 'class' was expected to start with "
824 "'sifive.enterprise.grandCentral.Augmented*', but was '" +
825 classAttr.getValue() +
"' (Did you misspell it?)")
827 <<
"see attribute: " << augmentedType;
834 if (classBase ==
"BundleType") {
835 defName = tryGetAs<StringAttr>(augmentedType, root,
"defName", loc, path);
843 SmallVector<Attribute> elements;
845 tryGetAs<ArrayAttr>(augmentedType, root,
"elements", loc, path);
848 for (
size_t i = 0, e = elementsAttr.size(); i != e; ++i) {
849 auto field = dyn_cast_or_null<DictionaryAttr>(elementsAttr[i]);
853 "View 'info' attribute with path '.elements[" + Twine(i) +
854 "]' contained an unexpected type (expected a DictionaryAttr).")
856 <<
"The received element was: " << elementsAttr[i];
859 auto ePath = (path +
".elements[" + Twine(i) +
"]").str();
860 auto name = tryGetAs<StringAttr>(field, root,
"name", loc, ePath);
863 auto tpe = tryGetAs<DictionaryAttr>(field, root,
"tpe", loc, ePath);
866 std::optional<StringAttr> description;
867 if (
auto maybeDescription = field.get(
"description"))
868 description = cast<StringAttr>(maybeDescription);
871 description, path +
"_" + name.getValue());
878 if (
auto maybeDescription = field.get(
"description"))
879 attrs.append(
"description", cast<StringAttr>(maybeDescription));
880 attrs.append(
"name", name);
881 auto tpeClass = tpe.getAs<StringAttr>(
"class");
883 mlir::emitError(loc,
"missing 'class' key in") << tpe;
886 attrs.append(
"tpe", tpeClass);
887 elements.push_back(*eltAttr);
893 attrs.append(
"class", classAttr);
894 attrs.append(
"defName", defName);
896 attrs.append(
"description", *description);
897 attrs.append(
"elements", ArrayAttr::get(
context, elements));
898 attrs.append(
"name", name);
899 return DictionaryAttr::getWithSorted(
context, attrs);
903 if (classBase ==
"GroundType") {
904 NamedAttrList elementIface;
907 elementIface.append(
"class", classAttr);
909 elementIface.append(
"description", *description);
910 elementIface.append(
"name", name);
912 return DictionaryAttr::getWithSorted(
context, elementIface);
917 if (classBase ==
"VectorType") {
919 tryGetAs<ArrayAttr>(augmentedType, root,
"elements", loc, path);
922 SmallVector<Attribute> elements;
923 for (
auto [i, elt] :
llvm::enumerate(elementsAttr)) {
925 context, loc, cast<DictionaryAttr>(elt), root, name,
926 StringAttr::get(
context,
""), std::nullopt, path +
"_" + Twine(i));
929 elements.push_back(*eltAttr);
932 attrs.append(
"class", classAttr);
934 attrs.append(
"description", *description);
935 attrs.append(
"elements", ArrayAttr::get(
context, elements));
936 attrs.append(
"name", name);
937 return DictionaryAttr::getWithSorted(
context, attrs);
942 mlir::emitError(loc,
"found unknown AugmentedType '" + classAttr.getValue() +
943 "' (Did you misspell it?)")
945 <<
"see attribute: " << augmentedType;
952 GenericIntrinsicOpAdaptor adaptor,
953 PatternRewriter &rewriter)
override {
960 for (
auto idx :
llvm::
seq(gi.getNumInputs()))
961 if (gi.checkInputType(idx,
"must be ground type", [](auto ty) {
962 auto base = type_dyn_cast<FIRRTLBaseType>(ty);
963 return base && base.isGround();
969 llvm::json::parse(gi.
getParamValue<StringAttr>(
"info").getValue());
970 if (
auto err = view.takeError()) {
971 handleAllErrors(std::move(err), [&](
const llvm::json::ParseError &a) {
972 gi.
emitError() <<
": error parsing view JSON: " << a.message();
978 llvm::json::Path::Root root;
980 assert(value &&
"JSON to attribute failed but should not ever fail");
984 auto dict = dyn_cast<DictionaryAttr>(value);
986 return gi.
emitError() <<
": 'info' parameter must be a dictionary";
990 gi.
op.getContext(), gi.
op.getLoc(), dict, dict, nameAttr,
998 AugmentedBundleTypeAttr::get(gi.
op.getContext(), *result);
999 if (augmentedType.getClass() != augmentedBundleTypeAnnoClass)
1000 return gi.
emitError() <<
": 'info' must be augmented bundle";
1003 SmallVector<DictionaryAttr> worklist;
1004 worklist.push_back(augmentedType.getUnderlying());
1005 size_t numLeaves = 0;
1006 auto augGroundAttr =
1007 StringAttr::get(gi.
op.getContext(), augmentedGroundTypeAnnoClass);
1008 [[maybe_unused]]
auto augBundleAttr =
1009 StringAttr::get(gi.
op.getContext(), augmentedBundleTypeAnnoClass);
1010 [[maybe_unused]]
auto augVectorAttr =
1011 StringAttr::get(gi.
op.getContext(), augmentedVectorTypeAnnoClass);
1012 while (!worklist.empty()) {
1013 auto dict = worklist.pop_back_val();
1014 auto clazz = dict.getAs<StringAttr>(
"class");
1015 if (clazz == augGroundAttr) {
1019 assert(clazz == augBundleAttr || clazz == augVectorAttr);
1022 dict.getAs<ArrayAttr>(
"elements").getAsRange<DictionaryAttr>());
1027 <<
" has " << gi.
getNumInputs() <<
" operands but view 'info' has "
1028 << numLeaves <<
" leaf elements";
1032 rewriter.replaceOpWithNewOp<ViewIntrinsicOp>(
1033 gi.
op, nameAttr.getValue(),
yaml, augmentedType, adaptor.getOperands());
1044#include "FIRRTLIntrinsics.cpp.inc"
1048 populateLowerings(lowering);
assert(baseType &&"element must be base type")
static std::unique_ptr< Context > context
static std::optional< DictionaryAttr > parseAugmentedType(ApplyState &state, DictionaryAttr augmentedType, DictionaryAttr root, StringAttr name, StringAttr defName, std::optional< IntegerAttr > id, std::optional< StringAttr > description, Twine clazz, StringAttr companionAttr, Twine path={})
Recursively walk a sifive.enterprise.grandcentral.AugmentedType to extract any annotations it may con...
static LogicalResult convert(arc::ExecuteOp op, arc::ExecuteOp::Adaptor adaptor, ConversionPatternRewriter &rewriter, const TypeConverter &converter)
Base class for Intrinsic Converters.
Lowering helper which collects all intrinsic converters.
FailureOr< size_t > lower(FModuleOp mod, bool allowUnknownIntrinsics=false)
Lowers all intrinsics in a module. Returns number converted or failure.
llvm::DenseMap< StringAttr, std::unique_ptr< IntrinsicConverter > > ConversionMapTy
MLIRContext * context
Reference to the MLIR context.
ConversionMapTy conversions
Mapping from intrinsic names to converters.
A tryGetAs(DictionaryAttr dict, Attribute root, StringRef key, Location loc, Twine clazz, Twine path=Twine())
Implements the same behavior as DictionaryAttr::getAs<A> to return the value of a specific type assoc...
bool areTypesEquivalent(FIRRTLType destType, FIRRTLType srcType, bool destOuterTypeIsConst=false, bool srcOuterTypeIsConst=false, bool requireSameWidths=false)
Returns whether the two types are equivalent.
bool isTypeLarger(FIRRTLBaseType dstType, FIRRTLBaseType srcType)
Returns true if the destination is at least as wide as a source.
mlir::ParseResult parseFormatString(mlir::OpBuilder &builder, mlir::Location loc, llvm::StringRef formatString, llvm::ArrayRef< mlir::Value > specOperands, mlir::StringAttr &formatStringResult, llvm::SmallVectorImpl< mlir::Value > &operands)
void emitConnect(OpBuilder &builder, Location loc, Value lhs, Value rhs)
Emit a connect between two values.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Attribute convertJSONToAttribute(MLIRContext *context, llvm::json::Value &value, llvm::json::Path p)
Convert arbitrary JSON to an MLIR Attribute.
void populateIntrinsicLowerings(IntrinsicLowerings &lowerings) const override
Helper class for checking and extracting information from the generic instrinsic op.
ParseResult sizedInput(unsigned n, int32_t size)
mlir::TypedValue< BundleType > getOutputBundle()
T getParamValue(StringRef name)
Get parameter value by name, if present, as requested type.
ParseResult typedOutput()
ParseResult hasResetInput(unsigned n)
ParseResult typedInput(unsigned n)
ParseResult hasNOutputElements(unsigned n)
InFlightDiagnostic emitError()
ParseResult namedIntParam(StringRef paramName, bool optional=false)
ParseResult namedParam(StringRef paramName, bool optional=false)
ParseResult sizedOutput(int32_t size)
ParseResult sizedOutputElement(unsigned n, StringRef name, int32_t size)
ParseResult hasNParam(unsigned n, unsigned c=0)
ParseResult hasOutputElement(unsigned n, StringRef name)
ParseResult hasNInputs(unsigned n, unsigned c=0)
ParseResult hasNoOutput()
A dialect interface to provide lowering conversions.
void populateIntrinsicLowerings(IntrinsicLowerings &lowerings) const