summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGen.cpp
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2016-07-14 04:06:33 +0000
committerDean Michael Berris <dberris@google.com>2016-07-14 04:06:33 +0000
commit52735fc435b1c8ea926c2ac3ba31ab6335976838 (patch)
treec8d0501df98358b32e6a048c31ae066992ab8a25 /llvm/lib/CodeGen/CodeGen.cpp
parented4d5ea82af5a8c1fac741371b0c1f466d888f84 (diff)
downloadbcm5719-llvm-52735fc435b1c8ea926c2ac3ba31ab6335976838.tar.gz
bcm5719-llvm-52735fc435b1c8ea926c2ac3ba31ab6335976838.zip
XRay: Add entry and exit sleds
Summary: In this patch we implement the following parts of XRay: - Supporting a function attribute named 'function-instrument' which currently only supports 'xray-always'. We should be able to use this attribute for other instrumentation approaches. - Supporting a function attribute named 'xray-instruction-threshold' used to determine whether a function is instrumented with a minimum number of instructions (IR instruction counts). - X86-specific nop sleds as described in the white paper. - A machine function pass that adds the different instrumentation marker instructions at a very late stage. - A way of identifying which return opcode is considered "normal" for each architecture. There are some caveats here: 1) We don't handle PATCHABLE_RET in platforms other than x86_64 yet -- this means if IR used PATCHABLE_RET directly instead of a normal ret, instruction lowering for that platform might do the wrong thing. We think this should be handled at instruction selection time to by default be unpacked for platforms where XRay is not availble yet. 2) The generated section for X86 is different from what is described from the white paper for the sole reason that LLVM allows us to do this neatly. We're taking the opportunity to deviate from the white paper from this perspective to allow us to get richer information from the runtime library. Reviewers: sanjoy, eugenis, kcc, pcc, echristo, rnk Subscribers: niravd, majnemer, atrick, rnk, emaste, bmakam, mcrosier, mehdi_amini, llvm-commits Differential Revision: http://reviews.llvm.org/D19904 llvm-svn: 275367
Diffstat (limited to 'llvm/lib/CodeGen/CodeGen.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGen.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGen.cpp b/llvm/lib/CodeGen/CodeGen.cpp
index b277c0bb609..6679819fdef 100644
--- a/llvm/lib/CodeGen/CodeGen.cpp
+++ b/llvm/lib/CodeGen/CodeGen.cpp
@@ -57,6 +57,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeMachineSchedulerPass(Registry);
initializeMachineSinkingPass(Registry);
initializeMachineVerifierPassPass(Registry);
+ initializeXRayInstrumentationPass(Registry);
initializePatchableFunctionPass(Registry);
initializeOptimizePHIsPass(Registry);
initializePEIPass(Registry);
OpenPOWER on IntegriCloud