[Mlir-commits] [mlir] 23d5055 - [NFC] Improve debug message in getAsIntegerSet
Uday Bondhugula
llvmlistbot at llvm.org
Wed Nov 24 19:21:18 PST 2021
Author: Uday Bondhugula
Date: 2021-11-25T08:50:21+05:30
New Revision: 23d505571d5180e497b88bde6719d6f2e9879f1a
URL: https://github.com/llvm/llvm-project/commit/23d505571d5180e497b88bde6719d6f2e9879f1a
DIFF: https://github.com/llvm/llvm-project/commit/23d505571d5180e497b88bde6719d6f2e9879f1a.diff
LOG: [NFC] Improve debug message in getAsIntegerSet
Improve debug message in getAsIntegerSet. Add missing trailing new line
and position info.
Differential Revision: https://reviews.llvm.org/D114511
Added:
Modified:
mlir/lib/Analysis/AffineStructures.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Analysis/AffineStructures.cpp b/mlir/lib/Analysis/AffineStructures.cpp
index 1742077a67f4d..c0465a2532b46 100644
--- a/mlir/lib/Analysis/AffineStructures.cpp
+++ b/mlir/lib/Analysis/AffineStructures.cpp
@@ -3566,12 +3566,20 @@ IntegerSet FlatAffineConstraints::getAsIntegerSet(MLIRContext *context) const {
if (failed(computeLocalVars(*this, memo, context))) {
// Check if the local variables without an explicit representation have
// zero coefficients everywhere.
- for (unsigned i = getNumDimAndSymbolIds(), e = getNumIds(); i < e; ++i) {
- if (!memo[i] && !isColZero(*this, /*pos=*/i)) {
- LLVM_DEBUG(llvm::dbgs() << "one or more local exprs do not have an "
- "explicit representation");
- return IntegerSet();
- }
+ SmallVector<unsigned> noLocalRepVars;
+ unsigned numDimsSymbols = getNumDimAndSymbolIds();
+ for (unsigned i = numDimsSymbols, e = getNumIds(); i < e; ++i) {
+ if (!memo[i] && !isColZero(*this, /*pos=*/i))
+ noLocalRepVars.push_back(i - numDimsSymbols);
+ }
+ if (!noLocalRepVars.empty()) {
+ LLVM_DEBUG({
+ llvm::dbgs() << "local variables at position(s) ";
+ llvm::interleaveComma(noLocalRepVars, llvm::dbgs());
+ llvm::dbgs() << " do not have an explicit representation in:\n";
+ this->dump();
+ });
+ return IntegerSet();
}
}
More information about the Mlir-commits
mailing list