Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Instrument loop pass manager #7039

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/Analysis/LoopPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/TimeProfiler.h" // HLSL Change
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
Expand Down Expand Up @@ -199,6 +200,10 @@ bool LPPassManager::runOnFunction(Function &F) {
LI = &LIWP.getLoopInfo();
bool Changed = false;

// HLSL Change Begin - Support hierarchial time tracing.
llvm::TimeTraceScope FunctionScope("Loop Pass Manager Function", F.getName());
// HLSL Change End

// Collect inherited analysis from Module level pass manager.
populateInheritedAnalysis(TPM->activeStack);

Expand Down Expand Up @@ -248,6 +253,10 @@ bool LPPassManager::runOnFunction(Function &F) {
PassManagerPrettyStackEntry X(P, *CurrentLoop->getHeader());
TimeRegion PassTimer(getPassTimer(P));

// HLSL Change Begin - Support hierarchial time tracing.
llvm::TimeTraceScope PassScope("RunLoopPass", P->getPassName());
// HLSL Change End - Support hierarchial time tracing.

Changed |= P->runOnLoop(CurrentLoop, *this);
}

Expand Down
Loading