Skip to content

Commit 681e171

Browse files
xlaukolanza
authored andcommitted
[CIR] Remove implicit options from tablegen files (llvm#1602)
1 parent 88d8b78 commit 681e171

File tree

4 files changed

+7
-81
lines changed

4 files changed

+7
-81
lines changed

clang/include/clang/CIR/Dialect/IR/CIRAttrs.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def LangAttr : CIR_Attr<"Lang", "lang"> {
8585
bool isC() const { return getLang().getValue() == SourceLanguage::C; };
8686
bool isCXX() const { return getLang().getValue() == SourceLanguage::CXX; };
8787
}];
88-
let genVerifyDecl = 0;
8988
}
9089

9190
//===----------------------------------------------------------------------===//

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 5 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,6 @@ def ObjSizeOp : CIR_Op<"objsize", [Pure]> {
308308
`)`
309309
`->` type($result) attr-dict
310310
}];
311-
312-
// Nothing to verify that isn't already covered by constraints.
313-
let hasVerifier = 0;
314311
}
315312

316313
//===----------------------------------------------------------------------===//
@@ -340,9 +337,6 @@ def PtrDiffOp : CIR_Op<"ptr_diff", [Pure, SameTypeOperands]> {
340337
let assemblyFormat = [{
341338
`(` $lhs `,` $rhs `)` `:` qualified(type($lhs)) `->` qualified(type($result)) attr-dict
342339
}];
343-
344-
// Already covered by the traits
345-
let hasVerifier = 0;
346340
}
347341

348342
//===----------------------------------------------------------------------===//
@@ -380,9 +374,6 @@ def PtrStrideOp : CIR_Op<"ptr_stride",
380374
return mlir::cast<cir::PointerType>(getBase().getType()).getPointee();
381375
}
382376
}];
383-
384-
// SameFirstOperandAndResultType already checks all we need.
385-
let hasVerifier = 0;
386377
}
387378

388379
//===----------------------------------------------------------------------===//
@@ -545,8 +536,6 @@ def AllocaOp : CIR_Op<"alloca", [
545536
($annotations^)?
546537
(`ast` $ast^)? attr-dict
547538
}];
548-
549-
let hasVerifier = 0;
550539
}
551540

552541
//===----------------------------------------------------------------------===//
@@ -828,9 +817,6 @@ def TernaryOp : CIR_Op<"ternary",
828817
>
829818
];
830819

831-
// All constraints already verified elsewhere.
832-
let hasVerifier = 0;
833-
834820
let assemblyFormat = [{
835821
`(` $cond `,`
836822
`true` $trueRegion `,`
@@ -1303,9 +1289,6 @@ def CmpOp : CIR_Op<"cmp", [Pure, SameTypeOperands]> {
13031289
let assemblyFormat = [{
13041290
`(` $kind `,` $lhs `,` $rhs `)` `:` type($lhs) `,` type($result) attr-dict
13051291
}];
1306-
1307-
// Already covered by the traits
1308-
let hasVerifier = 0;
13091292
}
13101293

13111294
//===----------------------------------------------------------------------===//
@@ -1885,8 +1868,6 @@ def CmpThreeWayOp : CIR_Op<"cmp3way", [Pure, SameTypeOperands]> {
18851868
`:` type($result) attr-dict
18861869
}];
18871870

1888-
let hasVerifier = 0;
1889-
18901871
let extraClassDeclaration = [{
18911872
/// Determine whether this three-way comparison produces a strong ordering.
18921873
bool isStrongOrdering() {
@@ -2566,9 +2547,6 @@ def GetGlobalOp : CIR_Op<"get_global",
25662547
(`thread_local` $tls^)?
25672548
$name `:` qualified(type($addr)) attr-dict
25682549
}];
2569-
2570-
// `GetGlobalOp` is fully verified by its traits.
2571-
let hasVerifier = 0;
25722550
}
25732551

25742552
//===----------------------------------------------------------------------===//
@@ -3155,8 +3133,6 @@ def VecInsertOp : CIR_Op<"vec.insert", [Pure,
31553133
qualified(type($vec))
31563134
}];
31573135

3158-
let hasVerifier = 0;
3159-
31603136
let llvmOp = "InsertElementOp";
31613137
}
31623138

@@ -3185,8 +3161,6 @@ def VecExtractOp : CIR_Op<"vec.extract", [Pure,
31853161
$vec `[` $index `:` type($index) `]` attr-dict `:` qualified(type($vec))
31863162
}];
31873163

3188-
let hasVerifier = 0;
3189-
31903164
let llvmOp = "ExtractElementOp";
31913165
}
31923166

@@ -3239,7 +3213,6 @@ def VecSplatOp : CIR_Op<"vec.splat", [Pure,
32393213
let assemblyFormat = [{
32403214
$value `:` type($value) `,` qualified(type($result)) attr-dict
32413215
}];
3242-
let hasVerifier = 0;
32433216
}
32443217

32453218
//===----------------------------------------------------------------------===//
@@ -3264,8 +3237,6 @@ def VecCmpOp : CIR_Op<"vec.cmp", [Pure, SameTypeOperands]> {
32643237
`(` $kind `,` $lhs `,` $rhs `)` `:` qualified(type($lhs)) `,`
32653238
qualified(type($result)) attr-dict
32663239
}];
3267-
3268-
let hasVerifier = 0;
32693240
}
32703241

32713242
//===----------------------------------------------------------------------===//
@@ -3390,6 +3361,8 @@ def BaseClassAddrOp : CIR_Op<"base_class_addr"> {
33903361
```
33913362
}];
33923363

3364+
// The validity of the relationship of derived and base cannot yet be
3365+
// verified, currently not worth adding a verifier.
33933366
let arguments = (ins
33943367
Arg<CIR_PointerType, "derived class pointer", [MemRead]>:$derived_addr,
33953368
IndexAttr:$offset, UnitAttr:$assume_not_null);
@@ -3402,11 +3375,6 @@ def BaseClassAddrOp : CIR_Op<"base_class_addr"> {
34023375
(`nonnull` $assume_not_null^)?
34033376
`)` `[` $offset `]` `->` qualified(type($base_addr)) attr-dict
34043377
}];
3405-
3406-
// The validity of the relationship of derived and base cannot
3407-
// yet be verified, currently not worth adding such a feature
3408-
// just for this.
3409-
let hasVerifier = 0;
34103378
}
34113379

34123380
def DerivedClassAddrOp : CIR_Op<"derived_class_addr"> {
@@ -3444,6 +3412,8 @@ def DerivedClassAddrOp : CIR_Op<"derived_class_addr"> {
34443412
```
34453413
}];
34463414

3415+
// The validity of the relationship of derived and base cannot yet be
3416+
// verified, currently not worth adding a verifier.
34473417
let arguments = (ins
34483418
Arg<CIR_PointerType, "derived class pointer", [MemRead]>:$base_addr,
34493419
IndexAttr:$offset, UnitAttr:$assume_not_null);
@@ -3456,11 +3426,6 @@ def DerivedClassAddrOp : CIR_Op<"derived_class_addr"> {
34563426
(`nonnull` $assume_not_null^)?
34573427
`)` `[` $offset `]` `->` qualified(type($derived_addr)) attr-dict
34583428
}];
3459-
3460-
// The validity of the relationship of derived and base cannot
3461-
// yet be verified, currently not worth adding such a feature
3462-
// just for this.
3463-
let hasVerifier = 0;
34643429
}
34653430

34663431
//===----------------------------------------------------------------------===//
@@ -3865,7 +3830,6 @@ def DeleteArrayOp : CIR_Op<"delete.array">,
38653830
will be translated to `cir.delete.array %ptr`.
38663831
}];
38673832
let assemblyFormat = "$address `:` type($address) attr-dict";
3868-
let hasVerifier = 0;
38693833
}
38703834

38713835
//===----------------------------------------------------------------------===//
@@ -3958,7 +3922,6 @@ class CIR_CallOp<string mnemonic, list<Trait> extra_traits = []> :
39583922

39593923
let hasCustomAssemblyFormat = 1;
39603924
let skipDefaultBuilders = 1;
3961-
let hasVerifier = 0;
39623925

39633926
dag commonArgs = (ins
39643927
OptionalAttr<FlatSymbolRefAttr>:$callee,
@@ -4310,7 +4273,6 @@ def TryOp : CIR_Op<"try",
43104273
}];
43114274

43124275
// Everything already covered elsewhere.
4313-
let hasVerifier = 0;
43144276
let builders = [
43154277
OpBuilder<(ins
43164278
"llvm::function_ref<void(mlir::OpBuilder &, mlir::Location)>":$tryBuilder,
@@ -4390,8 +4352,6 @@ def EhInflightOp : CIR_Op<"eh.inflight_exception"> {
43904352
($sym_type_list^)?
43914353
attr-dict
43924354
}];
4393-
4394-
let hasVerifier = 0;
43954355
}
43964356

43974357
def EhTypeIdOp : CIR_Op<"eh.typeid",
@@ -4407,8 +4367,6 @@ def EhTypeIdOp : CIR_Op<"eh.typeid",
44074367
let assemblyFormat = [{
44084368
$type_sym attr-dict
44094369
}];
4410-
4411-
let hasVerifier = 0;
44124370
}
44134371

44144372
//===----------------------------------------------------------------------===//
@@ -4875,7 +4833,6 @@ def AssumeOp : CIR_Op<"assume"> {
48754833
}];
48764834

48774835
let arguments = (ins CIR_BoolType:$predicate);
4878-
let results = (outs);
48794836

48804837
let assemblyFormat = [{
48814838
$predicate `:` type($predicate) attr-dict
@@ -4995,29 +4952,25 @@ def ExpectOp : CIR_Op<"expect",
49954952
def VAStartOp : CIR_Op<"va.start">, Arguments<(ins CIR_PointerType:$arg_list)> {
49964953
let summary = "Starts a variable argument list";
49974954
let assemblyFormat = "$arg_list attr-dict `:` type(operands)";
4998-
let hasVerifier = 0;
49994955
}
50004956

50014957
def VAEndOp : CIR_Op<"va.end">, Arguments<(ins CIR_PointerType:$arg_list)> {
50024958
let summary = "Ends a variable argument list";
50034959
let assemblyFormat = "$arg_list attr-dict `:` type(operands)";
5004-
let hasVerifier = 0;
50054960
}
50064961

50074962
def VACopyOp : CIR_Op<"va.copy">,
50084963
Arguments<(ins CIR_PointerType:$dst_list,
50094964
CIR_PointerType:$src_list)> {
50104965
let summary = "Copies a variable argument list";
50114966
let assemblyFormat = "$src_list `to` $dst_list attr-dict `:` type(operands)";
5012-
let hasVerifier = 0;
50134967
}
50144968

50154969
def VAArgOp : CIR_Op<"va.arg">,
50164970
Results<(outs CIR_AnyType:$result)>,
50174971
Arguments<(ins CIR_PointerType:$arg_list)> {
50184972
let summary = "Fetches next variadic element as a given type";
50194973
let assemblyFormat = "$arg_list attr-dict `:` functional-type(operands, $result)";
5020-
let hasVerifier = 0;
50214974
}
50224975

50234976
//===----------------------------------------------------------------------===//
@@ -5053,9 +5006,6 @@ def AllocExceptionOp : CIR_Op<"alloc.exception"> {
50535006
let assemblyFormat = [{
50545007
$size `->` qualified(type($addr)) attr-dict
50555008
}];
5056-
5057-
// Constraints verified elsewhere.
5058-
let hasVerifier = 0;
50595009
}
50605010

50615011
def FreeExceptionOp : CIR_Op<"free.exception"> {
@@ -5081,14 +5031,10 @@ def FreeExceptionOp : CIR_Op<"free.exception"> {
50815031
}];
50825032

50835033
let arguments = (ins CIR_VoidPtrType:$ptr);
5084-
let results = (outs);
50855034

50865035
let assemblyFormat = [{
50875036
$ptr attr-dict
50885037
}];
5089-
5090-
// Constraints already described.
5091-
let hasVerifier = 0;
50925038
}
50935039

50945040
//===----------------------------------------------------------------------===//
@@ -5697,13 +5643,10 @@ def AtomicFence : CIR_Op<"atomic.fence"> {
56975643
}];
56985644
let arguments = (ins Arg<MemOrder, "memory order">:$ordering,
56995645
OptionalAttr<MemScopeKind>:$syncscope);
5700-
let results = (outs);
57015646

57025647
let assemblyFormat = [{
57035648
(`syncscope` `(` $syncscope^ `)`)? $ordering attr-dict
57045649
}];
5705-
5706-
let hasVerifier = 0;
57075650
}
57085651

57095652
def SignBitOp : CIR_Op<"signbit", [Pure]> {
@@ -5723,7 +5666,7 @@ def SignBitOp : CIR_Op<"signbit", [Pure]> {
57235666
// LinkerOptionsOp
57245667
//===----------------------------------------------------------------------===//
57255668

5726-
def LinkerOptionsOp : CIR_Op<"linker_options"> {
5669+
def LinkerOptionsOp : CIR_Op<"linker_options", [HasParent<"mlir::ModuleOp">]> {
57275670
let summary = "Options to pass to the linker when the object file is linked";
57285671
let description = [{
57295672
Pass the given options to the linker when the resulting object file
@@ -5745,8 +5688,6 @@ def LinkerOptionsOp : CIR_Op<"linker_options"> {
57455688
let assemblyFormat = [{
57465689
$options attr-dict
57475690
}];
5748-
5749-
let hasVerifier = 1;
57505691
}
57515692

57525693
//===----------------------------------------------------------------------===//

clang/include/clang/CIR/Dialect/IR/CIRStdOps.td

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class CIRStdOp<string functionName, dag args, dag res, list<Trait> traits = []>:
1717
CIR_Op<"std." # functionName, traits> {
1818
string funcName = functionName;
19-
19+
2020
let arguments = !con((ins FlatSymbolRefAttr:$original_fn), args);
2121

2222
let summary = "std::" # functionName # "()";
@@ -48,8 +48,6 @@ class CIRStdOp<string functionName, dag args, dag res, list<Trait> traits = []>:
4848
let assemblyFormat = !strconcat("`(` ", argsAssemblyFormat,
4949
" `,` $original_fn `)`", resultAssemblyFormat,
5050
" attr-dict");
51-
52-
let hasVerifier = 0;
5351
}
5452

5553
def StdFindOp : CIRStdOp<"find",
@@ -59,7 +57,7 @@ def StdFindOp : CIRStdOp<"find",
5957
def IterBeginOp: CIRStdOp<"begin",
6058
(ins CIR_AnyType:$container),
6159
(outs CIR_AnyType:$result)>;
62-
def IterEndOp: CIRStdOp<"end",
60+
def IterEndOp: CIRStdOp<"end",
6361
(ins CIR_AnyType:$container),
6462
(outs CIR_AnyType:$result)>;
6563

clang/lib/CIR/Dialect/IR/CIRDialect.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4029,18 +4029,6 @@ LogicalResult cir::CatchParamOp::verify() {
40294029
return success();
40304030
}
40314031

4032-
//===----------------------------------------------------------------------===//
4033-
// LinkerOptionsOp
4034-
//===----------------------------------------------------------------------===//
4035-
4036-
LogicalResult cir::LinkerOptionsOp::verify() {
4037-
if (mlir::Operation *parentOp = (*this)->getParentOp();
4038-
parentOp && !isa<mlir::ModuleOp>(parentOp))
4039-
return emitOpError("must appear at the module level");
4040-
4041-
return success();
4042-
}
4043-
40444032
//===----------------------------------------------------------------------===//
40454033
// TableGen'd op method definitions
40464034
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)