summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-05-04 11:20:27 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-05-04 11:20:27 +0000
commit14316fcf7d525dcdcf6d3772cfaa7af24669dfed (patch)
tree31304c79f4e5d0399830e9458b9f4978295ce056 /llvm/include
parent44e13911bc4ea87db8af7cc2fde3245367ceb7ed (diff)
downloadbcm5719-llvm-14316fcf7d525dcdcf6d3772cfaa7af24669dfed.tar.gz
bcm5719-llvm-14316fcf7d525dcdcf6d3772cfaa7af24669dfed.zip
Factor the computation of input and output sets into a public interface
of the CodeExtractor utility. This allows speculatively computing input and output sets to measure the likely size impact of the code extraction. These sets cannot be reused sadly -- we mutate the function prior to forming the final sets used by the actual extraction. The interface has been revamped slightly to make it easier to use correctly by making the interface const and sinking the computation of the number of exit blocks into the full extraction function and away from the rest of this logic which just computed two output parameters. llvm-svn: 156168
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Transforms/Utils/CodeExtractor.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/CodeExtractor.h b/llvm/include/llvm/Transforms/Utils/CodeExtractor.h
index 7268a3c6b62..dafe730f142 100644
--- a/llvm/include/llvm/Transforms/Utils/CodeExtractor.h
+++ b/llvm/include/llvm/Transforms/Utils/CodeExtractor.h
@@ -84,12 +84,21 @@ namespace llvm {
///
/// Based on the blocks used when constructing the code extractor,
/// determine whether it is eligible for extraction.
- bool isEligible() { return !Blocks.empty(); };
+ bool isEligible() const { return !Blocks.empty(); };
+
+ /// \brief Compute the set of input values and output values for the code.
+ ///
+ /// These can be used either when performing the extraction or to evaluate
+ /// the expected size of a call to the extracted function. Note that this
+ /// work cannot be cached between the two as once we decide to extract
+ /// a code sequence, that sequence is modified, including changing these
+ /// sets, before extraction occurs. These modifications won't have any
+ /// significant impact on the cost however.
+ void findInputsOutputs(ValueSet &Inputs, ValueSet &Outputs) const;
private:
void severSplitPHINodes(BasicBlock *&Header);
void splitReturnBlocks();
- void findInputsOutputs(ValueSet &inputs, ValueSet &outputs);
Function *constructFunction(const ValueSet &inputs,
const ValueSet &outputs,
OpenPOWER on IntegriCloud