diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -117,6 +117,7 @@ #include "llvm/Support/Casting.h" #include "llvm/Support/DOTGraphTraits.h" #include "llvm/Support/GraphWriter.h" +#include "llvm/Support/TimeProfiler.h" #include "llvm/Transforms/Utils/CallGraphUpdater.h" namespace llvm { @@ -1001,8 +1002,10 @@ return AA; } - AA.initialize(*this); - + { + TimeTraceScope TimeScope(AA.getName() + "::initialize"); + AA.initialize(*this); + } // We can initialize (=look at) code outside the current function set but // not call update because that would again spawn new abstract attributes in // potentially unconnected code regions (=SCCs). diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -931,6 +931,7 @@ } void Attributor::runTillFixpoint() { + TimeTraceScope TimeScope("Attributor::runTillFixpoint"); LLVM_DEBUG(dbgs() << "[Attributor] Identified and initialized " << DG.SyntheticRoot.Deps.size() << " abstract attributes.\n"); @@ -1067,6 +1068,7 @@ } ChangeStatus Attributor::manifestAttributes() { + TimeTraceScope TimeScope("Attributor::manifestAttributes"); size_t NumFinalAAs = DG.SyntheticRoot.Deps.size(); unsigned NumManifested = 0; @@ -1129,6 +1131,7 @@ } ChangeStatus Attributor::cleanupIR() { + TimeTraceScope TimeScope("Attributor::cleanupIR"); // Delete stuff at the end to avoid invalid references and a nice order. LLVM_DEBUG(dbgs() << "\n[Attributor] Delete at least " << ToBeDeletedFunctions.size() << " functions and " @@ -1297,6 +1300,8 @@ } ChangeStatus Attributor::run() { + TimeTraceScope TimeScope("Attributor::run"); + SeedingPeriod = false; runTillFixpoint(); @@ -1316,6 +1321,8 @@ } ChangeStatus Attributor::updateAA(AbstractAttribute &AA) { + TimeTraceScope TimeScope(AA.getName() + "::updateAA"); + // Use a new dependence vector for this update. DependenceVector DV; DependenceStack.push_back(&DV);