#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(
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;
#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"
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) {