]> granicus.if.org Git - llvm/commit
x86 interrupt calling convention: only save xmm registers if the target supports SSE
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Thu, 16 Feb 2017 18:25:37 +0000 (18:25 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Thu, 16 Feb 2017 18:25:37 +0000 (18:25 +0000)
commit8458f173812425ed6b43d5d4840ad8886ce2fe99
tree7ec221079560aec23760c0c3d394384488db8cc7
parent861192db76649d4c8b675324ce9d9b0d56e4fa77
x86 interrupt calling convention: only save xmm registers if the target supports SSE

The existing code always saves the xmm registers for 64-bit targets even if the
target doesn't support SSE (which is common for kernels). Thus, the compiler
inserts movaps instructions which lead to CPU exceptions when an interrupt
handler is invoked.

This commit fixes this bug by returning a register set without xmm registers
from getCalleeSavedRegs and getCallPreservedMask for such targets.

Patch by Philipp Oppermann.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295347 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86RegisterInfo.cpp
test/CodeGen/X86/x86-64-intrcc-nosse.ll [new file with mode: 0644]