[X86] Avoid clobbering ESP/RSP in the epilogue.
authorReid Kleckner <rnk@google.com>
Tue, 15 Jan 2019 01:24:18 +0000 (01:24 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 15 Jan 2019 01:24:18 +0000 (01:24 +0000)
commitfe5e5dcab0c09ca4567611ba680c7a603bf6b89d
treed470b016a32d2d8222b8eebca50f40716b4176ea
parent649af77b9e3e111b2a8e7cbfff1209a0b1450554
[X86] Avoid clobbering ESP/RSP in the epilogue.

Summary:
In r345197 ESP and RSP were added to GR32_TC/GR64_TC, allowing them to
be used for tail calls, but this also caused `findDeadCallerSavedReg` to
think they were acceptable targets for clobbering. Filter them out.

Fixes PR40289.

Patch by Geoffry Song!

Reviewed By: rnk

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

llvm-svn: 351146
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/test/CodeGen/X86/pr40289-64bit.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/pr40289.ll [new file with mode: 0644]