Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions mlir/lib/Analysis/Presburger/IntegerRelation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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());
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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());
}

Expand Down