File tree Expand file tree Collapse file tree 3 files changed +1
-52
lines changed
include/clang/CIR/Dialect/IR Expand file tree Collapse file tree 3 files changed +1
-52
lines changed Original file line number Diff line number Diff line change 33
33
#include " clang/CIR/Interfaces/CIROpInterfaces.h"
34
34
#include " clang/CIR/MissingFeatures.h"
35
35
36
- namespace mlir {
37
- namespace OpTrait {
38
-
39
- namespace impl {
40
- // These functions are out-of-line implementations of the methods in the
41
- // corresponding trait classes. This avoids them being template
42
- // instantiated/duplicated.
43
- LogicalResult verifySameFirstOperandAndResultType (Operation *op);
44
- } // namespace impl
45
-
46
- // / This class provides verification for ops that are known to have the same
47
- // / first operand and result type.
48
- // /
49
- template <typename ConcreteType>
50
- class SameFirstOperandAndResultType
51
- : public TraitBase<ConcreteType, SameFirstOperandAndResultType> {
52
- public:
53
- static llvm::LogicalResult verifyTrait (Operation *op) {
54
- return impl::verifySameFirstOperandAndResultType (op);
55
- }
56
- };
57
-
58
- } // namespace OpTrait
59
- } // namespace mlir
60
-
61
36
using BuilderCallbackRef =
62
37
llvm::function_ref<void (mlir::OpBuilder &, mlir::Location)>;
63
38
using BuilderOpStateCallbackRef = llvm::function_ref<void (
Original file line number Diff line number Diff line change @@ -80,13 +80,6 @@ class LLVMLoweringInfo {
80
80
class CIR_Op<string mnemonic, list<Trait> traits = []> :
81
81
Op<CIR_Dialect, mnemonic, traits>, LLVMLoweringInfo;
82
82
83
- //===----------------------------------------------------------------------===//
84
- // CIR Op Traits
85
- //===----------------------------------------------------------------------===//
86
-
87
- def SameFirstOperandAndResultType :
88
- NativeOpTrait<"SameFirstOperandAndResultType">;
89
-
90
83
//===----------------------------------------------------------------------===//
91
84
// CastOp
92
85
//===----------------------------------------------------------------------===//
@@ -243,7 +236,7 @@ def CastOp : CIR_Op<"cast",
243
236
//===----------------------------------------------------------------------===//
244
237
245
238
def PtrStrideOp : CIR_Op<"ptr_stride",
246
- [Pure, SameFirstOperandAndResultType ]> {
239
+ [Pure, AllTypesMatch<["base", "result"]> ]> {
247
240
let summary = "Pointer access with stride";
248
241
let description = [{
249
242
Given a base pointer as first operand, provides a new pointer after applying
Original file line number Diff line number Diff line change @@ -1374,25 +1374,6 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
1374
1374
}
1375
1375
}
1376
1376
1377
- // ===----------------------------------------------------------------------===//
1378
- // CIR defined traits
1379
- // ===----------------------------------------------------------------------===//
1380
-
1381
- LogicalResult
1382
- mlir::OpTrait::impl::verifySameFirstOperandAndResultType (Operation *op) {
1383
- if (failed (verifyAtLeastNOperands (op, 1 )) || failed (verifyOneResult (op)))
1384
- return failure ();
1385
-
1386
- const Type type = op->getResult (0 ).getType ();
1387
- const Type opType = op->getOperand (0 ).getType ();
1388
-
1389
- if (type != opType)
1390
- return op->emitOpError ()
1391
- << " requires the same type for first operand and result" ;
1392
-
1393
- return success ();
1394
- }
1395
-
1396
1377
// TODO(CIR): The properties of functions that require verification haven't
1397
1378
// been implemented yet.
1398
1379
mlir::LogicalResult cir::FuncOp::verify () { return success (); }
You can’t perform that action at this time.
0 commit comments