[Mlir-commits] [mlir] a67072e - [MLIR][Presburger] Fix incorrect doc comment and add const

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Aug 19 03:13:28 PDT 2023


Author: iambrj
Date: 2023-08-19T15:42:48+05:30
New Revision: a67072eeeededc0db58e3e980ccdeefafc87ff66

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

LOG: [MLIR][Presburger] Fix incorrect doc comment and add const

Added: 
    

Modified: 
    mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h
    mlir/lib/Analysis/Presburger/PresburgerRelation.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h b/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h
index ae94d2d96162cd..28af83bdd1316d 100644
--- a/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h
+++ b/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h
@@ -85,17 +85,17 @@ class PresburgerRelation {
   /// Return the intersection of this set and the given set.
   PresburgerRelation intersect(const PresburgerRelation &set) const;
 
-  /// Intersect the given `set` with the range in-place.
+  /// Return the range intersection of the given `set` with `this` relation.
   ///
   /// Formally, let the relation `this` be R: A -> B and `set` is C, then this
-  /// operation modifies R to be A -> (B intersection C).
-  PresburgerRelation intersectRange(PresburgerSet &set);
+  /// operation returns A -> (B intersection C).
+  PresburgerRelation intersectRange(const PresburgerSet &set) const;
 
-  /// Intersect the given `set` with the domain in-place.
+  /// Return the domain intersection of the given `set` with `this` relation.
   ///
   /// Formally, let the relation `this` be R: A -> B and `set` is C, then this
-  /// operation modifies R to be (A intersection C) -> B.
-  PresburgerRelation intersectDomain(const PresburgerSet &set);
+  /// operation returns (A intersection C) -> B.
+  PresburgerRelation intersectDomain(const PresburgerSet &set) const;
 
   /// Invert the relation, i.e. swap its domain and range.
   ///

diff  --git a/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp b/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
index df801b0e41d0f5..abe9651019007d 100644
--- a/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
+++ b/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
@@ -143,7 +143,8 @@ PresburgerRelation::intersect(const PresburgerRelation &set) const {
   return result;
 }
 
-PresburgerRelation PresburgerRelation::intersectRange(PresburgerSet &set) {
+PresburgerRelation
+PresburgerRelation::intersectRange(const PresburgerSet &set) const {
   assert(space.getRangeSpace().isCompatible(set.getSpace()) &&
          "Range of `this` must be compatible with range of `set`");
 
@@ -153,7 +154,7 @@ PresburgerRelation PresburgerRelation::intersectRange(PresburgerSet &set) {
 }
 
 PresburgerRelation
-PresburgerRelation::intersectDomain(const PresburgerSet &set) {
+PresburgerRelation::intersectDomain(const PresburgerSet &set) const {
   assert(space.getDomainSpace().isCompatible(set.getSpace()) &&
          "Domain of `this` must be compatible with range of `set`");
 


        


More information about the Mlir-commits mailing list