1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 21:13:02 +02:00
llvm-mirror/test/CodeGen/X86/stackmap-large-constants.ll
Sanjoy Das 58149dbd85 [Stackmap] Added callsite counts to emitted function information.
Summary:
It was previously not possible for tools to use solely the stackmap
information emitted to reconstruct the return addresses of callsites in
the map, which is necessary to use the information to walk a stack. This
patch adds per-function callsite counts when emitting the stackmap
section in order to resolve the problem. Note that this slightly alters
the stackmap format, so external tools parsing these maps will need to
be updated.

**Problem Details:**
Records only store their offset from the beginning of the function they
belong to. While these records and the functions are output in program
order, it is not possible to determine where the end of one function's
records are without the callsite count when processing the records to
compute return addresses.

Patch by Kavon Farvardin!

Reviewers: atrick, ributzka, sanjoy

Subscribers: nemanjai

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

llvm-svn: 281532
2016-09-14 20:22:03 +00:00

86 lines
1.8 KiB
LLVM

; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
; CHECK-NEXT: __LLVM_StackMaps:
; version
; CHECK-NEXT: .byte 2
; reserved
; CHECK-NEXT: .byte 0
; reserved
; CHECK-NEXT: .short 0
; # functions
; CHECK-NEXT: .long 2
; # constants
; CHECK-NEXT: .long 2
; # records
; CHECK-NEXT: .long 2
; function address & stack size
; CHECK-NEXT: .quad _foo
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad 1
; function address & stack size
; CHECK-NEXT: .quad _bar
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad 1
; Constants Array:
; CHECK-NEXT: .quad 9223372036854775807
; CHECK-NEXT: .quad -9223372036854775808
; Patchpoint ID
; CHECK-NEXT: .quad 0
; Instruction offset
; CHECK-NEXT: .long L{{.*}}-_foo
; reserved
; CHECK-NEXT: .short 0
; # locations
; CHECK-NEXT: .short 1
; ConstantIndex
; CHECK-NEXT: .byte 5
; reserved
; CHECK-NEXT: .byte 8
; Dwarf RegNum
; CHECK-NEXT: .short 0
; Offset
; CHECK-NEXT: .long 0
; padding
; CHECK-NEXT: .short 0
; NumLiveOuts
; CHECK-NEXT: .short 0
; CHECK-NEXT: .p2align 3
declare void @llvm.experimental.stackmap(i64, i32, ...)
define void @foo() {
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 0, i32 0, i64 9223372036854775807)
ret void
}
; Patchpoint ID
; CHECK-NEXT: .quad 0
; Instruction Offset
; CHECK-NEXT: .long L{{.*}}-_bar
; reserved
; CHECK-NEXT: .short 0
; # locations
; CHECK-NEXT: .short 1
; ConstantIndex
; CHECK-NEXT: .byte 5
; reserved
; CHECK-NEXT: .byte 8
; Dwarf RegNum
; CHECK-NEXT: .short 0
; Offset
; CHECK-NEXT: .long 1
; padding
; CHECK-NEXT: .short 0
; NumLiveOuts
; CHECK-NEXT: .short 0
define void @bar() {
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 0, i32 0, i64 -9223372036854775808)
ret void
}