This patch changes the interface to enable the shrink wrapping optimization.
authorKit Barton <kbarton@ca.ibm.com>
Thu, 6 Aug 2015 18:02:53 +0000 (18:02 +0000)
committerKit Barton <kbarton@ca.ibm.com>
Thu, 6 Aug 2015 18:02:53 +0000 (18:02 +0000)
commit87433fc81a9f156bf94625ee7a9237983db7a38a
treebf3a8bc4eb6387c649c7cc149c0b1c13de794e27
parent11c15775e97e03967bc8fec99b184824a4ca967c
This patch changes the interface to enable the shrink wrapping optimization.

It adds a new constructor, which takes a std::function predicate function that
is run at the beginning of shrink wrapping to determine whether the optimization
should run on the given machine function. The std::function can be overridden by
each target, allowing target-specific decisions to be made on each machine
function.

This is necessary for PowerPC, as the decision to run shrink wrapping is
partially based on the ABI. Futhermore, this operates nicely with the GCC iFunc
capability, which allows option overrides on a per-function basis.

Phabricator: http://reviews.llvm.org/D11421

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244235 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/Passes.h
lib/CodeGen/Passes.cpp
lib/CodeGen/ShrinkWrap.cpp