diff options
author | Arnold Schwaighofer <arnold.schwaighofer@gmail.com> | 2007-10-11 19:40:01 +0000 |
---|---|---|
committer | Arnold Schwaighofer <arnold.schwaighofer@gmail.com> | 2007-10-11 19:40:01 +0000 |
commit | c85e1716f0e45e4c18a9ef2fbe431a51ac3a4252 (patch) | |
tree | e6e745a81699085d757db166e645f8a6639cde7a /lib/Target/TargetMachine.cpp | |
parent | 68c8411ef591818d89c6a81098a328fcd75be72a (diff) |
Added tail call optimization to the x86 back end. It can be
enabled by passing -tailcallopt to llc. The optimization is
performed if the following conditions are satisfied:
* caller/callee are fastcc
* elf/pic is disabled OR
elf/pic enabled + callee is in module + callee has
visibility protected or hidden
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetMachine.cpp')
-rw-r--r-- | lib/Target/TargetMachine.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index 6c00a3f492..9caea11dd3 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -33,6 +33,7 @@ namespace llvm { bool ExceptionHandling; Reloc::Model RelocationModel; CodeModel::Model CMModel; + bool PerformTailCallOpt; } namespace { cl::opt<bool, true> PrintCode("print-machineinstrs", @@ -116,6 +117,12 @@ namespace { clEnumValN(CodeModel::Large, "large", " Large code model"), clEnumValEnd)); + + cl::opt<bool, true> + EnablePerformTailCallOpt("tailcallopt", + cl::desc("Turn on tail call optimization."), + cl::location(PerformTailCallOpt), + cl::init(false)); } //--------------------------------------------------------------------------- |