1 ; RUN: llc -verify-machineinstrs -filetype=asm -o - -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -filetype=asm -o - -mtriple=x86_64-unknown-linux-gnu \
3 ; RUN: -relocation-model=pic < %s | FileCheck %s -check-prefix=PIC
5 define i32 @fn() nounwind noinline uwtable "function-instrument"="xray-always" {
7 %eventsize = alloca i32
8 %eventtype = alloca i16
9 store i16 6, i16* %eventtype
10 %type = load i16, i16* %eventtype
11 store i32 3, i32* %eventsize
12 %val = load i32, i32* %eventsize
13 call void @llvm.xray.typedevent(i16 %type, i8* %eventptr, i32 %val)
14 ; CHECK-LABEL: Lxray_typed_event_sled_0:
15 ; CHECK: .byte 0xeb, 0x14
16 ; CHECK-NEXT: pushq %rdi
17 ; CHECK-NEXT: pushq %rsi
18 ; CHECK-NEXT: pushq %rdx
19 ; CHECK-NEXT: movq {{.*}}, %rdi
20 ; CHECK-NEXT: movq {{.*}}, %rsi
21 ; CHECK-NEXT: movq {{.*}}, %rdx
22 ; CHECK-NEXT: callq __xray_TypedEvent
23 ; CHECK-NEXT: popq %rdx
24 ; CHECK-NEXT: popq %rsi
25 ; CHECK-NEXT: popq %rdi
27 ; PIC-LABEL: Lxray_typed_event_sled_0:
28 ; PIC: .byte 0xeb, 0x14
29 ; PIC-NEXT: pushq %rdi
30 ; PIC-NEXT: pushq %rsi
31 ; PIC-NEXT: pushq %rdx
32 ; PIC-NEXT: movq {{.*}}, %rdi
33 ; PIC-NEXT: movq {{.*}}, %rsi
34 ; PIC-NEXT: movq {{.*}}, %rdx
35 ; PIC-NEXT: callq __xray_TypedEvent@PLT
41 ; CHECK-LABEL: xray_instr_map
42 ; CHECK-LABEL: Lxray_sleds_start0:
43 ; CHECK: .quad {{.*}}xray_typed_event_sled_0
45 declare void @llvm.xray.typedevent(i16, i8*, i32)