diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-05-03 22:26:53 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-05-03 22:26:53 +0000 |
commit | 9f7af7b74892e5479e26ab535c9a76131e1947c3 (patch) | |
tree | 30201c77e9623debc534e82068795aa57307ac85 /include/llvm/Transforms | |
parent | cb348b9b45025393ec5b28eac8bb6773a9b603f6 (diff) | |
download | external_llvm-9f7af7b74892e5479e26ab535c9a76131e1947c3.zip external_llvm-9f7af7b74892e5479e26ab535c9a76131e1947c3.tar.gz external_llvm-9f7af7b74892e5479e26ab535c9a76131e1947c3.tar.bz2 |
Factor the logic for testing whether a basic block is viable for code
extraction into a public interface. Also clean it up and apply it more
consistently such that we check for landing pads *anywhere* in the
extracted code, not just in single-block extraction.
This will be used to guide decisions in passes that are planning to
eventually perform a round of code extraction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156114 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r-- | include/llvm/Transforms/Utils/FunctionUtils.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/FunctionUtils.h b/include/llvm/Transforms/Utils/FunctionUtils.h index 8d71e43..821a61e 100644 --- a/include/llvm/Transforms/Utils/FunctionUtils.h +++ b/include/llvm/Transforms/Utils/FunctionUtils.h @@ -23,6 +23,14 @@ namespace llvm { class Function; class Loop; + /// \brief Test whether a basic block is a viable candidate for extraction. + /// + /// This tests whether a particular basic block is viable for extraction into + /// a separate function. It can be used to prune code extraction eagerly + /// rather than waiting for one of the Extract* methods below to reject + /// a request. + bool isBlockViableForExtraction(const BasicBlock &BB); + /// ExtractCodeRegion - Rip out a sequence of basic blocks into a new /// function. /// |