@@ -368,7 +368,7 @@ struct FusionCandidate {
368368 Valid = false ;
369369 }
370370
371- bool reportInvalidCandidate (llvm:: Statistic &Stat) const {
371+ bool reportInvalidCandidate (Statistic &Stat) const {
372372 using namespace ore ;
373373 assert (L && Preheader && " Fusion candidate not initialized properly!" );
374374#if LLVM_ENABLE_STATS
@@ -445,6 +445,7 @@ struct FusionCandidateCompare {
445445 " No dominance relationship between these fusion candidates!" );
446446 }
447447};
448+ } // namespace
448449
449450using LoopVector = SmallVector<Loop *, 4 >;
450451
@@ -461,9 +462,15 @@ using LoopVector = SmallVector<Loop *, 4>;
461462using FusionCandidateSet = std::set<FusionCandidate, FusionCandidateCompare>;
462463using FusionCandidateCollection = SmallVector<FusionCandidateSet, 4 >;
463464
464- #if !defined(NDEBUG)
465- static llvm::raw_ostream &operator <<(llvm::raw_ostream &OS,
466- const FusionCandidate &FC) {
465+ #ifndef NDEBUG
466+ static void printLoopVector (const LoopVector &LV) {
467+ dbgs () << " ****************************\n " ;
468+ for (const Loop *L : LV)
469+ printLoop (*L, dbgs ());
470+ dbgs () << " ****************************\n " ;
471+ }
472+
473+ static raw_ostream &operator <<(raw_ostream &OS, const FusionCandidate &FC) {
467474 if (FC.isValid ())
468475 OS << FC.Preheader ->getName ();
469476 else
@@ -472,8 +479,8 @@ static llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
472479 return OS;
473480}
474481
475- static llvm:: raw_ostream &operator <<(llvm:: raw_ostream &OS,
476- const FusionCandidateSet &CandSet) {
482+ static raw_ostream &operator <<(raw_ostream &OS,
483+ const FusionCandidateSet &CandSet) {
477484 for (const FusionCandidate &FC : CandSet)
478485 OS << FC << ' \n ' ;
479486
@@ -489,7 +496,9 @@ printFusionCandidates(const FusionCandidateCollection &FusionCandidates) {
489496 dbgs () << " ****************************\n " ;
490497 }
491498}
492- #endif
499+ #endif // NDEBUG
500+
501+ namespace {
493502
494503// / Collect all loops in function at the same nest level, starting at the
495504// / outermost level.
@@ -550,15 +559,6 @@ struct LoopDepthTree {
550559 LoopsOnLevelTy LoopsOnLevel;
551560};
552561
553- #ifndef NDEBUG
554- static void printLoopVector (const LoopVector &LV) {
555- dbgs () << " ****************************\n " ;
556- for (auto *L : LV)
557- printLoop (*L, dbgs ());
558- dbgs () << " ****************************\n " ;
559- }
560- #endif
561-
562562struct LoopFuser {
563563private:
564564 // Sets of control flow equivalent fusion candidates for a given nest level.
@@ -1850,7 +1850,7 @@ struct LoopFuser {
18501850 // / <Cand1 Preheader> and <Cand2 Preheader>: <Stat Description>
18511851 template <typename RemarkKind>
18521852 void reportLoopFusion (const FusionCandidate &FC0, const FusionCandidate &FC1,
1853- llvm:: Statistic &Stat) {
1853+ Statistic &Stat) {
18541854 assert (FC0.Preheader && FC1.Preheader &&
18551855 " Expecting valid fusion candidates" );
18561856 using namespace ore ;
0 commit comments