summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/tail-call-got.ll
Commit message (Collapse)AuthorAgeFilesLines
* Disable x86 tail call optimizations that jump through GOTReid Kleckner2015-05-281-4/+14
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 238487
* Revert r195318 as it causes miscompilation (PR18029)Kostya Serebryany2013-11-221-2/+4
| | | | llvm-svn: 195439
* The basic problem is that some mainstream programs cannot deal with the wayBill Wendling2013-11-211-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang optimizes tail calls, as in this example: int foo(void); int bar(void) { return foo(); } where the call is transformed to: calll .L0$pb .L0$pb: popl %eax .Ltmp0: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax movl foo@GOT(%eax), %eax popl %ebp jmpl *%eax # TAILCALL However, the GOT references must all be resolved at dlopen() time, and so this approach cannot be used with lazy dynamic linking (e.g. using RTLD_LAZY), which usually populates the PLT with stubs that perform the actual resolving. This patch changes X86TargetLowering::LowerCall() to skip tail call optimization, if the called function is a global or external symbol. Patch by Dimitry Andric! PR15086 llvm-svn: 195318
* Convert CodeGen/*/*.ll tests to use the new CHECK-LABEL for easier ↵Stephen Lin2013-07-131-2/+2
| | | | | | | | | | debugging. No functionality change and all tests pass after conversion. This was done with the following sed invocation to catch label lines demarking function boundaries: sed -i '' "s/^;\( *\)\([A-Z0-9_]*\):\( *\)test\([A-Za-z0-9_-]*\):\( *\)$/;\1\2-LABEL:\3test\4:\5/g" test/CodeGen/*/*.ll which was written conservatively to avoid false positives rather than false negatives. I scanned through all the changes and everything looks correct. llvm-svn: 186258
* This test requires sse, otherwise x87 ops will block tailcall optimizationBenjamin Kramer2011-08-311-1/+1
| | | | llvm-svn: 138859
* Fix X86TargetLowering::LowerExternalSymbol so that it actually works in ↵Eli Friedman2011-08-111-0/+24
non-trivial cases. This hasn't been an issue before because the function isn't normally called (but apparently is used to generate a tail-call to sin() on ELF x86-32 with PIC and SSE2). Fixes PR9693. llvm-svn: 137292
OpenPOWER on IntegriCloud