Index: llvm/lib/CodeGen/RegAllocGreedy.cpp =================================================================== --- llvm/lib/CodeGen/RegAllocGreedy.cpp +++ llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -552,13 +552,7 @@ unsigned &FoldedSpills); /// Report the number of spills and reloads for each loop. - void reportNumberOfSplillsReloads() { - for (MachineLoop *L : *Loops) { - unsigned Reloads, FoldedReloads, Spills, FoldedSpills; - reportNumberOfSplillsReloads(L, Reloads, FoldedReloads, Spills, - FoldedSpills); - } - } + void reportNumberOfSplillsReloads(); }; } // end anonymous namespace @@ -3183,6 +3177,16 @@ } } +void RAGreedy::reportNumberOfSplillsReloads() { + if (!ORE->allowExtraAnalysis(DEBUG_TYPE)) + return; + for (MachineLoop *L : *Loops) { + unsigned Reloads, FoldedReloads, Spills, FoldedSpills; + reportNumberOfSplillsReloads(L, Reloads, FoldedReloads, Spills, + FoldedSpills); + } +} + bool RAGreedy::runOnMachineFunction(MachineFunction &mf) { LLVM_DEBUG(dbgs() << "********** GREEDY REGISTER ALLOCATION **********\n" << "********** Function: " << mf.getName() << '\n');