llvm-6502/lib
Bill Wendling 072ebe59e2 The basic problem is that some mainstream programs cannot deal with the way
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195318 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-21 07:04:30 +00:00
..
Analysis The 'optnone' attribute means don't inline anything into this function 2013-11-18 21:44:03 +00:00
AsmParser Make it explicit that nulls are not allowed in names. 2013-11-19 21:12:39 +00:00
Bitcode Fix spacing, forward declare order. 2013-11-18 02:51:33 +00:00
CodeGen Teach ISel not to optimize 'optnone' functions. 2013-11-21 06:33:32 +00:00
DebugInfo
ExecutionEngine [mips] Resolve relocation for the stubs in MCJIT when load address is known 2013-11-19 21:56:00 +00:00
IR llvm-cov: Formatting change. 2013-11-21 04:12:10 +00:00
IRReader
Linker
LTO Use array_pod_sort instead of std::sort 2013-11-16 16:15:56 +00:00
MC Support multiple COFF sections with the same name but different COMDAT. 2013-11-19 19:52:52 +00:00
Object Path: Recognize COFF import library file magic. 2013-11-15 21:22:02 +00:00
Option
Support revert r194655 2013-11-21 00:20:10 +00:00
TableGen
Target The basic problem is that some mainstream programs cannot deal with the way 2013-11-21 07:04:30 +00:00
Transforms llvm-cov: Don't assume FileChecksum was generated. 2013-11-21 04:53:39 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile