Index: include/llvm/IR/LegacyPassManagers.h =================================================================== --- include/llvm/IR/LegacyPassManagers.h +++ include/llvm/IR/LegacyPassManagers.h @@ -406,14 +406,23 @@ /// Set the initial size of the module if the user has specified that they /// want remarks for size. /// Returns 0 if the remark was not requested. - unsigned initSizeRemarkInfo(Module &M); + unsigned initSizeRemarkInfo( + Module &M, + StringMap> &FunctionToInstrCount); /// Emit a remark signifying that the number of IR instructions in the module /// changed. /// \p F is optionally passed by passes which run on Functions, and thus /// always know whether or not a non-empty function is available. - void emitInstrCountChangedRemark(Pass *P, Module &M, int64_t Delta, - unsigned CountBefore, Function *F = nullptr); + /// + /// \p FunctionToInstrCount maps the name of a \p Function to a pair. The + /// first member of the pair is the IR count of the \p Function before running + /// \p P, and the second member is the IR count of the \p Function after + /// running \p P. + void emitInstrCountChangedRemark( + Pass *P, Module &M, int64_t Delta, unsigned CountBefore, + StringMap> &FunctionToInstrCount, + Function *F = nullptr); protected: // Top level manager. Index: lib/Analysis/CallGraphSCCPass.cpp =================================================================== --- lib/Analysis/CallGraphSCCPass.cpp +++ lib/Analysis/CallGraphSCCPass.cpp @@ -132,10 +132,11 @@ { unsigned InstrCount, SCCCount = 0; + StringMap> FunctionToInstrCount; bool EmitICRemark = M.shouldEmitInstrCountChangedRemark(); TimeRegion PassTimer(getPassTimer(CGSP)); if (EmitICRemark) - InstrCount = initSizeRemarkInfo(M); + InstrCount = initSizeRemarkInfo(M, FunctionToInstrCount); Changed = CGSP->runOnSCC(CurSCC); if (EmitICRemark) { @@ -146,7 +147,8 @@ // Yep. Emit a remark and update InstrCount. int64_t Delta = static_cast(SCCCount) - static_cast(InstrCount); - emitInstrCountChangedRemark(P, M, Delta, InstrCount); + emitInstrCountChangedRemark(P, M, Delta, InstrCount, + FunctionToInstrCount); InstrCount = SCCCount; } } Index: lib/Analysis/LoopPass.cpp =================================================================== --- lib/Analysis/LoopPass.cpp +++ lib/Analysis/LoopPass.cpp @@ -195,10 +195,11 @@ // Walk Loops unsigned InstrCount, FunctionSize = 0; + StringMap> FunctionToInstrCount; bool EmitICRemark = M.shouldEmitInstrCountChangedRemark(); // Collect the initial size of the module and the function we're looking at. if (EmitICRemark) { - InstrCount = initSizeRemarkInfo(M); + InstrCount = initSizeRemarkInfo(M, FunctionToInstrCount); FunctionSize = F.getInstructionCount(); } while (!LQ.empty()) { @@ -226,7 +227,8 @@ if (NewSize != FunctionSize) { int64_t Delta = static_cast(NewSize) - static_cast(FunctionSize); - emitInstrCountChangedRemark(P, M, Delta, InstrCount, &F); + emitInstrCountChangedRemark(P, M, Delta, InstrCount, + FunctionToInstrCount, &F); InstrCount = static_cast(InstrCount) + Delta; FunctionSize = NewSize; } Index: lib/IR/LegacyPassManager.cpp =================================================================== --- lib/IR/LegacyPassManager.cpp +++ lib/IR/LegacyPassManager.cpp @@ -136,15 +136,32 @@ return PassDebugging >= Executions; } -unsigned PMDataManager::initSizeRemarkInfo(Module &M) { +unsigned PMDataManager::initSizeRemarkInfo( + Module &M, StringMap> &FunctionToInstrCount) { // Only calculate getInstructionCount if the size-info remark is requested. - return M.getInstructionCount(); + unsigned InstrCount = 0; + + // Collect instruction counts for every function. We'll use this to emit + // per-function size remarks later. + for (Function &F : M) { + unsigned FCount = F.getInstructionCount(); + + // Insert a record into FunctionToInstrCount keeping track of the current + // size of the function as the first member of a pair. Set the second + // member to 0; if the function is deleted by the pass, then when we get + // here, we'll be able to let the user know that F no longer contributes to + // the module. + FunctionToInstrCount[F.getName().str()] = + std::pair(FCount, 0); + InstrCount += FCount; + } + return InstrCount; } -void PMDataManager::emitInstrCountChangedRemark(Pass *P, Module &M, - int64_t Delta, - unsigned CountBefore, - Function *F) { +void PMDataManager::emitInstrCountChangedRemark( + Pass *P, Module &M, int64_t Delta, unsigned CountBefore, + StringMap> &FunctionToInstrCount, + Function *F) { // If it's a pass manager, don't emit a remark. (This hinges on the assumption // that the only passes that return non-null with getAsPMDataManager are pass // managers.) The reason we have to do this is to avoid emitting remarks for @@ -155,6 +172,34 @@ // Set to true if this isn't a module pass or CGSCC pass. bool CouldOnlyImpactOneFunction = (F != nullptr); + // Helper lambda that updates the changes to the size of some function. + auto UpdateFunctionChanges = + [&FunctionToInstrCount](Function &MaybeChangedFn) { + // Update the total module count. + unsigned FnSize = MaybeChangedFn.getInstructionCount(); + auto It = FunctionToInstrCount.find(MaybeChangedFn.getName()); + + // If we created a new function, then we need to add it to the map and + // say that it changed from 0 instructions to FnSize. + if (It == FunctionToInstrCount.end()) { + std::pair ChangePair(0, FnSize); + FunctionToInstrCount.insert( + std::make_pair(MaybeChangedFn.getName().str(), ChangePair)); + return; + } + // Insert the new function size into the second member of the pair. This + // tells us whether or not this function changed in size. + It->second.second = FnSize; + }; + + // We need to initially update all of the function sizes. + // If no function was passed in, then we're either a module pass or an + // CGSCC pass. + if (!CouldOnlyImpactOneFunction) + std::for_each(M.begin(), M.end(), UpdateFunctionChanges); + else + UpdateFunctionChanges(*F); + // Do we have a function we can use to emit a remark? if (!CouldOnlyImpactOneFunction) { // We need a function containing at least one basic block in order to output @@ -162,7 +207,7 @@ // doesn't actually contain a basic block, we have to go and find one that's // suitable for emitting remarks. auto It = std::find_if(M.begin(), M.end(), - [](const Function &Fn) { return !Fn.empty(); }); + [](const Function &Fn) { return !Fn.empty(); }); // Didn't find a function. Quit. if (It == M.end()) @@ -185,6 +230,55 @@ << "; Delta: " << DiagnosticInfoOptimizationBase::Argument("DeltaInstrCount", Delta); F->getContext().diagnose(R); // Not using ORE for layering reasons. + + // Emit per-function size change remarks separately. + std::string PassName = P->getPassName().str(); + + // Helper lambda that emits a remark when the size of a function has changed. + auto EmitFunctionSizeChangedRemark = [&FunctionToInstrCount, &F, &BB, + &PassName](const std::string &Fname) { + unsigned FnCountBefore, FnCountAfter; + std::pair &Change = FunctionToInstrCount[Fname]; + std::tie(FnCountBefore, FnCountAfter) = Change; + int64_t FnDelta = static_cast(FnCountAfter) - + static_cast(FnCountBefore); + + if (FnDelta == 0) + return; + + // FIXME: We shouldn't use BB for the location here. Unfortunately, because + // the function that we're looking at could have been deleted, we can't use + // it for the source location. We *want* remarks when a function is deleted + // though, so we're kind of stuck here as is. (This remark, along with the + // whole-module size change remarks really ought not to have source + // locations at all.) + OptimizationRemarkAnalysis FR("size-info", "FunctionIRSizeChange", + DiagnosticLocation(), &BB); + FR << DiagnosticInfoOptimizationBase::Argument("Pass", PassName) + << ": Function: " + << DiagnosticInfoOptimizationBase::Argument("Function", Fname) + << ": IR instruction count changed from " + << DiagnosticInfoOptimizationBase::Argument("IRInstrsBefore", + FnCountBefore) + << " to " + << DiagnosticInfoOptimizationBase::Argument("IRInstrsAfter", + FnCountAfter) + << "; Delta: " + << DiagnosticInfoOptimizationBase::Argument("DeltaInstrCount", FnDelta); + F->getContext().diagnose(FR); + + // Update the function size. + Change.first = FnCountAfter; + }; + + // Are we looking at more than one function? If so, emit remarks for all of + // the functions in the module. Otherwise, only emit one remark. + if (!CouldOnlyImpactOneFunction) + std::for_each(FunctionToInstrCount.keys().begin(), + FunctionToInstrCount.keys().end(), + EmitFunctionSizeChangedRemark); + else + EmitFunctionSizeChangedRemark(F->getName().str()); } void PassManagerPrettyStackEntry::print(raw_ostream &OS) const { @@ -1284,9 +1378,10 @@ Module &M = *F.getParent(); unsigned InstrCount, BBSize = 0; + StringMap> FunctionToInstrCount; bool EmitICRemark = M.shouldEmitInstrCountChangedRemark(); if (EmitICRemark) - InstrCount = initSizeRemarkInfo(M); + InstrCount = initSizeRemarkInfo(M, FunctionToInstrCount); for (BasicBlock &BB : F) { // Collect the initial size of the basic block. @@ -1313,7 +1408,8 @@ if (NewSize != BBSize) { int64_t Delta = static_cast(NewSize) - static_cast(BBSize); - emitInstrCountChangedRemark(BP, M, Delta, InstrCount, &F); + emitInstrCountChangedRemark(BP, M, Delta, InstrCount, + FunctionToInstrCount, &F); InstrCount = static_cast(InstrCount) + Delta; BBSize = NewSize; } @@ -1522,10 +1618,11 @@ populateInheritedAnalysis(TPM->activeStack); unsigned InstrCount, FunctionSize = 0; + StringMap> FunctionToInstrCount; bool EmitICRemark = M.shouldEmitInstrCountChangedRemark(); // Collect the initial size of the module. if (EmitICRemark) { - InstrCount = initSizeRemarkInfo(M); + InstrCount = initSizeRemarkInfo(M, FunctionToInstrCount); FunctionSize = F.getInstructionCount(); } @@ -1550,7 +1647,8 @@ if (NewSize != FunctionSize) { int64_t Delta = static_cast(NewSize) - static_cast(FunctionSize); - emitInstrCountChangedRemark(FP, M, Delta, InstrCount, &F); + emitInstrCountChangedRemark(FP, M, Delta, InstrCount, + FunctionToInstrCount, &F); InstrCount = static_cast(InstrCount) + Delta; FunctionSize = NewSize; } @@ -1619,10 +1717,11 @@ Changed |= getContainedPass(Index)->doInitialization(M); unsigned InstrCount, ModuleCount = 0; + StringMap> FunctionToInstrCount; bool EmitICRemark = M.shouldEmitInstrCountChangedRemark(); // Collect the initial size of the module. if (EmitICRemark) { - InstrCount = initSizeRemarkInfo(M); + InstrCount = initSizeRemarkInfo(M, FunctionToInstrCount); ModuleCount = InstrCount; } @@ -1646,7 +1745,8 @@ if (ModuleCount != InstrCount) { int64_t Delta = static_cast(ModuleCount) - static_cast(InstrCount); - emitInstrCountChangedRemark(MP, M, Delta, InstrCount); + emitInstrCountChangedRemark(MP, M, Delta, InstrCount, + FunctionToInstrCount); InstrCount = ModuleCount; } } Index: test/Other/size-remarks.ll =================================================================== --- test/Other/size-remarks.ll +++ test/Other/size-remarks.ll @@ -1,6 +1,8 @@ ; Ensure that IR count remarks in the legacy pass manager work. ; What this test should check for: -; * Positive, nonzero sizes before/after +; * Positive, nonzero sizes before/after for whole-module remarks +; (It's okay to have nonzero sizes in per-function remarks, since a function +; can be created/destroyed by a pass.) ; * Nonzero deltas ; * Sizes are being tracked properly across multiple remarks. E.g, if we have ; original_count_1, final_count_1, and @@ -20,12 +22,16 @@ ; CGSCC-SAME: IR instruction count changed from ; CGSCC-SAME: [[ORIG:[1-9][0-9]*]] to [[FINAL:[1-9][0-9]*]]; ; CGSCC-SAME: Delta: [[DELTA:-?[1-9][0-9]*]] +; CGSCC-NEXT: remark: :0:0: Function Integration/Inlining: +; CGSCC-SAME: Function: bar: IR instruction count changed from +; CGSCC-SAME: [[ORIGFN:[1-9][0-9]*]] to [[FINALFN:[0-9][0-9]*]]; +; CGSCC-SAME: Delta: [[DELTAFN:-?[1-9][0-9]*]] ; CGSCC-NEXT: --- ; CGSCC-DAG: !Analysis ; CGSCC-NEXT: Pass: size-info ; CGSCC-NEXT: Name: IRSizeChange ; CGSCC-NEXT: Function: -; CGSCC-NEXT: Args: +; CGSCC-NEXT: Args: ; CGSCC-NEXT: - Pass: Function Integration/Inlining ; CGSCC-NEXT: - String: ': IR instruction count changed from ' ; CGSCC-NEXT: - IRInstrsBefore: '[[ORIG]]' @@ -33,24 +39,47 @@ ; CGSCC-NEXT: - IRInstrsAfter: '[[FINAL]]' ; CGSCC-NEXT: - String: '; Delta: ' ; CGSCC-NEXT: - DeltaInstrCount: '[[DELTA]]' +; CGSCC-DAG: --- !Analysis +; CGSCC-NEXT: Pass: size-info +; CGSCC-NEXT: Name: FunctionIRSizeChange +; CGSCC-NEXT: Function: +; CGSCC-NEXT: Args: +; CGSCC-NEXT: - Pass: Function Integration/Inlining +; CGSCC-NEXT: - String: ': Function: ' +; CGSCC-NEXT: - Function: bar +; CGSCC-NEXT: - String: ': IR instruction count changed from ' +; CGSCC-NEXT: - IRInstrsBefore: '[[ORIGFN]]' +; CGSCC-NEXT: - String: ' to ' +; CGSCC-NEXT: - IRInstrsAfter: '[[FINALFN]]' +; CGSCC-NEXT: - String: '; Delta: ' +; CGSCC-NEXT: - DeltaInstrCount: '[[DELTAFN]]' +; CGSCC-NEXT: ... ; RUN: opt < %s -instcombine -pass-remarks-analysis='size-info' \ ; RUN:-pass-remarks-output=%t.yaml -S -o /dev/null 2> %t; \ ; RUN: cat %t %t.yaml | FileCheck %s -check-prefix=FUNC ; FUNC: remark: :0:0: Combine redundant instructions: ; FUNC-SAME: IR instruction count changed from -; FUNC-SAME: [[SIZE1:[1-9][0-9]*]] to [[SIZE2:[1-9][0-9]*]]; +; FUNC-SAME: [[SIZE1:[1-9][0-9]*]] to [[SIZE2:[0-9][0-9]*]]; ; FUNC-SAME: Delta: [[DELTA1:-?[1-9][0-9]*]] +; FUNC-NEXT: remark: :0:0: Combine redundant instructions: Function: +; FUNC-SAME: foo: IR instruction count changed from +; FUNC-SAME: [[FOOSIZE1:[1-9][0-9]*]] to [[FOOSIZE2:[0-9][0-9]*]]; +; FUNC-SAME: Delta: [[DELTAFOO:-?[1-9][0-9]*]] ; FUNC-NEXT: remark: :0:0: Combine redundant instructions: ; FUNC-SAME: IR instruction count changed from ; FUNC-SAME: [[SIZE2]] to [[SIZE3:[1-9][0-9]*]]; ; FUNC-SAME: Delta: [[DELTA2:-?[1-9][0-9]*]] +; FUNC-NEXT: remark: :0:0: Combine redundant instructions: Function: +; FUNC-SAME: bar: IR instruction count changed from +; FUNC-SAME: [[BARSIZE1:[1-9][0-9]*]] to [[BARSIZE2:[0-9][0-9]*]]; +; FUNC-SAME: Delta: [[DELTABAR:-?[1-9][0-9]*]] ; FUNC-NEXT: --- ; FUNC-DAG: !Analysis ; FUNC-NEXT: Pass: size-info ; FUNC-NEXT: Name: IRSizeChange ; FUNC-NEXT: Function: -; FUNC-NEXT: Args: +; FUNC-NEXT: Args: ; FUNC-NEXT: - Pass: Combine redundant instructions ; FUNC-NEXT: - String: ': IR instruction count changed from ' ; FUNC-NEXT: - IRInstrsBefore: '[[SIZE1]]' @@ -58,11 +87,25 @@ ; FUNC-NEXT: - IRInstrsAfter: '[[SIZE2]]' ; FUNC-NEXT: - String: '; Delta: ' ; FUNC-NEXT: - DeltaInstrCount: '[[DELTA1]]' +; FUNC-DAG: --- !Analysis +; FUNC-NEXT: Pass: size-info +; FUNC-NEXT: Name: FunctionIRSizeChange +; FUNC-NEXT: Function: +; FUNC-NEXT: Args: +; FUNC-NEXT: - Pass: Combine redundant instructions +; FUNC-NEXT: - String: ': Function: ' +; FUNC-NEXT: - Function: foo +; FUNC-NEXT: - String: ': IR instruction count changed from ' +; FUNC-NEXT: - IRInstrsBefore: '[[FOOSIZE1]]' +; FUNC-NEXT: - String: ' to ' +; FUNC-NEXT: - IRInstrsAfter: '[[FOOSIZE2]]' +; FUNC-NEXT: - String: '; Delta: ' +; FUNC-NEXT: - DeltaInstrCount: '[[DELTAFOO]]' ; FUNC: --- !Analysis ; FUNC-NEXT: Pass: size-info ; FUNC-NEXT: Name: IRSizeChange ; FUNC-NEXT: Function: -; FUNC-NEXT: Args: +; FUNC-NEXT: Args: ; FUNC-NEXT: - Pass: Combine redundant instructions ; FUNC-NEXT: - String: ': IR instruction count changed from ' ; FUNC-NEXT: - IRInstrsBefore: '[[SIZE2]]' @@ -70,6 +113,20 @@ ; FUNC-NEXT: - IRInstrsAfter: '[[SIZE3]]' ; FUNC-NEXT: - String: '; Delta: ' ; FUNC-NEXT: - DeltaInstrCount: '[[DELTA2]]' +; FUNC-DAG: --- !Analysis +; FUNC-NEXT: Pass: size-info +; FUNC-NEXT: Name: FunctionIRSizeChange +; FUNC-NEXT: Function: +; FUNC-NEXT: Args: +; FUNC-NEXT: - Pass: Combine redundant instructions +; FUNC-NEXT: - String: ': Function: ' +; FUNC-NEXT: - Function: bar +; FUNC-NEXT: - String: ': IR instruction count changed from ' +; FUNC-NEXT: - IRInstrsBefore: '[[BARSIZE1]]' +; FUNC-NEXT: - String: ' to ' +; FUNC-NEXT: - IRInstrsAfter: '[[BARSIZE2]]' +; FUNC-NEXT: - String: '; Delta: ' +; FUNC-NEXT: - DeltaInstrCount: '[[DELTABAR]]' ; RUN: opt < %s -globaldce -pass-remarks-analysis='size-info' \ ; RUN: -pass-remarks-output=%t.yaml -S -o /dev/null 2> %t; \ @@ -79,12 +136,16 @@ ; MODULE-SAME: IR instruction count changed from ; MODULE-SAME: [[ORIG:[1-9][0-9]*]] to [[FINAL:[1-9][0-9]*]]; ; MODULE-SAME: Delta: [[DELTA:-?[1-9][0-9]*]] +; MODULE-NEXT: remark: +; MODULE-SAME: Dead Global Elimination: Function: pluto: +; MODULE-SAME: IR instruction count changed from [[ORIGFN:[1-9][0-9]*]] to +; MODULE-SAME: [[FINALFN:[0-9][0-9]*]]; Delta: [[DELTAFN:-?[1-9][0-9]*]] ; MODULE-NEXT: --- ; MODULE-DAG: !Analysis ; MODULE-NEXT: Pass: size-info ; MODULE-NEXT: Name: IRSizeChange ; MODULE-NEXT: Function: -; MODULE-NEXT: Args: +; MODULE-NEXT: Args: ; MODULE-NEXT: - Pass: Dead Global Elimination ; MODULE-NEXT: - String: ': IR instruction count changed from ' ; MODULE-NEXT: - IRInstrsBefore: '[[ORIG]]' @@ -92,6 +153,20 @@ ; MODULE-NEXT: - IRInstrsAfter: '[[FINAL]]' ; MODULE-NEXT: - String: '; Delta: ' ; MODULE-NEXT: - DeltaInstrCount: '[[DELTA]]' +; MODULE-DAG: --- !Analysis +; MODULE-NEXT: Pass: size-info +; MODULE-NEXT: Name: FunctionIRSizeChange +; MODULE-NEXT: Function: +; MODULE-NEXT: Args: +; MODULE-NEXT: - Pass: Dead Global Elimination +; MODULE-NEXT: - String: ': Function: ' +; MODULE-NEXT: - Function: pluto +; MODULE-NEXT: - String: ': IR instruction count changed from ' +; MODULE-NEXT: - IRInstrsBefore: '[[ORIGFN]]' +; MODULE-NEXT: - String: ' to ' +; MODULE-NEXT: - IRInstrsAfter: '[[FINALFN]]' +; MODULE-NEXT: - String: '; Delta: ' +; MODULE-NEXT: - DeltaInstrCount: '[[DELTAFN]]' ; RUN: opt < %s -dce -pass-remarks-analysis='size-info' \ ; RUN: -pass-remarks-output=%t.yaml -S -o /dev/null 2> %t; \ @@ -100,6 +175,9 @@ ; BB-SAME: IR instruction count changed from ; BB-SAME: [[ORIG:[1-9][0-9]*]] to [[FINAL:[1-9][0-9]*]]; ; BB-SAME: Delta: [[DELTA:-?[1-9][0-9]*]] +; BB-NEXT: remark: :0:0: Dead Code Elimination: Function: bar: +; BB-SAME: IR instruction count changed from [[ORIGFN:[1-9][0-9]*]] to +; BB-SAME: [[FINALFN:[0-9][0-9]*]]; Delta: [[DELTAFN:-?[1-9][0-9]*]] ; BB-NEXT: --- ; BB-DAG: !Analysis ; BB-NEXT: Pass: size-info @@ -113,6 +191,20 @@ ; BB-NEXT: - IRInstrsAfter: '[[FINAL]]' ; BB-NEXT: - String: '; Delta: ' ; BB-NEXT: - DeltaInstrCount: '[[DELTA]]' +; BB-DAG: --- !Analysis +; BB-NEXT: Pass: size-info +; BB-NEXT: Name: FunctionIRSizeChange +; BB-NEXT: Function: +; BB-NEXT: Args: +; BB-NEXT: - Pass: Dead Code Elimination +; BB-NEXT: - String: ': Function: ' +; BB-NEXT: - Function: bar +; BB-NEXT: - String: ': IR instruction count changed from ' +; BB-NEXT: - IRInstrsBefore: '[[ORIGFN]]' +; BB-NEXT: - String: ' to ' +; BB-NEXT: - IRInstrsAfter: '[[FINALFN]]' +; BB-NEXT: - String: '; Delta: ' +; BB-NEXT: - DeltaInstrCount: '[[DELTAFN]]' ; RUN: opt < %s -loop-unroll -pass-remarks-analysis='size-info' \ ; RUN: -pass-remarks-output=%t.yaml -S -o /dev/null 2> %t; \ @@ -121,12 +213,18 @@ ; LOOP-SAME: IR instruction count changed from ; LOOP-SAME: [[ORIG:[1-9][0-9]*]] to [[FINAL:[1-9][0-9]*]]; ; LOOP-SAME: Delta: [[DELTA:-?[1-9][0-9]*]] +; LOOP-NEXT: remark: :0:0: Unroll loops: Function: bar: +; LOOP-SAME: IR instruction count changed from [[ORIGFN:[1-9][0-9]*]] +; LOOP-SAME: to [[FINALFN:[0-9][0-9]*]]; +; Since bar is the only function containing a loop, its delta must be identical +; to the whole module remark's delta. +; LOOP-SAME: Delta: [[DELTA]] ; LOOP-NEXT: --- ; LOOP-DAG: !Analysis ; LOOP-NEXT: Pass: size-info ; LOOP-NEXT: Name: IRSizeChange ; LOOP-NEXT: Function: -; LOOP-NEXT: Args: +; LOOP-NEXT: Args: ; LOOP-DAG: - Pass: Unroll loops ; LOOP-NEXT: - String: ': IR instruction count changed from ' ; LOOP-NEXT: - IRInstrsBefore: '[[ORIG]]' @@ -134,6 +232,20 @@ ; LOOP-NEXT: - IRInstrsAfter: '[[FINAL]]' ; LOOP-NEXT: - String: '; Delta: ' ; LOOP-NEXT: - DeltaInstrCount: '[[DELTA]]' +; LOOP-DAG: --- !Analysis +; LOOP-NEXT: Pass: size-info +; LOOP-NEXT: Name: FunctionIRSizeChange +; LOOP-NEXT: Function: +; LOOP-NEXT: Args: +; LOOP-NEXT: - Pass: Unroll loops +; LOOP-NEXT: - String: ': Function: ' +; LOOP-NEXT: - Function: bar +; LOOP-NEXT: - String: ': IR instruction count changed from ' +; LOOP-NEXT: - IRInstrsBefore: '[[ORIGFN]]' +; LOOP-NEXT: - String: ' to ' +; LOOP-NEXT: - IRInstrsAfter: '[[FINALFN]]' +; LOOP-NEXT: - String: '; Delta: ' +; LOOP-NEXT: - DeltaInstrCount: '[[DELTA]]' declare i1 ()* @boop() define internal i1 @pluto() {