forked from OSchip/llvm-project
Add a couple useful LLVM_DEBUG's to the inliner.
This makes it easier to narrow down on ops that are preventing inlining. PiperOrigin-RevId: 286243868
This commit is contained in:
parent
7b3adda8f4
commit
553f794b6f
|
@ -29,8 +29,11 @@
|
|||
#include "mlir/Transforms/InliningUtils.h"
|
||||
#include "mlir/Transforms/Passes.h"
|
||||
#include "llvm/ADT/SCCIterator.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/Parallel.h"
|
||||
|
||||
#define DEBUG_TYPE "inlining"
|
||||
|
||||
using namespace mlir;
|
||||
|
||||
static llvm::cl::opt<bool> disableCanonicalization(
|
||||
|
@ -173,6 +176,10 @@ static LogicalResult inlineCallsInSCC(Inliner &inliner,
|
|||
bool inlinedAnyCalls = false;
|
||||
for (unsigned i = 0; i != calls.size(); ++i) {
|
||||
ResolvedCall &it = calls[i];
|
||||
LLVM_DEBUG({
|
||||
llvm::dbgs() << "* Considering inlining call: ";
|
||||
it.call.dump();
|
||||
});
|
||||
if (!shouldInline(it))
|
||||
continue;
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "mlir/IR/Function.h"
|
||||
#include "mlir/IR/Operation.h"
|
||||
#include "llvm/ADT/MapVector.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
#define DEBUG_TYPE "inlining"
|
||||
|
@ -110,8 +111,13 @@ static bool isLegalToInline(InlinerInterface &interface, Region *src,
|
|||
for (auto &block : *src) {
|
||||
for (auto &op : block) {
|
||||
// Check this operation.
|
||||
if (!interface.isLegalToInline(&op, insertRegion, valueMapping))
|
||||
if (!interface.isLegalToInline(&op, insertRegion, valueMapping)) {
|
||||
LLVM_DEBUG({
|
||||
llvm::dbgs() << "* Illegal to inline because of op: ";
|
||||
op.dump();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
// Check any nested regions.
|
||||
if (interface.shouldAnalyzeRecursively(&op) &&
|
||||
llvm::any_of(op.getRegions(), [&](Region ®ion) {
|
||||
|
|
Loading…
Reference in New Issue