1 // RUN: mlir-tblgen -gen-op-decls -I %S/../../include %s | FileCheck %s
2 // RUN: mlir-tblgen -gen-op-decls -op-include-regex="test.a_op" -I %S/../../include %s | FileCheck %s --check-prefix=REDUCE_INC
3 // RUN: mlir-tblgen -gen-op-decls -op-exclude-regex="test.a_op" -I %S/../../include %s | FileCheck %s --check-prefix=REDUCE_EXC
5 // RUN: mlir-tblgen -gen-op-defs -I %S/../../include %s | FileCheck %s --check-prefix=DEFS
7 include "mlir/IR/AttrTypeBase.td"
8 include "mlir/IR/OpBase.td"
9 include "mlir/Interfaces/InferTypeOpInterface.td"
10 include "mlir/Interfaces/SideEffectInterfaces.td"
12 def Test_Dialect : Dialect {
14 let cppNamespace = "NS";
15 let usePropertiesForAttributes = 0;
17 class NS_Op<string mnemonic, list<Trait> traits> :
18 Op<Test_Dialect, mnemonic, traits>;
20 // IsolatedFromAbove trait is included twice to ensure it gets uniqued during
22 def NS_AOp : NS_Op<"a_op", [IsolatedFromAbove, IsolatedFromAbove]> {
28 OptionalAttr<F32Attr>:$some_attr2
37 AnyRegion:$someRegion,
38 VariadicRegion<AnyRegion>:$someRegions
40 let builders = [OpBuilder<(ins "Value":$val)>,
41 OpBuilder<(ins CArg<"int", "0">:$integer)>,
42 DeprecatedOpBuilder<"the deprecation message",
43 (ins "float":$something)>];
44 let hasCustomAssemblyFormat = 1;
46 let hasCanonicalizer = 1;
50 let extraClassDeclaration = [{
51 // Display a graph for debugging purposes.
56 // CHECK-LABEL: NS::AOp declarations
58 // CHECK: namespace detail {
59 // CHECK: class AOpGenericAdaptorBase {
61 // CHECK: AOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), odsRegions(regions)
62 // CHECK: AOpGenericAdaptorBase(::mlir::Operation *op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), odsRegions(op->getRegions()) {}
63 // CHECK: ::mlir::IntegerAttr getAttr1Attr();
64 // CHECK: uint32_t getAttr1();
65 // CHECK: ::mlir::FloatAttr getSomeAttr2Attr();
66 // CHECK: ::std::optional< ::llvm::APFloat > getSomeAttr2();
67 // CHECK: ::mlir::Region &getSomeRegion() {
68 // CHECK: ::mlir::RegionRange getSomeRegions() {
72 // CHECK: template <typename RangeT>
73 // CHECK: class AOpGenericAdaptor : public detail::AOpGenericAdaptorBase {
75 // CHECK: AOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
76 // CHECK: AOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : AOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
77 // CHECK: AOpGenericAdaptor(RangeT values, const AOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
78 // CHECK: RangeT getODSOperands(unsigned index) {
79 // CHECK: ValueT getA() {
80 // CHECK: RangeT getB() {
82 // CHECK: RangeT odsOperands;
85 // CHECK: class AOpAdaptor : public AOpGenericAdaptor<::mlir::ValueRange> {
87 // CHECK: AOpAdaptor(AOp
88 // CHECK: ::llvm::LogicalResult verify(
91 // CHECK: class AOp : public ::mlir::Op<AOp, ::mlir::OpTrait::AtLeastNRegions<1>::Impl, ::mlir::OpTrait::AtLeastNResults<1>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::AtLeastNOperands<1>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsIsolatedFromAbove
92 // CHECK-NOT: ::mlir::OpTrait::IsIsolatedFromAbove
94 // CHECK: using Op::Op;
95 // CHECK: using Adaptor = AOpAdaptor;
96 // CHECK: static constexpr ::llvm::StringLiteral getOperationName() {
97 // CHECK: return ::llvm::StringLiteral("test.a_op");
99 // CHECK: ::mlir::Operation::operand_range getODSOperands(unsigned index) {
100 // CHECK: ::mlir::TypedValue<::mlir::IntegerType> getA() {
101 // CHECK: ::mlir::Operation::operand_range getB() {
102 // CHECK: ::mlir::OpOperand &getAMutable() {
103 // CHECK: ::mlir::MutableOperandRange getBMutable();
104 // CHECK: ::mlir::Operation::result_range getODSResults(unsigned index) {
105 // CHECK: ::mlir::TypedValue<::mlir::IntegerType> getR() {
106 // CHECK: ::mlir::Region &getSomeRegion() {
107 // CHECK: ::mlir::MutableArrayRef<::mlir::Region> getSomeRegions() {
108 // CHECK: ::mlir::IntegerAttr getAttr1Attr() {
109 // CHECK: uint32_t getAttr1();
110 // CHECK: ::mlir::FloatAttr getSomeAttr2Attr() {
111 // CHECK: ::std::optional< ::llvm::APFloat > getSomeAttr2();
112 // CHECK: ::mlir::Attribute removeSomeAttr2Attr() {
113 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value val);
114 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, int integer = 0);
115 // CHECK{LITERAL}: [[deprecated("the deprecation message")]]
116 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, float something);
117 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type r, ::mlir::TypeRange s, ::mlir::Value a, ::mlir::ValueRange b, ::mlir::IntegerAttr attr1, /*optional*/::mlir::FloatAttr some_attr2, unsigned someRegionsCount)
118 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::ValueRange b, ::mlir::IntegerAttr attr1, /*optional*/::mlir::FloatAttr some_attr2, unsigned someRegionsCount);
119 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type r, ::mlir::TypeRange s, ::mlir::Value a, ::mlir::ValueRange b, uint32_t attr1, /*optional*/::mlir::FloatAttr some_attr2, unsigned someRegionsCount)
120 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::ValueRange b, uint32_t attr1, /*optional*/::mlir::FloatAttr some_attr2, unsigned someRegionsCount);
121 // CHECK: static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes, unsigned numRegions)
122 // CHECK: static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
123 // CHECK: void print(::mlir::OpAsmPrinter &p);
124 // CHECK: ::llvm::LogicalResult verifyInvariants();
125 // CHECK: static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context);
126 // CHECK: ::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
127 // CHECK: // Display a graph for debugging purposes.
128 // CHECK: void displayGraph();
131 // DEFS-LABEL: NS::AOp definitions
133 // Check that `getAttrDictionary()` is used when not using properties.
135 // DECLS: ::mlir::RegionRange AOpGenericAdaptorBase::getSomeRegions()
136 // DECLS-NEXT: return odsRegions.drop_front(1);
137 // DECLS: ::mlir::RegionRange AOpGenericAdaptorBase::getRegions()
139 // Check AttrSizedOperandSegments
142 def NS_AttrSizedOperandOp : NS_Op<"attr_sized_operands",
143 [AttrSizedOperandSegments]> {
149 I32ElementsAttr:$operandSegmentSizes
153 // CHECK-LABEL: class AttrSizedOperandOpGenericAdaptorBase {
154 // CHECK: ::mlir::DenseIntElementsAttr getOperandSegmentSizes();
156 // CHECK-LABEL: AttrSizedOperandOpGenericAdaptor(
157 // CHECK-SAME: RangeT values
158 // CHECK-SAME: ::mlir::DictionaryAttr attrs
159 // CHECK: RangeT getA() {
160 // CHECK: RangeT getB() {
161 // CHECK: ValueT getC() {
162 // CHECK: RangeT getD() {
164 // Check op trait for different number of operands
167 def NS_BOp : NS_Op<"op_with_no_operand", []> {
168 let arguments = (ins);
171 // CHECK-LABEL: NS::BOp declarations
172 // CHECK: OpTrait::ZeroOperands
174 def NS_COp : NS_Op<"op_with_one_operand", []> {
175 let arguments = (ins I32:$operand);
178 // CHECK-LABEL: NS::COp declarations
179 // CHECK: OpTrait::OneOperand
181 def NS_DOp : NS_Op<"op_with_two_operands", []> {
182 let arguments = (ins I32:$input1, I32:$input2);
185 // CHECK-LABEL: NS::DOp declarations
186 // CHECK: OpTrait::NOperands<2>::Impl
188 def NS_EOp : NS_Op<"op_with_optionals", []> {
189 let arguments = (ins Optional<I32>:$a);
190 let results = (outs Optional<F32>:$b);
193 // CHECK-LABEL: NS::EOp declarations
194 // CHECK: ::mlir::TypedValue<::mlir::IntegerType> getA() {
195 // CHECK: ::mlir::MutableOperandRange getAMutable();
196 // CHECK: ::mlir::TypedValue<::mlir::FloatType> getB() {
197 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, /*optional*/::mlir::Type b, /*optional*/::mlir::Value a)
199 // Check that all types match constraint results in generating builder.
202 def NS_FOp : NS_Op<"op_with_all_types_constraint",
203 [AllTypesMatch<["a", "b"]>]> {
204 let arguments = (ins AnyType:$a);
205 let results = (outs Res<AnyType, "output b", []>:$b);
208 // CHECK-LABEL: class FOp :
209 // CHECK: static ::llvm::LogicalResult inferReturnTypes
211 // DEFS: void FOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a) {
212 // DEFS: if (::mlir::succeeded(FOp::inferReturnTypes(odsBuilder.getContext(),
214 // DEFS: ::mlir::detail::reportFatalInferReturnTypesError(odsState);
216 def NS_GOp : NS_Op<"op_with_fixed_return_type", []> {
217 let arguments = (ins AnyType:$a);
218 let results = (outs I32:$b);
221 // CHECK-LABEL: class GOp :
222 // CHECK: static ::llvm::LogicalResult inferReturnTypes
224 // Check default value for collective params builder. Check that other builders
225 // are generated as well.
226 def NS_HCollectiveParamsOp : NS_Op<"op_collective_params", []> {
227 let arguments = (ins AnyType:$a);
228 let results = (outs AnyType:$b);
231 // CHECK-LABEL: class HCollectiveParamsOp :
232 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type b, ::mlir::Value a);
233 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a);
234 // CHECK: static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {})
236 // Check suppression of "separate arg, separate result" build method for an op
237 // with single variadic arg and single variadic result (since it will be
238 // ambiguous with the collective params build method).
239 def NS_HCollectiveParamsSuppress0Op : NS_Op<"op_collective_suppress0", []> {
240 let arguments = (ins Variadic<I32>:$a);
241 let results = (outs Variadic<I32>:$b);
244 // CHECK-LABEL: class HCollectiveParamsSuppress0Op :
245 // CHECK-NOT: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange b, ::mlir::ValueRange a);
246 // CHECK: static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
248 // Check suppression of "separate arg, collective result" build method for an op
249 // with single variadic arg and non variadic result (since it will be
250 // ambiguous with the collective params build method).
251 def NS_HCollectiveParamsSuppress1Op : NS_Op<"op_collective_suppress1", []> {
252 let arguments = (ins Variadic<I32>:$a);
253 let results = (outs I32:$b);
256 // CHECK-LABEL: class HCollectiveParamsSuppress1Op :
257 // CHECK-NOT: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange b, ::mlir::ValueRange a);
258 // CHECK: static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
260 // Check suppression of "separate arg, collective result" build method for an op
261 // with single variadic arg and > 1 variadic result (since it will be
262 // ambiguous with the collective params build method). Note that "separate arg,
263 // separate result" build method should be generated in this case as its not
264 // ambiguous with the collective params build method.
265 def NS_HCollectiveParamsSuppress2Op : NS_Op<"op_collective_suppress2", [SameVariadicResultSize]> {
266 let arguments = (ins Variadic<I32>:$a);
267 let results = (outs Variadic<I32>:$b, Variadic<F32>:$c);
269 // CHECK-LABEL: class HCollectiveParamsSuppress2Op :
270 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange b, ::mlir::TypeRange c, ::mlir::ValueRange a);
271 // CHECK-NOT: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange b, ::mlir::ValueRange a);
272 // CHECK: static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
274 // Check default value of `attributes` for the `genUseOperandAsResultTypeCollectiveParamBuilder` builder
275 def NS_IOp : NS_Op<"op_with_same_operands_and_result_types_trait", [SameOperandsAndResultType]> {
276 let arguments = (ins AnyType:$a, AnyType:$b);
277 let results = (outs AnyType:$r);
279 // CHECK-LABEL: class IOp :
280 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type r, ::mlir::Value a, ::mlir::Value b);
281 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b);
282 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b);
283 // CHECK: static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
284 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
286 // Check default value of `attributes` for the `genInferredTypeCollectiveParamBuilder` builder
287 def NS_JOp : NS_Op<"op_with_InferTypeOpInterface_interface", [DeclareOpInterfaceMethods<InferTypeOpInterface>]> {
288 let arguments = (ins AnyType:$a, AnyType:$b);
289 let results = (outs AnyType:$r);
291 // CHECK-LABEL: class JOp :
292 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type r, ::mlir::Value a, ::mlir::Value b);
293 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b);
294 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b);
295 // CHECK: static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
296 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
298 // Test usage of TraitList getting flattened during emission.
299 def NS_KOp : NS_Op<"k_op", [IsolatedFromAbove,
300 TraitList<[DeclareOpInterfaceMethods<InferTypeOpInterface>]>]> {
301 let arguments = (ins AnyType:$a, AnyType:$b);
304 // CHECK: class KOp : public ::mlir::Op<KOp,
305 // CHECK-SAME: ::mlir::OpTrait::IsIsolatedFromAbove, ::mlir::InferTypeOpInterface::Trait
307 // Check native OpTrait usage
310 def NS_TestTrait : NativeOpTrait<"TestTrait"> {
311 let cppNamespace = "SomeNamespace";
314 def NS_KWithTraitOp : NS_Op<"KWithTrait", [NS_TestTrait]>;
316 // CHECK-LABEL: NS::KWithTraitOp declarations
317 // CHECK: class KWithTraitOp : public ::mlir::Op<KWithTraitOp
318 // CHECK-SAME: SomeNamespace::TestTrait
320 def NS_LOp : NS_Op<"op_with_same_operands_and_result_types_unwrapped_attr", [SameOperandsAndResultType]> {
321 let arguments = (ins AnyType:$a, AnyType:$b, I32Attr:$attr1);
322 let results = (outs AnyType:$r);
324 // CHECK-LABEL: class LOp :
325 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type r, ::mlir::Value a, ::mlir::Value b, ::mlir::IntegerAttr attr1);
326 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::IntegerAttr attr1);
327 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::IntegerAttr attr1);
328 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type r, ::mlir::Value a, ::mlir::Value b, uint32_t attr1);
329 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, uint32_t attr1);
330 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, uint32_t attr1);
331 // CHECK: static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
332 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
334 def NS_MOp : NS_Op<"op_with_single_result_and_fold_adaptor_fold", []> {
335 let results = (outs AnyType:$res);
340 // CHECK-LABEL: class MOp :
341 // CHECK: ::mlir::OpFoldResult fold(FoldAdaptor adaptor);
343 def NS_NOp : NS_Op<"op_with_properties", []> {
344 let arguments = (ins Property<"unsigned">:$value);
347 // DEFS: NOpGenericAdaptorBase::NOpGenericAdaptorBase(NOp op) :
348 // DEFS-SAME: odsAttrs(op->getRawDictionaryAttrs())
349 // DEFS-SAME: odsOpName(op->getName())
350 // DEFS-SAME: properties(op.getProperties())
351 // DEFS-SAME: odsRegions(op->getRegions())
353 // Test that type defs have the proper namespaces when used as a constraint.
356 def Test_Dialect2 : Dialect {
358 let cppNamespace = "::mlir::dialect2";
360 def TestDialect2Type : TypeDef<Test_Dialect2, "Dialect2Type"> {
361 let typeName = "test.type";
364 def NS_ResultWithDialectTypeOp : NS_Op<"op_with_dialect_type", []> {
365 let results = (outs TestDialect2Type);
368 // CHECK-LABEL: NS::ResultWithDialectTypeOp declarations
369 // CHECK: class ResultWithDialectTypeOp :
370 // CHECK-SAME: ::mlir::OpTrait::OneTypedResult<::mlir::dialect2::Dialect2TypeType>
372 // Check that default builders can be suppressed.
375 def NS_SkipDefaultBuildersOp : NS_Op<"skip_default_builders", []> {
376 let skipDefaultBuilders = 1;
377 let builders = [OpBuilder<(ins "Value":$val)>];
380 // CHECK-LABEL: NS::SkipDefaultBuildersOp declarations
381 // CHECK: class SkipDefaultBuildersOp
382 // CHECK-NOT: static void build(::mlir::Builder
383 // CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value
385 // Check leading underscore in op name
388 def NS_VarOfVarOperandOp : NS_Op<"var_of_var_operand", []> {
390 VariadicOfVariadic<F32, "var_size">:$var_of_var_attr,
391 DenseI32ArrayAttr:$var_size
395 // CHECK-LABEL: class VarOfVarOperandOpGenericAdaptor
397 // CHECK: ::llvm::SmallVector<RangeT> getVarOfVarAttr() {
400 def NS__AOp : NS_Op<"_op_with_leading_underscore", []>;
402 // CHECK-LABEL: NS::_AOp declarations
403 // CHECK: class _AOp : public ::mlir::Op<_AOp
405 def _BOp : NS_Op<"_op_with_leading_underscore_and_no_namespace", []>;
407 // CHECK-LABEL: _BOp declarations
408 // CHECK: class _BOp : public ::mlir::Op<_BOp
410 // REDUCE_INC-LABEL: NS::AOp declarations
411 // REDUCE_INC-NOT: NS::BOp declarations
413 // REDUCE_EXC-NOT: NS::AOp declarations
414 // REDUCE_EXC-LABEL: NS::BOp declarations