@@ -52,33 +52,33 @@ Value createPredicate(OpBuilder &builder, tblgen::Pred pred) {
52
52
}
53
53
if (combiner == " PredCombinerAnd" ) {
54
54
auto op =
55
- builder. create < irdl::AllOfOp>( UnknownLoc::get (ctx), constraints);
55
+ irdl::AllOfOp::create (builder, UnknownLoc::get (ctx), constraints);
56
56
return op.getOutput ();
57
57
}
58
58
auto op =
59
- builder. create < irdl::AnyOfOp>( UnknownLoc::get (ctx), constraints);
59
+ irdl::AnyOfOp::create (builder, UnknownLoc::get (ctx), constraints);
60
60
return op.getOutput ();
61
61
}
62
62
}
63
63
64
64
std::string condition = pred.getCondition ();
65
65
// Build a CPredOp to match the C constraint built.
66
- irdl::CPredOp op = builder. create < irdl::CPredOp>(
67
- UnknownLoc::get (ctx), StringAttr::get (ctx, condition));
66
+ irdl::CPredOp op = irdl::CPredOp::create (builder, UnknownLoc::get (ctx),
67
+ StringAttr::get (ctx, condition));
68
68
return op;
69
69
}
70
70
71
71
Value typeToConstraint (OpBuilder &builder, Type type) {
72
72
MLIRContext *ctx = builder.getContext ();
73
73
auto op =
74
- builder. create < irdl::IsOp>( UnknownLoc::get (ctx), TypeAttr::get (type));
74
+ irdl::IsOp::create (builder, UnknownLoc::get (ctx), TypeAttr::get (type));
75
75
return op.getOutput ();
76
76
}
77
77
78
78
Value baseToConstraint (OpBuilder &builder, StringRef baseClass) {
79
79
MLIRContext *ctx = builder.getContext ();
80
- auto op = builder. create < irdl::BaseOp>( UnknownLoc::get (ctx),
81
- StringAttr::get (ctx, baseClass));
80
+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx),
81
+ StringAttr::get (ctx, baseClass));
82
82
return op.getOutput ();
83
83
}
84
84
@@ -179,7 +179,7 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
179
179
return createTypeConstraint (builder, predRec.getValueAsDef (" baseType" ));
180
180
181
181
if (predRec.getName () == " AnyType" ) {
182
- auto op = builder. create < irdl::AnyOp>( UnknownLoc::get (ctx));
182
+ auto op = irdl::AnyOp::create (builder, UnknownLoc::get (ctx));
183
183
return op.getOutput ();
184
184
}
185
185
@@ -190,12 +190,12 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
190
190
SmallVector<FlatSymbolRefAttr> nested = {
191
191
SymbolRefAttr::get (ctx, combined)};
192
192
auto typeSymbol = SymbolRefAttr::get (ctx, dialect, nested);
193
- auto op = builder. create < irdl::BaseOp>( UnknownLoc::get (ctx), typeSymbol);
193
+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx), typeSymbol);
194
194
return op.getOutput ();
195
195
}
196
196
std::string typeName = (" !" + predRec.getValueAsString (" typeName" )).str ();
197
- auto op = builder. create < irdl::BaseOp>( UnknownLoc::get (ctx),
198
- StringAttr::get (ctx, typeName));
197
+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx),
198
+ StringAttr::get (ctx, typeName));
199
199
return op.getOutput ();
200
200
}
201
201
@@ -205,7 +205,7 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
205
205
constraints.push_back (
206
206
createTypeConstraint (builder, tblgen::Constraint (child)));
207
207
}
208
- auto op = builder. create < irdl::AnyOfOp>( UnknownLoc::get (ctx), constraints);
208
+ auto op = irdl::AnyOfOp::create (builder, UnknownLoc::get (ctx), constraints);
209
209
return op.getOutput ();
210
210
}
211
211
@@ -215,14 +215,14 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
215
215
constraints.push_back (
216
216
createTypeConstraint (builder, tblgen::Constraint (child)));
217
217
}
218
- auto op = builder. create < irdl::AllOfOp>( UnknownLoc::get (ctx), constraints);
218
+ auto op = irdl::AllOfOp::create (builder, UnknownLoc::get (ctx), constraints);
219
219
return op.getOutput ();
220
220
}
221
221
222
222
// Integer types
223
223
if (predRec.getName () == " AnyInteger" ) {
224
- auto op = builder. create < irdl::BaseOp>(
225
- UnknownLoc::get (ctx), StringAttr::get (ctx, " !builtin.integer" ));
224
+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx),
225
+ StringAttr::get (ctx, " !builtin.integer" ));
226
226
return op.getOutput ();
227
227
}
228
228
@@ -235,7 +235,7 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
235
235
IntegerType::get (ctx, width, IntegerType::Signed)),
236
236
typeToConstraint (builder,
237
237
IntegerType::get (ctx, width, IntegerType::Unsigned))};
238
- auto op = builder. create < irdl::AnyOfOp>( UnknownLoc::get (ctx), types);
238
+ auto op = irdl::AnyOfOp::create (builder, UnknownLoc::get (ctx), types);
239
239
return op.getOutput ();
240
240
}
241
241
@@ -253,7 +253,7 @@ Value createTypeConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
253
253
for (const Record *child : predRec.getValueAsListOfDefs (" predicateList" )) {
254
254
constraints.push_back (createPredicate (builder, tblgen::Pred (child)));
255
255
}
256
- auto op = builder. create < irdl::AllOfOp>( UnknownLoc::get (ctx), constraints);
256
+ auto op = irdl::AllOfOp::create (builder, UnknownLoc::get (ctx), constraints);
257
257
return op.getOutput ();
258
258
}
259
259
@@ -279,7 +279,7 @@ Value createAttrConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
279
279
constraints.push_back (createPredicate (
280
280
builder, tblgen::Pred (child->getValueAsDef (" predicate" ))));
281
281
}
282
- auto op = builder. create < irdl::AllOfOp>( UnknownLoc::get (ctx), constraints);
282
+ auto op = irdl::AllOfOp::create (builder, UnknownLoc::get (ctx), constraints);
283
283
return op.getOutput ();
284
284
}
285
285
@@ -290,12 +290,12 @@ Value createAttrConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
290
290
constraints.push_back (
291
291
createAttrConstraint (builder, tblgen::Constraint (child)));
292
292
}
293
- auto op = builder. create < irdl::AnyOfOp>( UnknownLoc::get (ctx), constraints);
293
+ auto op = irdl::AnyOfOp::create (builder, UnknownLoc::get (ctx), constraints);
294
294
return op.getOutput ();
295
295
}
296
296
297
297
if (predRec.getName () == " AnyAttr" ) {
298
- auto op = builder. create < irdl::AnyOp>( UnknownLoc::get (ctx));
298
+ auto op = irdl::AnyOp::create (builder, UnknownLoc::get (ctx));
299
299
return op.getOutput ();
300
300
}
301
301
@@ -317,7 +317,7 @@ Value createAttrConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
317
317
318
318
if (predRec.getName () == " UnitAttr" ) {
319
319
auto op =
320
- builder. create < irdl::IsOp>( UnknownLoc::get (ctx), UnitAttr::get (ctx));
320
+ irdl::IsOp::create (builder, UnknownLoc::get (ctx), UnitAttr::get (ctx));
321
321
return op.getOutput ();
322
322
}
323
323
@@ -329,12 +329,12 @@ Value createAttrConstraint(OpBuilder &builder, tblgen::Constraint constraint) {
329
329
330
330
};
331
331
auto typeSymbol = SymbolRefAttr::get (ctx, dialect, nested);
332
- auto op = builder. create < irdl::BaseOp>( UnknownLoc::get (ctx), typeSymbol);
332
+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx), typeSymbol);
333
333
return op.getOutput ();
334
334
}
335
335
std::string typeName = (" #" + predRec.getValueAsString (" attrName" )).str ();
336
- auto op = builder. create < irdl::BaseOp>( UnknownLoc::get (ctx),
337
- StringAttr::get (ctx, typeName));
336
+ auto op = irdl::BaseOp::create (builder, UnknownLoc::get (ctx),
337
+ StringAttr::get (ctx, typeName));
338
338
return op.getOutput ();
339
339
}
340
340
@@ -348,15 +348,15 @@ Value createRegionConstraint(OpBuilder &builder, tblgen::Region constraint) {
348
348
if (predRec.getName () == " AnyRegion" ) {
349
349
ValueRange entryBlockArgs = {};
350
350
auto op =
351
- builder. create < irdl::RegionOp>( UnknownLoc::get (ctx), entryBlockArgs);
351
+ irdl::RegionOp::create (builder, UnknownLoc::get (ctx), entryBlockArgs);
352
352
return op.getResult ();
353
353
}
354
354
355
355
if (predRec.isSubClassOf (" SizedRegion" )) {
356
356
ValueRange entryBlockArgs = {};
357
357
auto ty = IntegerType::get (ctx, 32 );
358
- auto op = builder. create < irdl::RegionOp> (
359
- UnknownLoc::get (ctx), entryBlockArgs,
358
+ auto op = irdl::RegionOp::create (
359
+ builder, UnknownLoc::get (ctx), entryBlockArgs,
360
360
IntegerAttr::get (ty, predRec.getValueAsInt (" blocks" )));
361
361
return op.getResult ();
362
362
}
@@ -388,8 +388,8 @@ irdl::OperationOp createIRDLOperation(OpBuilder &builder,
388
388
MLIRContext *ctx = builder.getContext ();
389
389
StringRef opName = getOperatorName (tblgenOp);
390
390
391
- irdl::OperationOp op = builder. create < irdl::OperationOp> (
392
- UnknownLoc::get (ctx), StringAttr::get (ctx, opName));
391
+ irdl::OperationOp op = irdl::OperationOp::create (
392
+ builder, UnknownLoc::get (ctx), StringAttr::get (ctx, opName));
393
393
394
394
// Add the block in the region.
395
395
Block &opBlock = op.getBody ().emplaceBlock ();
@@ -471,19 +471,19 @@ irdl::OperationOp createIRDLOperation(OpBuilder &builder,
471
471
472
472
// Create the operands and results operations.
473
473
if (!operands.empty ())
474
- consBuilder. create < irdl::OperandsOp>( UnknownLoc::get (ctx), operands,
475
- ArrayAttr::get (ctx, operandNames),
476
- operandVariadicity);
474
+ irdl::OperandsOp::create (consBuilder, UnknownLoc::get (ctx), operands,
475
+ ArrayAttr::get (ctx, operandNames),
476
+ operandVariadicity);
477
477
if (!results.empty ())
478
- consBuilder. create < irdl::ResultsOp>( UnknownLoc::get (ctx), results,
479
- ArrayAttr::get (ctx, resultNames),
480
- resultVariadicity);
478
+ irdl::ResultsOp::create (consBuilder, UnknownLoc::get (ctx), results,
479
+ ArrayAttr::get (ctx, resultNames),
480
+ resultVariadicity);
481
481
if (!attributes.empty ())
482
- consBuilder. create < irdl::AttributesOp>( UnknownLoc::get (ctx), attributes,
483
- ArrayAttr::get (ctx, attrNames));
482
+ irdl::AttributesOp::create (consBuilder, UnknownLoc::get (ctx), attributes,
483
+ ArrayAttr::get (ctx, attrNames));
484
484
if (!regions.empty ())
485
- consBuilder. create < irdl::RegionsOp>( UnknownLoc::get (ctx), regions,
486
- ArrayAttr::get (ctx, regionNames));
485
+ irdl::RegionsOp::create (consBuilder, UnknownLoc::get (ctx), regions,
486
+ ArrayAttr::get (ctx, regionNames));
487
487
488
488
return op;
489
489
}
@@ -493,8 +493,8 @@ irdl::TypeOp createIRDLType(OpBuilder &builder, tblgen::TypeDef &tblgenType) {
493
493
StringRef typeName = getTypeName (tblgenType);
494
494
std::string combined = (" !" + typeName).str ();
495
495
496
- irdl::TypeOp op = builder. create < irdl::TypeOp>(
497
- UnknownLoc::get (ctx), StringAttr::get (ctx, combined));
496
+ irdl::TypeOp op = irdl::TypeOp::create (builder, UnknownLoc::get (ctx),
497
+ StringAttr::get (ctx, combined));
498
498
499
499
op.getBody ().emplaceBlock ();
500
500
@@ -507,8 +507,8 @@ irdl::AttributeOp createIRDLAttr(OpBuilder &builder,
507
507
StringRef attrName = getAttrName (tblgenAttr);
508
508
std::string combined = (" #" + attrName).str ();
509
509
510
- irdl::AttributeOp op = builder. create < irdl::AttributeOp> (
511
- UnknownLoc::get (ctx), StringAttr::get (ctx, combined));
510
+ irdl::AttributeOp op = irdl::AttributeOp::create (
511
+ builder, UnknownLoc::get (ctx), StringAttr::get (ctx, combined));
512
512
513
513
op.getBody ().emplaceBlock ();
514
514
@@ -517,8 +517,8 @@ irdl::AttributeOp createIRDLAttr(OpBuilder &builder,
517
517
518
518
static irdl::DialectOp createIRDLDialect (OpBuilder &builder) {
519
519
MLIRContext *ctx = builder.getContext ();
520
- return builder. create < irdl::DialectOp>( UnknownLoc::get (ctx),
521
- StringAttr::get (ctx, selectedDialect));
520
+ return irdl::DialectOp::create (builder, UnknownLoc::get (ctx),
521
+ StringAttr::get (ctx, selectedDialect));
522
522
}
523
523
524
524
static bool emitDialectIRDLDefs (const RecordKeeper &records, raw_ostream &os) {
@@ -529,7 +529,7 @@ static bool emitDialectIRDLDefs(const RecordKeeper &records, raw_ostream &os) {
529
529
530
530
// Create a module op and set it as the insertion point.
531
531
OwningOpRef<ModuleOp> module =
532
- builder. create < ModuleOp>( UnknownLoc::get (&ctx));
532
+ ModuleOp::create (builder, UnknownLoc::get (&ctx));
533
533
builder = builder.atBlockBegin (module ->getBody ());
534
534
// Create the dialect and insert it.
535
535
irdl::DialectOp dialect = createIRDLDialect (builder);
0 commit comments