[MLIR] NFC. Add missing const on affine analysis utils methods
authorUday Bondhugula <uday@polymagelabs.com>
Sun, 14 May 2023 12:01:51 +0000 (17:31 +0530)
committerUday Bondhugula <uday@polymagelabs.com>
Sun, 14 May 2023 12:03:00 +0000 (17:33 +0530)
NFC. Add missing const on affine analysis utils ComputationSliceState
methods.

Differential Revision: https://reviews.llvm.org/D150523

mlir/include/mlir/Dialect/Affine/Analysis/Utils.h
mlir/lib/Dialect/Affine/Analysis/Utils.cpp

index 518fd5c..7376d9b 100644 (file)
@@ -277,13 +277,13 @@ struct ComputationSliceState {
   // Constraints are added for all loop IV bounds (dim or symbol), and
   // constraints are added for slice bounds in 'lbs'/'ubs'.
   // Returns failure if we cannot add loop bounds because of unsupported cases.
-  LogicalResult getAsConstraints(FlatAffineValueConstraints *cst);
+  LogicalResult getAsConstraints(FlatAffineValueConstraints *cst) const;
 
   /// Adds to 'cst' constraints which represent the original loop bounds on
   /// 'ivs' in 'this'. This corresponds to the original domain of the loop nest
   /// from which the slice is being computed. Returns failure if we cannot add
   /// loop bounds because of unsupported cases.
-  LogicalResult getSourceAsConstraints(FlatAffineValueConstraints &cst);
+  LogicalResult getSourceAsConstraints(FlatAffineValueConstraints &cst) const;
 
   // Clears all bounds and operands in slice state.
   void clearBounds();
index f0caa2e..3687b66 100644 (file)
@@ -533,8 +533,8 @@ void mlir::affine::getEnclosingAffineOps(Operation &op,
 
 // Populates 'cst' with FlatAffineValueConstraints which represent original
 // domain of the loop bounds that define 'ivs'.
-LogicalResult
-ComputationSliceState::getSourceAsConstraints(FlatAffineValueConstraints &cst) {
+LogicalResult ComputationSliceState::getSourceAsConstraints(
+    FlatAffineValueConstraints &cst) const {
   assert(!ivs.empty() && "Cannot have a slice without its IVs");
   cst = FlatAffineValueConstraints(/*numDims=*/ivs.size(), /*numSymbols=*/0,
                                    /*numLocals=*/0, ivs);
@@ -549,7 +549,7 @@ ComputationSliceState::getSourceAsConstraints(FlatAffineValueConstraints &cst) {
 
 // Populates 'cst' with FlatAffineValueConstraints which represent slice bounds.
 LogicalResult
-ComputationSliceState::getAsConstraints(FlatAffineValueConstraints *cst) {
+ComputationSliceState::getAsConstraints(FlatAffineValueConstraints *cst) const {
   assert(!lbOperands.empty());
   // Adds src 'ivs' as dimension variables in 'cst'.
   unsigned numDims = ivs.size();