OSDN Git Service

[Outliner] Add tail call support
authorJessica Paquette <jpaquette@apple.com>
Mon, 13 Mar 2017 18:39:33 +0000 (18:39 +0000)
committerJessica Paquette <jpaquette@apple.com>
Mon, 13 Mar 2017 18:39:33 +0000 (18:39 +0000)
commitaf024ba867517be64c8d2b51d85d6a00714f0e67
treeebe7b620d7b710681da8fe462974113e66d76bdb
parent57255ff3b4797dfaae09b0030c657432f5cc148f
[Outliner] Add tail call support

This commit adds tail call support to the MachineOutliner pass. This allows
the outliner to insert jumps rather than calls in areas where tail calling is
possible. Outlined tail calls include the return or terminator of the basic
block being outlined from.

Tail call support allows the outliner to take returns and terminators into
consideration while finding candidates to outline. It also allows the outliner
to save more instructions. For example, in the X86-64 outliner, a tail called
outlined function saves one instruction since no return has to be inserted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297653 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetInstrInfo.h
lib/CodeGen/MachineOutliner.cpp
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h
test/CodeGen/X86/machine-outliner-tailcalls.ll [new file with mode: 0644]
test/CodeGen/X86/machine-outliner.ll