[mlir] NFC - Add AffineMinMaxOpBase getDim/SymbolOperands
authorNicolas Vasilache <ntv@google.com>
Tue, 2 Jun 2020 22:04:10 +0000 (18:04 -0400)
committerNicolas Vasilache <ntv@google.com>
Tue, 2 Jun 2020 22:04:45 +0000 (18:04 -0400)
mlir/include/mlir/Dialect/Affine/IR/AffineOps.td

index 3366ef4..9329f3d 100644 (file)
@@ -460,6 +460,14 @@ class AffineMinMaxOpBase<string mnemonic, list<OpTrait> traits = []> :
     static StringRef getMapAttrName() { return "map"; }
     AffineMap getAffineMap() { return map(); }
     ValueRange getMapOperands() { return operands(); }
+    ValueRange getDimOperands() {
+      return OperandRange{operands().begin(),
+                        operands().begin() + map().getNumDims()};
+    }
+    ValueRange getSymbolOperands() {
+      return OperandRange{operands().begin() + map().getNumDims(),
+                        operands().end()};
+    }
   }];
   let verifier = [{ return ::verifyAffineMinMaxOp(*this); }];
   let printer = [{ return ::printAffineMinMaxOp(p, *this); }];