[Mlir-commits] [mlir] ec145ba - [MLIR][Presburger] Matrix: inline trivial accessors
Arjun P
llvmlistbot at llvm.org
Wed Jun 1 08:57:43 PDT 2022
Author: Arjun P
Date: 2022-06-01T16:56:46+01:00
New Revision: ec145ba2a3e56f72224e1fc9542a359c205aaff5
URL: https://github.com/llvm/llvm-project/commit/ec145ba2a3e56f72224e1fc9542a359c205aaff5
DIFF: https://github.com/llvm/llvm-project/commit/ec145ba2a3e56f72224e1fc9542a359c205aaff5.diff
LOG: [MLIR][Presburger] Matrix: inline trivial accessors
This resolves a comment from https://reviews.llvm.org/D126708
that was previously missed.
Added:
Modified:
mlir/include/mlir/Analysis/Presburger/Matrix.h
mlir/lib/Analysis/Presburger/Matrix.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Analysis/Presburger/Matrix.h b/mlir/include/mlir/Analysis/Presburger/Matrix.h
index 9973beb1368b..5b53cc5f045f 100644
--- a/mlir/include/mlir/Analysis/Presburger/Matrix.h
+++ b/mlir/include/mlir/Analysis/Presburger/Matrix.h
@@ -72,14 +72,14 @@ class Matrix {
/// Swap the given rows.
void swapRows(unsigned row, unsigned otherRow);
- unsigned getNumRows() const;
+ unsigned getNumRows() const { return nRows; }
- unsigned getNumColumns() const;
+ unsigned getNumColumns() const { return nColumns; }
/// Return the maximum number of rows/columns that can be added without
/// incurring a reallocation.
unsigned getNumReservedRows() const;
- unsigned getNumReservedColumns() const;
+ unsigned getNumReservedColumns() const { return nReservedColumns; }
/// Reserve enough space to resize to the specified number of rows without
/// reallocations.
diff --git a/mlir/lib/Analysis/Presburger/Matrix.cpp b/mlir/lib/Analysis/Presburger/Matrix.cpp
index 672b30b6cb36..17bbb8185ed4 100644
--- a/mlir/lib/Analysis/Presburger/Matrix.cpp
+++ b/mlir/lib/Analysis/Presburger/Matrix.cpp
@@ -28,12 +28,6 @@ Matrix Matrix::identity(unsigned dimension) {
return matrix;
}
-unsigned Matrix::getNumRows() const { return nRows; }
-
-unsigned Matrix::getNumColumns() const { return nColumns; }
-
-unsigned Matrix::getNumReservedColumns() const { return nReservedColumns; }
-
unsigned Matrix::getNumReservedRows() const {
return data.capacity() / nReservedColumns;
}
More information about the Mlir-commits
mailing list