]> granicus.if.org Git - llvm/commit
Disable x86 tail call optimizations that jump through GOT
authorReid Kleckner <reid@kleckner.net>
Thu, 28 May 2015 20:44:28 +0000 (20:44 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 28 May 2015 20:44:28 +0000 (20:44 +0000)
commit7738ecd62b06ac11b5b8211683089757c4b4f067
treebd48b8cba5a2365d73b5ef73d42ca474c5f3a3ec
parent117715ca0613d3db144241499401f2ec5398f1d5
Disable x86 tail call optimizations that jump through GOT

For x86 targets, do not do sibling call optimization when materializing
the callee's address would require a GOT relocation. We can still do
tail calls to internal functions, hidden functions, and protected
functions, because they do not require this kind of relocation. It is
still possible to get GOT relocations when the user explicitly asks for
it with musttail or -tailcallopt, both of which are supposed to
guarantee TCO.

Based on a patch by Chih-hung Hsieh.

Reviewers: srhines, timmurray, danalbert, enh, void, nadav, rnk

Subscribers: joerg, davidxl, llvm-commits

Differential Revision: http://reviews.llvm.org/D9799

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238487 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/pic.ll
test/CodeGen/X86/tail-call-got.ll
test/CodeGen/X86/tailcallpic1.ll
test/CodeGen/X86/tailcallpic3.ll [new file with mode: 0644]