Skip to content

Commit

Permalink
Wrap debug dump in LLVM_DEBUG
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 267774506
  • Loading branch information
joker-eph authored and tensorflower-gardener committed Sep 7, 2019
1 parent 6e5d1b9 commit 53bb528
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions mlir/lib/ExecutionEngine/ExecutionEngine.cpp
Expand Up @@ -36,10 +36,13 @@
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/ToolOutputFile.h"

#define DEBUG_TYPE "execution-engine"

using namespace mlir;
using llvm::dbgs;
using llvm::Error;
Expand Down Expand Up @@ -77,12 +80,12 @@ void SimpleObjectCache::notifyObjectCompiled(const Module *M,
std::unique_ptr<MemoryBuffer> SimpleObjectCache::getObject(const Module *M) {
auto I = cachedObjects.find(M->getModuleIdentifier());
if (I == cachedObjects.end()) {
dbgs() << "No object for " << M->getModuleIdentifier()
<< " in cache. Compiling.\n";
LLVM_DEBUG(dbgs() << "No object for " << M->getModuleIdentifier()
<< " in cache. Compiling.\n");
return nullptr;
}
dbgs() << "Object for " << M->getModuleIdentifier()
<< " loaded from cache.\n";
LLVM_DEBUG(dbgs() << "Object for " << M->getModuleIdentifier()
<< " loaded from cache.\n");
return MemoryBuffer::getMemBuffer(I->second->getMemBufferRef());
}

Expand Down

0 comments on commit 53bb528

Please sign in to comment.