]> granicus.if.org Git - llvm/commit
[XRay] Custom event logging intrinsic
authorDean Michael Berris <dberris@google.com>
Mon, 8 May 2017 05:45:21 +0000 (05:45 +0000)
committerDean Michael Berris <dberris@google.com>
Mon, 8 May 2017 05:45:21 +0000 (05:45 +0000)
commit638f2cdc226c3ecd8371727f26e9cb8206f5cd99
treef3a6315f1e4d196e702537e3fa40fe21c3b523a4
parentba36bcb1c10a7ae7c4fbbdd2ea23443aa353c31e
[XRay] Custom event logging intrinsic

This patch introduces an LLVM intrinsic and a target opcode for custom event
logging in XRay. Initially, its use case will be to allow users of XRay to log
some type of string ("poor man's printf"). The target opcode compiles to a noop
sled large enough to enable calling through to a runtime-determined relative
function call. At runtime, when X-Ray is enabled, the sled is replaced by
compiler-rt with a trampoline to the logic for creating the custom log entries.

Future patches will implement the compiler-rt parts and clang-side support for
emitting the IR corresponding to this intrinsic.

Reviewers: timshen, dberris

Subscribers: igorb, pelikan, rSerge, timshen, echristo, dberris, llvm-commits

Differential Revision: https://reviews.llvm.org/D27503

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302405 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/AsmPrinter.h
include/llvm/CodeGen/FastISel.h
include/llvm/IR/Intrinsics.td
include/llvm/Target/Target.td
include/llvm/Target/TargetOpcodes.def
lib/CodeGen/SelectionDAG/FastISel.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/Target/X86/X86AsmPrinter.h
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86MCInstLower.cpp
test/CodeGen/X86/xray-custom-log.ll [new file with mode: 0644]