[llvm] r318591 - [X86] Output cfi directives for saved XMM registers even if no GPRs are saved
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 17 22:23:48 PST 2017
Author: mstorsjo
Date: Fri Nov 17 22:23:48 2017
New Revision: 318591
URL: http://llvm.org/viewvc/llvm-project?rev=318591&view=rev
Log:
[X86] Output cfi directives for saved XMM registers even if no GPRs are saved
This makes sure that functions that only clobber xmm registers
(on win64) also get the right cfi directives, if dwarf exceptions
are enabled.
Differential Revision: https://reviews.llvm.org/D40191
Added:
llvm/trunk/test/CodeGen/X86/cfi-xmm.ll
Modified:
llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.cpp?rev=318591&r1=318590&r2=318591&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp Fri Nov 17 22:23:48 2017
@@ -1436,8 +1436,7 @@ void X86FrameLowering::emitPrologue(Mach
}
// Emit DWARF info specifying the offsets of the callee-saved registers.
- if (PushedRegs)
- emitCalleeSavedFrameMoves(MBB, MBBI, DL);
+ emitCalleeSavedFrameMoves(MBB, MBBI, DL);
}
// X86 Interrupt handling function cannot assume anything about the direction
Added: llvm/trunk/test/CodeGen/X86/cfi-xmm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cfi-xmm.ll?rev=318591&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/cfi-xmm.ll (added)
+++ llvm/trunk/test/CodeGen/X86/cfi-xmm.ll Fri Nov 17 22:23:48 2017
@@ -0,0 +1,21 @@
+; RUN: llc -mtriple x86_64-w64-windows-gnu -filetype=asm -exception-model=dwarf -o - %s | FileCheck %s
+
+define void @_Z1fv() {
+entry:
+ tail call void asm sideeffect "", "~{xmm10},~{xmm15},~{dirflag},~{fpsr},~{flags}"()
+ ret void
+}
+
+; CHECK-LABEL: _Z1fv:
+; CHECK: .cfi_startproc
+; CHECK: subq $40, %rsp
+; CHECK: movaps %xmm15, 16(%rsp)
+; CHECK: movaps %xmm10, (%rsp)
+; CHECK: .cfi_def_cfa_offset 48
+; CHECK: .cfi_offset %xmm10, -48
+; CHECK: .cfi_offset %xmm15, -32
+; CHECK: movaps (%rsp), %xmm10
+; CHECK: movaps 16(%rsp), %xmm15
+; CHECK: addq $40, %rsp
+; CHECK: retq
+; CHECK: .cfi_endproc
More information about the llvm-commits
mailing list