Skip to content

Commit b4fc147

Browse files
use LDBG to replace IntegerRelation.cpp.
1 parent f725f84 commit b4fc147

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mlir/lib/Analysis/Presburger/IntegerRelation.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "llvm/ADT/Sequence.h"
2626
#include "llvm/ADT/SmallBitVector.h"
2727
#include "llvm/Support/Debug.h"
28+
#include "llvm/Support/DebugLog.h"
2829
#include "llvm/Support/raw_ostream.h"
2930
#include <algorithm>
3031
#include <cassert>
@@ -716,7 +717,7 @@ bool IntegerRelation::isEmpty() const {
716717
// that aren't the intended use case for IntegerRelation. This is
717718
// needed since FM has a worst case exponential complexity in theory.
718719
if (tmpCst.getNumConstraints() >= kExplosionFactor * getNumVars()) {
719-
LLVM_DEBUG(llvm::dbgs() << "FM constraint explosion detected\n");
720+
LDBG() << "FM constraint explosion detected";
720721
return false;
721722
}
722723

@@ -1943,7 +1944,7 @@ void IntegerRelation::removeTrivialRedundancy() {
19431944
// which can prove the existence of a solution if there is one.
19441945
void IntegerRelation::fourierMotzkinEliminate(unsigned pos, bool darkShadow,
19451946
bool *isResultIntegerExact) {
1946-
LLVM_DEBUG(llvm::dbgs() << "FM input (eliminate pos " << pos << "):\n");
1947+
LDBG() << "FM input (eliminate pos " << pos << "):";
19471948
LLVM_DEBUG(dump());
19481949
assert(pos < getNumVars() && "invalid position");
19491950
assert(hasConsistentState());
@@ -1955,7 +1956,7 @@ void IntegerRelation::fourierMotzkinEliminate(unsigned pos, bool darkShadow,
19551956
LogicalResult ret = gaussianEliminateVar(pos);
19561957
(void)ret;
19571958
assert(ret.succeeded() && "Gaussian elimination guaranteed to succeed");
1958-
LLVM_DEBUG(llvm::dbgs() << "FM output (through Gaussian elimination):\n");
1959+
LDBG() << "FM output (through Gaussian elimination):";
19591960
LLVM_DEBUG(dump());
19601961
return;
19611962
}
@@ -1969,7 +1970,7 @@ void IntegerRelation::fourierMotzkinEliminate(unsigned pos, bool darkShadow,
19691970
// If it doesn't appear, just remove the column and return.
19701971
// TODO: refactor removeColumns to use it from here.
19711972
removeVar(pos);
1972-
LLVM_DEBUG(llvm::dbgs() << "FM output:\n");
1973+
LDBG() << "FM output:";
19731974
LLVM_DEBUG(dump());
19741975
return;
19751976
}
@@ -2052,8 +2053,7 @@ void IntegerRelation::fourierMotzkinEliminate(unsigned pos, bool darkShadow,
20522053
}
20532054
}
20542055

2055-
LLVM_DEBUG(llvm::dbgs() << "FM isResultIntegerExact: " << allLCMsAreOne
2056-
<< "\n");
2056+
LDBG() << "FM isResultIntegerExact: " << allLCMsAreOne;
20572057
if (allLCMsAreOne && isResultIntegerExact)
20582058
*isResultIntegerExact = true;
20592059

@@ -2090,7 +2090,7 @@ void IntegerRelation::fourierMotzkinEliminate(unsigned pos, bool darkShadow,
20902090
newRel.normalizeConstraintsByGCD();
20912091
newRel.removeTrivialRedundancy();
20922092
clearAndCopyFrom(newRel);
2093-
LLVM_DEBUG(llvm::dbgs() << "FM output:\n");
2093+
LDBG() << "FM output:";
20942094
LLVM_DEBUG(dump());
20952095
}
20962096

0 commit comments

Comments
 (0)