1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/CodeGen/AArch64/lrint-conv-win.ll
Martin Storsjö 8fc47f8652 [AArch64] Omit SEH directives for the epilogue if none are needed
For these cases, we already omit the prologue directives, if
(!AFI->hasStackFrame() && !windowsRequiresStackProbe && !NumBytes).

When writing the epilogue (after the prolog has been written), if
the function doesn't have the WinCFI flag set (i.e. if no prologue
was generated), assume that no epilogue will be needed either,
and don't emit any epilog start pseudo instruction. After completing
the epilogue, make sure that it actually matched the prologue.

Previously, when epilogue start/end was generated, but no prologue,
the unwind info for such functions actually was huge; 12 bytes xdata
(4 bytes header, 4 bytes for one non-folded epilogue header, 4 bytes
for padded opcodes) and 8 bytes pdata. Because the epilog consisted of
one opcode (end) but the prolog was empty (no .seh_endprologue), the
epilogue couldn't be folded into the prologue, and thus couldn't be
considered for packed form either.

On a 6.5 MB DLL with 110 KB pdata and 166 KB xdata, this gets rid of
38 KB pdata and 62 KB xdata.

Differential Revision: https://reviews.llvm.org/D88641
2020-10-02 09:12:56 +03:00

49 lines
1.3 KiB
LLVM

; RUN: llc < %s -mtriple=aarch64-windows -mattr=+neon | FileCheck %s
; CHECK-LABEL: testmsxs:
; CHECK: frintx [[SREG:s[0-9]+]], s0
; CHECK-NEXT: fcvtzs [[WREG:w[0-9]+]], [[SREG]]
; CHECK-NEXT: sxtw x0, [[WREG]]
; CHECK-NEXT: ret
define i64 @testmsxs(float %x) {
entry:
%0 = tail call i32 @llvm.lrint.i32.f32(float %x)
%conv = sext i32 %0 to i64
ret i64 %conv
}
; CHECK-LABEL: testmsws:
; CHECK: frintx [[SREG:s[0-9]+]], s0
; CHECK-NEXT: fcvtzs [[WREG:w[0-9]+]], [[SREG]]
; CHECK-NEXT: ret
define i32 @testmsws(float %x) {
entry:
%0 = tail call i32 @llvm.lrint.i32.f32(float %x)
ret i32 %0
}
; CHECK-LABEL: testmsxd:
; CHECK: frintx [[DREG:d[0-9]+]], d0
; CHECK-NEXT: fcvtzs [[WREG:w[0-9]+]], [[DREG]]
; CHECK-NEXT: sxtw x0, [[WREG]]
; CHECK-NEXT: ret
define i64 @testmsxd(double %x) {
entry:
%0 = tail call i32 @llvm.lrint.i32.f64(double %x)
%conv = sext i32 %0 to i64
ret i64 %conv
}
; CHECK-LABEL: testmswd:
; CHECK: frintx [[DREG:d[0-9]+]], d0
; CHECK-NEXT: fcvtzs [[WREG:w[0-9]+]], [[DREG]]
; CHECK-NEXT: ret
define i32 @testmswd(double %x) {
entry:
%0 = tail call i32 @llvm.lrint.i32.f64(double %x)
ret i32 %0
}
declare i32 @llvm.lrint.i32.f32(float) nounwind readnone
declare i32 @llvm.lrint.i32.f64(double) nounwind readnone