[Mlir-commits] [mlir] [mlir][affine] use LDBG to replace LLVM_DEBUG in IntegerRelation.cpp (NFC) (PR #166772)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Nov 6 05:26:34 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: lonely eagle (linuxlonelyeagle)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/166772.diff
1 Files Affected:
- (modified) mlir/lib/Analysis/Presburger/IntegerRelation.cpp (+7-7)
``````````diff
diff --git a/mlir/lib/Analysis/Presburger/IntegerRelation.cpp b/mlir/lib/Analysis/Presburger/IntegerRelation.cpp
index 0dcdd5bb97bc8..812043d1af0d9 100644
--- a/mlir/lib/Analysis/Presburger/IntegerRelation.cpp
+++ b/mlir/lib/Analysis/Presburger/IntegerRelation.cpp
@@ -25,6 +25,7 @@
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/DebugLog.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
@@ -716,7 +717,7 @@ bool IntegerRelation::isEmpty() const {
// that aren't the intended use case for IntegerRelation. This is
// needed since FM has a worst case exponential complexity in theory.
if (tmpCst.getNumConstraints() >= kExplosionFactor * getNumVars()) {
- LLVM_DEBUG(llvm::dbgs() << "FM constraint explosion detected\n");
+ LDBG() << "FM constraint explosion detected";
return false;
}
@@ -1943,7 +1944,7 @@ void IntegerRelation::removeTrivialRedundancy() {
// which can prove the existence of a solution if there is one.
void IntegerRelation::fourierMotzkinEliminate(unsigned pos, bool darkShadow,
bool *isResultIntegerExact) {
- LLVM_DEBUG(llvm::dbgs() << "FM input (eliminate pos " << pos << "):\n");
+ LDBG() << "FM input (eliminate pos " << pos << "):";
LLVM_DEBUG(dump());
assert(pos < getNumVars() && "invalid position");
assert(hasConsistentState());
@@ -1955,7 +1956,7 @@ void IntegerRelation::fourierMotzkinEliminate(unsigned pos, bool darkShadow,
LogicalResult ret = gaussianEliminateVar(pos);
(void)ret;
assert(ret.succeeded() && "Gaussian elimination guaranteed to succeed");
- LLVM_DEBUG(llvm::dbgs() << "FM output (through Gaussian elimination):\n");
+ LDBG() << "FM output (through Gaussian elimination):";
LLVM_DEBUG(dump());
return;
}
@@ -1969,7 +1970,7 @@ void IntegerRelation::fourierMotzkinEliminate(unsigned pos, bool darkShadow,
// If it doesn't appear, just remove the column and return.
// TODO: refactor removeColumns to use it from here.
removeVar(pos);
- LLVM_DEBUG(llvm::dbgs() << "FM output:\n");
+ LDBG() << "FM output:";
LLVM_DEBUG(dump());
return;
}
@@ -2052,8 +2053,7 @@ void IntegerRelation::fourierMotzkinEliminate(unsigned pos, bool darkShadow,
}
}
- LLVM_DEBUG(llvm::dbgs() << "FM isResultIntegerExact: " << allLCMsAreOne
- << "\n");
+ LDBG() << "FM isResultIntegerExact: " << allLCMsAreOne;
if (allLCMsAreOne && isResultIntegerExact)
*isResultIntegerExact = true;
@@ -2090,7 +2090,7 @@ void IntegerRelation::fourierMotzkinEliminate(unsigned pos, bool darkShadow,
newRel.normalizeConstraintsByGCD();
newRel.removeTrivialRedundancy();
clearAndCopyFrom(newRel);
- LLVM_DEBUG(llvm::dbgs() << "FM output:\n");
+ LDBG() << "FM output:";
LLVM_DEBUG(dump());
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/166772
More information about the Mlir-commits
mailing list