21
21
#include " mlir/Transforms/InliningUtils.h"
22
22
#include " llvm/ADT/SCCIterator.h"
23
23
#include " llvm/ADT/STLExtras.h"
24
- #include " llvm/Support/Debug .h"
24
+ #include " llvm/Support/DebugLog .h"
25
25
26
26
#define DEBUG_TYPE " inlining"
27
27
@@ -614,10 +614,10 @@ Inliner::Impl::inlineCallsInSCC(InlinerInterfaceImpl &inlinerIface,
614
614
std::vector<InlineHistoryT> callHistory (calls.size (), InlineHistoryT{});
615
615
616
616
LLVM_DEBUG ({
617
- llvm::dbgs () << " * Inliner: Initial calls in SCC are: {\n " ;
617
+ LDBG () << " * Inliner: Initial calls in SCC are: {" ;
618
618
for (unsigned i = 0 , e = calls.size (); i < e; ++i)
619
- llvm::dbgs () << " " << i << " . " << calls[i].call << " ,\n " ;
620
- llvm::dbgs () << " }\n " ;
619
+ LDBG () << " " << i << " . " << calls[i].call << " ," ;
620
+ LDBG () << " }" ;
621
621
});
622
622
623
623
// Try to inline each of the call operations. Don't cache the end iterator
@@ -635,9 +635,9 @@ Inliner::Impl::inlineCallsInSCC(InlinerInterfaceImpl &inlinerIface,
635
635
CallOpInterface call = it.call ;
636
636
LLVM_DEBUG ({
637
637
if (doInline)
638
- llvm::dbgs () << " * Inlining call: " << i << " . " << call << " \n " ;
638
+ LDBG () << " * Inlining call: " << i << " . " << call;
639
639
else
640
- llvm::dbgs () << " * Not inlining call: " << i << " . " << call << " \n " ;
640
+ LDBG () << " * Not inlining call: " << i << " . " << call;
641
641
});
642
642
if (!doInline)
643
643
continue ;
@@ -654,7 +654,7 @@ Inliner::Impl::inlineCallsInSCC(InlinerInterfaceImpl &inlinerIface,
654
654
cast<CallableOpInterface>(targetRegion->getParentOp ()),
655
655
targetRegion, /* shouldCloneInlinedRegion=*/ !inlineInPlace);
656
656
if (failed (inlineResult)) {
657
- LLVM_DEBUG ( llvm::dbgs ( ) << " ** Failed to inline\n " ) ;
657
+ LDBG ( ) << " ** Failed to inline" ;
658
658
continue ;
659
659
}
660
660
inlinedAnyCalls = true ;
@@ -667,19 +667,16 @@ Inliner::Impl::inlineCallsInSCC(InlinerInterfaceImpl &inlinerIface,
667
667
auto historyToString = [](InlineHistoryT h) {
668
668
return h.has_value () ? std::to_string (*h) : " root" ;
669
669
};
670
- (void )historyToString;
671
- LLVM_DEBUG (llvm::dbgs ()
672
- << " * new inlineHistory entry: " << newInlineHistoryID << " . ["
673
- << getNodeName (call) << " , " << historyToString (inlineHistoryID)
674
- << " ]\n " );
670
+ LDBG () << " * new inlineHistory entry: " << newInlineHistoryID << " . ["
671
+ << getNodeName (call) << " , " << historyToString (inlineHistoryID)
672
+ << " ]" ;
675
673
676
674
for (unsigned k = prevSize; k != calls.size (); ++k) {
677
675
callHistory.push_back (newInlineHistoryID);
678
- LLVM_DEBUG (llvm::dbgs () << " * new call " << k << " {" << calls[i].call
679
- << " }\n with historyID = " << newInlineHistoryID
680
- << " , added due to inlining of\n call {" << call
681
- << " }\n with historyID = "
682
- << historyToString (inlineHistoryID) << " \n " );
676
+ LDBG () << " * new call " << k << " {" << calls[k].call
677
+ << " }\n with historyID = " << newInlineHistoryID
678
+ << " , added due to inlining of\n call {" << call
679
+ << " }\n with historyID = " << historyToString (inlineHistoryID);
683
680
}
684
681
685
682
// If the inlining was successful, Merge the new uses into the source node.
0 commit comments