mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-28 22:29:56 +00:00
This patch minimizes the number of nops that must be emitted on X86 to satisfy stackmap shadow constraints. To minimize the number of nops inserted, the X86AsmPrinter now records the size of the most recent stackmap's shadow in the StackMapShadowTracker class, and tracks the number of instruction bytes emitted since the that stackmap instruction was encountered. Padding is emitted (if it is required at all) immediately before the next stackmap/patchpoint instruction, or at the end of the basic block. This optimization should reduce code-size and improve performance for people using the llvm stackmap intrinsic on X86. <rdar://problem/14959522> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213892 91177308-0d34-0410-b5e6-96231b3b80d8
49 lines
2.3 KiB
LLVM
49 lines
2.3 KiB
LLVM
; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim -filetype=obj %s -o - | llvm-objdump -d - | FileCheck %s
|
|
; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim -filetype=asm %s -o - | llvm-mc -triple=x86_64-apple-darwin -mcpu=corei7 -filetype=obj - | llvm-objdump -d - | FileCheck %s
|
|
|
|
define void @nop_test() {
|
|
entry:
|
|
; CHECK: 0: 55
|
|
; CHECK: 1: 48 89 e5
|
|
|
|
; CHECK: 4: 90
|
|
; CHECK: 5: 66 90
|
|
; CHECK: 7: 0f 1f 00
|
|
; CHECK: a: 0f 1f 40 08
|
|
; CHECK: e: 0f 1f 44 00 08
|
|
; CHECK: 13: 66 0f 1f 44 00 08
|
|
; CHECK: 19: 0f 1f 80 00 02 00 00
|
|
; CHECK: 20: 0f 1f 84 00 00 02 00 00
|
|
; CHECK: 28: 66 0f 1f 84 00 00 02 00 00
|
|
; CHECK: 31: 2e 66 0f 1f 84 00 00 02 00 00
|
|
; CHECK: 3b: 66 2e 66 0f 1f 84 00 00 02 00 00
|
|
; CHECK: 46: 66 66 2e 66 0f 1f 84 00 00 02 00 00
|
|
; CHECK: 52: 66 66 66 2e 66 0f 1f 84 00 00 02 00 00
|
|
; CHECK: 5f: 66 66 66 66 2e 66 0f 1f 84 00 00 02 00 00
|
|
; CHECK: 6d: 66 66 66 66 66 2e 66 0f 1f 84 00 00 02 00 00
|
|
|
|
; CHECK: 7c: 5d
|
|
; CHECK: 7d: c3
|
|
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 0, i32 0)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 1)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 2, i32 2)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 3, i32 3)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 4, i32 4)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 5, i32 5)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 6, i32 6)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 7, i32 7)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 8, i32 8)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 9, i32 9)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 10, i32 10)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 11, i32 11)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 12, i32 12)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 13, i32 13)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 14, i32 14)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 15, i32 15)
|
|
tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 16, i32 0)
|
|
ret void
|
|
}
|
|
|
|
declare void @llvm.experimental.stackmap(i64, i32, ...)
|