|
12 | 12 | // |
13 | 13 | //===----------------------------------------------------------------------===// |
14 | 14 |
|
15 | | -#include "llvm/Transforms/Utils/Cloning.h" |
| 15 | +#include "llvm/ADT/SetVector.h" |
16 | 16 | #include "llvm/ADT/SmallSet.h" |
17 | 17 | #include "llvm/ADT/SmallVector.h" |
18 | | -#include "llvm/ADT/SetVector.h" |
19 | 18 | #include "llvm/ADT/StringExtras.h" |
20 | 19 | #include "llvm/Analysis/AliasAnalysis.h" |
21 | 20 | #include "llvm/Analysis/AssumptionCache.h" |
|
24 | 23 | #include "llvm/Analysis/InstructionSimplify.h" |
25 | 24 | #include "llvm/Analysis/ValueTracking.h" |
26 | 25 | #include "llvm/IR/Attributes.h" |
27 | | -#include "llvm/IR/CallSite.h" |
28 | 26 | #include "llvm/IR/CFG.h" |
| 27 | +#include "llvm/IR/CallSite.h" |
29 | 28 | #include "llvm/IR/Constants.h" |
| 29 | +#include "llvm/IR/DIBuilder.h" |
30 | 30 | #include "llvm/IR/DataLayout.h" |
31 | 31 | #include "llvm/IR/DebugInfo.h" |
32 | 32 | #include "llvm/IR/DerivedTypes.h" |
33 | | -#include "llvm/IR/DIBuilder.h" |
34 | 33 | #include "llvm/IR/Dominators.h" |
35 | 34 | #include "llvm/IR/IRBuilder.h" |
36 | 35 | #include "llvm/IR/Instructions.h" |
37 | 36 | #include "llvm/IR/IntrinsicInst.h" |
38 | 37 | #include "llvm/IR/Intrinsics.h" |
39 | 38 | #include "llvm/IR/MDBuilder.h" |
40 | 39 | #include "llvm/IR/Module.h" |
41 | | -#include "llvm/Transforms/Utils/Local.h" |
42 | 40 | #include "llvm/Support/CommandLine.h" |
| 41 | +#include "llvm/Support/TimeProfiler.h" |
| 42 | +#include "llvm/Transforms/Utils/Cloning.h" |
| 43 | +#include "llvm/Transforms/Utils/Local.h" |
43 | 44 | #include <algorithm> |
44 | 45 | using namespace llvm; |
45 | 46 |
|
@@ -291,6 +292,8 @@ static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock, |
291 | 292 | /// non-aliasing property communicated by the metadata could have |
292 | 293 | /// call-site-specific control dependencies). |
293 | 294 | static void CloneAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap) { |
| 295 | + TimeTraceScope TimeScope("CloneAliasScopeMetadata", |
| 296 | + [&] { return CS.getCalledFunction()->getName(); }); |
294 | 297 | const Function *CalledFunc = CS.getCalledFunction(); |
295 | 298 | SetVector<const MDNode *> MD; |
296 | 299 |
|
@@ -401,6 +404,8 @@ static void CloneAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap) { |
401 | 404 | /// non-derived loads, stores and memory intrinsics with the new alias scopes. |
402 | 405 | static void AddAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap, |
403 | 406 | const DataLayout &DL, AliasAnalysis *AA) { |
| 407 | + TimeTraceScope TimeScope("AddAliasScopeMetadata", |
| 408 | + [&] { return CS.getCalledFunction()->getName(); }); |
404 | 409 | if (!EnableNoAliasConversion) |
405 | 410 | return; |
406 | 411 |
|
@@ -872,6 +877,7 @@ updateInlinedAtInfo(DebugLoc DL, DILocation *InlinedAtNode, LLVMContext &Ctx, |
872 | 877 | /// to encode location where these instructions are inlined. |
873 | 878 | static void fixupLineNumbers(Function *Fn, Function::iterator FI, |
874 | 879 | Instruction *TheCall) { |
| 880 | + TimeTraceScope TimeScope("fixupLineNumbers", [&] { return Fn->getName(); }); |
875 | 881 | DebugLoc TheCallDL = TheCall->getDebugLoc(); |
876 | 882 | #if 0 // HLSL Change |
877 | 883 | if (!TheCallDL) |
|
0 commit comments