[PATCH] D19904: XRay: Add entry and exit sleds
Dean Michael Berris via llvm-commits
llvm-commits at lists.llvm.org
Wed May 4 00:01:35 PDT 2016
dberris created this revision.
dberris added reviewers: echristo, sanjoy.
dberris added a subscriber: llvm-commits.
dberris set the repository for this revision to rL LLVM.
Herald added a subscriber: joker.eph.
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.
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.
Repository:
rL LLVM
http://reviews.llvm.org/D19904
Files:
include/llvm/CodeGen/Passes.h
include/llvm/InitializePasses.h
include/llvm/MC/MCObjectFileInfo.h
include/llvm/Target/Target.td
include/llvm/Target/TargetOpcodes.def
lib/CodeGen/CMakeLists.txt
lib/CodeGen/CodeGen.cpp
lib/CodeGen/Passes.cpp
lib/CodeGen/XRayInstrumentation.cpp
lib/MC/MCObjectFileInfo.cpp
lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86AsmPrinter.h
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86MCInstLower.cpp
test/CodeGen/X86/xray-attribute-instrumentation.ll
test/CodeGen/X86/xray-selective-instrumentation-miss.ll
test/CodeGen/X86/xray-selective-instrumentation.ll
test/TableGen/trydecode-emission.td
test/TableGen/trydecode-emission2.td
test/TableGen/trydecode-emission3.td
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19904.56097.patch
Type: text/x-patch
Size: 22628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160504/85a17bf2/attachment.bin>
More information about the llvm-commits
mailing list