Skip to content

Commit b537963

Browse files
committed
[MLIR] NFC. Add missing const on affine analysis utils methods
NFC. Add missing const on affine analysis utils ComputationSliceState methods. Differential Revision: https://reviews.llvm.org/D150523
1 parent be4ced6 commit b537963

File tree

2 files changed

+5
-5
lines changed
  • mlir

2 files changed

+5
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,13 @@ struct ComputationSliceState {
277277
// Constraints are added for all loop IV bounds (dim or symbol), and
278278
// constraints are added for slice bounds in 'lbs'/'ubs'.
279279
// Returns failure if we cannot add loop bounds because of unsupported cases.
280-
LogicalResult getAsConstraints(FlatAffineValueConstraints *cst);
280+
LogicalResult getAsConstraints(FlatAffineValueConstraints *cst) const;
281281

282282
/// Adds to 'cst' constraints which represent the original loop bounds on
283283
/// 'ivs' in 'this'. This corresponds to the original domain of the loop nest
284284
/// from which the slice is being computed. Returns failure if we cannot add
285285
/// loop bounds because of unsupported cases.
286-
LogicalResult getSourceAsConstraints(FlatAffineValueConstraints &cst);
286+
LogicalResult getSourceAsConstraints(FlatAffineValueConstraints &cst) const;
287287

288288
// Clears all bounds and operands in slice state.
289289
void clearBounds();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,8 @@ void mlir::affine::getEnclosingAffineOps(Operation &op,
533533

534534
// Populates 'cst' with FlatAffineValueConstraints which represent original
535535
// domain of the loop bounds that define 'ivs'.
536-
LogicalResult
537-
ComputationSliceState::getSourceAsConstraints(FlatAffineValueConstraints &cst) {
536+
LogicalResult ComputationSliceState::getSourceAsConstraints(
537+
FlatAffineValueConstraints &cst) const {
538538
assert(!ivs.empty() && "Cannot have a slice without its IVs");
539539
cst = FlatAffineValueConstraints(/*numDims=*/ivs.size(), /*numSymbols=*/0,
540540
/*numLocals=*/0, ivs);
@@ -549,7 +549,7 @@ ComputationSliceState::getSourceAsConstraints(FlatAffineValueConstraints &cst) {
549549

550550
// Populates 'cst' with FlatAffineValueConstraints which represent slice bounds.
551551
LogicalResult
552-
ComputationSliceState::getAsConstraints(FlatAffineValueConstraints *cst) {
552+
ComputationSliceState::getAsConstraints(FlatAffineValueConstraints *cst) const {
553553
assert(!lbOperands.empty());
554554
// Adds src 'ivs' as dimension variables in 'cst'.
555555
unsigned numDims = ivs.size();

0 commit comments

Comments
 (0)