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 @@ -116,6 +116,7 @@ #include "llvm/IR/ConstantRange.h" #include "llvm/IR/PassManager.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/TimeProfiler.h" #include "llvm/Transforms/Utils/CallGraphUpdater.h" namespace llvm { @@ -934,8 +935,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 @@ -25,9 +25,9 @@ #include "llvm/InitializePasses.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/TimeProfiler.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Local.h" - #include using namespace llvm; @@ -903,6 +903,7 @@ } void Attributor::runTillFixpoint() { + TimeTraceScope TimeScope("Attributor::runTillFixpoint"); LLVM_DEBUG(dbgs() << "[Attributor] Identified and initialized " << AllAbstractAttributes.size() << " abstract attributes.\n"); @@ -1037,6 +1038,7 @@ } ChangeStatus Attributor::manifestAttributes() { + TimeTraceScope TimeScope("Attributor::manifestAttributes"); size_t NumFinalAAs = AllAbstractAttributes.size(); unsigned NumManifested = 0; @@ -1095,6 +1097,7 @@ } ChangeStatus Attributor::cleanupIR() { + TimeTraceScope TimeScope("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 " @@ -1263,6 +1266,8 @@ } ChangeStatus Attributor::run() { + TimeTraceScope TimeScope("Attributor::run"); + SeedingPeriod = false; runTillFixpoint(); ChangeStatus ManifestChange = manifestAttributes(); @@ -1271,6 +1276,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);