2018-07-12 22:36:43 +08:00
|
|
|
; RUN: llc -verify-machineinstrs -filetype=asm -o - -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
|
|
|
|
; RUN: llc -verify-machineinstrs -filetype=asm -o - \
|
|
|
|
; RUN: -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s -check-prefix=PIC
|
[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
llvm-svn: 302405
2017-05-08 13:45:21 +08:00
|
|
|
|
|
|
|
define i32 @fn() nounwind noinline uwtable "function-instrument"="xray-always" {
|
|
|
|
%eventptr = alloca i8
|
|
|
|
%eventsize = alloca i32
|
|
|
|
store i32 3, i32* %eventsize
|
|
|
|
%val = load i32, i32* %eventsize
|
|
|
|
call void @llvm.xray.customevent(i8* %eventptr, i32 %val)
|
|
|
|
; CHECK-LABEL: Lxray_event_sled_0:
|
2017-09-04 13:34:58 +08:00
|
|
|
; CHECK: .byte 0xeb, 0x0f
|
|
|
|
; CHECK-NEXT: pushq %rdi
|
|
|
|
; CHECK-NEXT: pushq %rsi
|
2018-04-18 05:30:29 +08:00
|
|
|
; CHECK-NEXT: movq {{.*}}, %rdi
|
[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
llvm-svn: 302405
2017-05-08 13:45:21 +08:00
|
|
|
; CHECK-NEXT: movq {{.*}}, %rsi
|
2017-09-04 13:34:58 +08:00
|
|
|
; CHECK-NEXT: callq __xray_CustomEvent
|
|
|
|
; CHECK-NEXT: popq %rsi
|
|
|
|
; CHECK-NEXT: popq %rdi
|
|
|
|
|
|
|
|
; PIC-LABEL: Lxray_event_sled_0:
|
|
|
|
; PIC: .byte 0xeb, 0x0f
|
|
|
|
; PIC-NEXT: pushq %rdi
|
|
|
|
; PIC-NEXT: pushq %rsi
|
2018-04-18 05:30:29 +08:00
|
|
|
; PIC-NEXT: movq {{.*}}, %rdi
|
2017-09-04 13:34:58 +08:00
|
|
|
; PIC-NEXT: movq {{.*}}, %rsi
|
|
|
|
; PIC-NEXT: callq __xray_CustomEvent@PLT
|
|
|
|
; PIC-NEXT: popq %rsi
|
|
|
|
; PIC-NEXT: popq %rdi
|
[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
llvm-svn: 302405
2017-05-08 13:45:21 +08:00
|
|
|
ret i32 0
|
|
|
|
}
|
2017-09-04 13:34:58 +08:00
|
|
|
; CHECK-LABEL: xray_instr_map
|
2017-06-21 14:39:42 +08:00
|
|
|
; CHECK-LABEL: Lxray_sleds_start0:
|
[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
llvm-svn: 302405
2017-05-08 13:45:21 +08:00
|
|
|
; CHECK: .quad {{.*}}xray_event_sled_0
|
|
|
|
|
|
|
|
declare void @llvm.xray.customevent(i8*, i32)
|