-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[mlir] Use LDBG to replace LLVM_DEBUG in IntegerRelation.cpp (NFC) #166772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mlir] Use LDBG to replace LLVM_DEBUG in IntegerRelation.cpp (NFC) #166772
Conversation
|
@llvm/pr-subscribers-mlir-presburger @llvm/pr-subscribers-mlir Author: lonely eagle (linuxlonelyeagle) ChangesFull diff: https://github.com/llvm/llvm-project/pull/166772.diff 1 Files Affected:
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());
}
|
|
LGTM. Is this just for readability improvement? |
Yes. |
|
LDGB is a recently added logging macro that is providing some standardized output format, with a per-line header, as well as support for logging-levels. See: https://llvm.org/docs/ProgrammersManual.html#the-ldbg-and-llvm-debug-macros-and-debug-option |
No description provided.