[Mlir-commits] [mlir] edea31e - [MLIR] fix some copy/paste issues in the doc for Interface examples (NFC)

Mehdi Amini llvmlistbot at llvm.org
Wed Aug 16 22:39:28 PDT 2023


Author: Mehdi Amini
Date: 2023-08-16T22:39:17-07:00
New Revision: edea31e131277180fc87223a88c55e6c402ea54b

URL: https://github.com/llvm/llvm-project/commit/edea31e131277180fc87223a88c55e6c402ea54b
DIFF: https://github.com/llvm/llvm-project/commit/edea31e131277180fc87223a88c55e6c402ea54b.diff

LOG: [MLIR] fix some copy/paste issues in the doc for Interface examples (NFC)

Added: 
    

Modified: 
    mlir/docs/Interfaces.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/Interfaces.md b/mlir/docs/Interfaces.md
index a299feb54cba79..f9f95d17a74eac 100644
--- a/mlir/docs/Interfaces.md
+++ b/mlir/docs/Interfaces.md
@@ -563,8 +563,7 @@ def MyInterface : OpInterface<"MyInterface"> {
 
         template <typename ConcreteOp>
         struct Model : public Concept {
-          Operation *create(Operation *opaqueOp, OpBuilder &builder,
-                            Location loc) const override {
+          unsigned getNumInputsAndOutputs(Operation *opaqueOp) const override {
             ConcreteOp op = cast<ConcreteOp>(opaqueOp);
             return op.getNumInputs() + op.getNumOutputs();
           }
@@ -593,7 +592,7 @@ def MyInterface : OpInterface<"MyInterface"> {
       public:
         bool isSafeToTransform() {
           ConcreteOp op = cast<ConcreteOp>(this->getOperation());
-          return op.getNumInputs() + op.getNumOutputs();
+          return op.getProperties().hasFlag;
         }
       };
       ```
@@ -619,6 +618,7 @@ def MyInterface : OpInterface<"MyInterface"> {
     }],
       "bool", "isSafeToTransform", (ins), /*methodBody=*/[{}],
       /*defaultImplementation=*/[{
+        return $_op.getProperties().hasFlag;
     }]>,
   ];
 }


        


More information about the Mlir-commits mailing list