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
47 lines
945 B
LLVM
47 lines
945 B
LLVM
; RUN: llc -mtriple aarch64-windows < %s | FileCheck %s
|
|
|
|
declare double @llvm.powi.f64(double, i32)
|
|
declare float @llvm.powi.f32(float, i32)
|
|
|
|
define double @d(double %d, i32 %i) {
|
|
entry:
|
|
%0 = tail call double @llvm.powi.f64(double %d, i32 %i)
|
|
ret double %0
|
|
}
|
|
|
|
; CHECK-LABEL: d:
|
|
; CHECK: scvtf d1, w0
|
|
; CHECK-NEXT: b pow
|
|
|
|
define float @f(float %f, i32 %i) {
|
|
entry:
|
|
%0 = tail call float @llvm.powi.f32(float %f, i32 %i)
|
|
ret float %0
|
|
}
|
|
|
|
; CHECK-LABEL: f:
|
|
; CHECK: scvtf s1, w0
|
|
; CHECK-NEXT: b powf
|
|
|
|
define float @g(double %d, i32 %i) {
|
|
entry:
|
|
%0 = tail call double @llvm.powi.f64(double %d, i32 %i)
|
|
%conv = fptrunc double %0 to float
|
|
ret float %conv
|
|
}
|
|
|
|
; CHECK-LABEL: g:
|
|
; CHECK: scvtf d1, w0
|
|
; CHECK-NEXT: bl pow
|
|
|
|
define double @h(float %f, i32 %i) {
|
|
entry:
|
|
%0 = tail call float @llvm.powi.f32(float %f, i32 %i)
|
|
%conv = fpext float %0 to double
|
|
ret double %conv
|
|
}
|
|
|
|
; CHECK-LABEL: h:
|
|
; CHECK: scvtf s1, w0
|
|
; CHECK-NEXT: bl powf
|