[Mlir-commits] [mlir] 057cae6 - [MLIR][Presburger] Matrix: hide expensive consistency check behind EXPENSIVE_CHECKS macro
Arjun P
llvmlistbot at llvm.org
Tue Feb 14 07:27:52 PST 2023
Author: Arjun P
Date: 2023-02-14T15:28:44Z
New Revision: 057cae64ebc48e994afd85bebfbdcd03b2d23c41
URL: https://github.com/llvm/llvm-project/commit/057cae64ebc48e994afd85bebfbdcd03b2d23c41
DIFF: https://github.com/llvm/llvm-project/commit/057cae64ebc48e994afd85bebfbdcd03b2d23c41.diff
LOG: [MLIR][Presburger] Matrix: hide expensive consistency check behind EXPENSIVE_CHECKS macro
This significantly improves performance of Release assert builds.
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D143728
Added:
Modified:
mlir/lib/Analysis/Presburger/Matrix.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Analysis/Presburger/Matrix.cpp b/mlir/lib/Analysis/Presburger/Matrix.cpp
index 1d664ee3e25ae..4ee81c61a53a3 100644
--- a/mlir/lib/Analysis/Presburger/Matrix.cpp
+++ b/mlir/lib/Analysis/Presburger/Matrix.cpp
@@ -367,9 +367,11 @@ bool Matrix::hasConsistentState() const {
return false;
if (nColumns > nReservedColumns)
return false;
+#ifdef EXPENSIVE_CHECKS
for (unsigned r = 0; r < nRows; ++r)
for (unsigned c = nColumns; c < nReservedColumns; ++c)
if (data[r * nReservedColumns + c] != 0)
return false;
+#endif
return true;
}
More information about the Mlir-commits
mailing list