projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[X86] Add support for tbyte memory operand size for Intel-syntax x86 assembly
[oota-llvm.git]
/
include
/
llvm
/
Analysis
/
InlineCost.h
diff --git
a/include/llvm/Analysis/InlineCost.h
b/include/llvm/Analysis/InlineCost.h
index dfdfe3e4f8e8b9edef698c291376934d9f2e7ae3..79ed74d8241110976b6289d97676aff6dd5137a4 100644
(file)
--- a/
include/llvm/Analysis/InlineCost.h
+++ b/
include/llvm/Analysis/InlineCost.h
@@
-14,14
+14,16
@@
#ifndef LLVM_ANALYSIS_INLINECOST_H
#define LLVM_ANALYSIS_INLINECOST_H
#ifndef LLVM_ANALYSIS_INLINECOST_H
#define LLVM_ANALYSIS_INLINECOST_H
-#include "llvm/Analysis/C
odeMetric
s.h"
+#include "llvm/Analysis/C
allGraphSCCPas
s.h"
#include <cassert>
#include <climits>
namespace llvm {
#include <cassert>
#include <climits>
namespace llvm {
+class AssumptionCacheTracker;
class CallSite;
class DataLayout;
class Function;
class CallSite;
class DataLayout;
class Function;
+class TargetTransformInfoWrapperPass;
namespace InlineConstants {
// Various magic constants used to adjust heuristics.
namespace InlineConstants {
// Various magic constants used to adjust heuristics.
@@
-75,7
+77,7
@@
public:
}
/// \brief Test whether the inline cost is low enough for inlining.
}
/// \brief Test whether the inline cost is low enough for inlining.
- operator bool() const {
+
explicit
operator bool() const {
return Cost < Threshold;
}
return Cost < Threshold;
}
@@
-97,14
+99,19
@@
public:
};
/// \brief Cost analyzer used by inliner.
};
/// \brief Cost analyzer used by inliner.
-class InlineCostAnaly
zer
{
- // DataLayout if available, or null.
-
const DataLayout *TD
;
+class InlineCostAnaly
sis : public CallGraphSCCPass
{
+ TargetTransformInfoWrapperPass *TTIWP;
+
AssumptionCacheTracker *ACT
;
public:
public:
- InlineCostAnalyzer() : TD(0) {}
+ static char ID;
- void setDataLayout(const DataLayout *TData) { TD = TData; }
+ InlineCostAnalysis();
+ ~InlineCostAnalysis() override;
+
+ // Pass interface implementation.
+ void getAnalysisUsage(AnalysisUsage &AU) const override;
+ bool runOnSCC(CallGraphSCC &SCC) override;
/// \brief Get an InlineCost object representing the cost of inlining this
/// callsite.
/// \brief Get an InlineCost object representing the cost of inlining this
/// callsite.
@@
-113,6
+120,9
@@
public:
/// threshold are computed with any accuracy. The threshold can be used to
/// bound the computation necessary to determine whether the cost is
/// sufficiently low to warrant inlining.
/// threshold are computed with any accuracy. The threshold can be used to
/// bound the computation necessary to determine whether the cost is
/// sufficiently low to warrant inlining.
+ ///
+ /// Also note that calling this function *dynamically* computes the cost of
+ /// inlining the callsite. It is an expensive, heavyweight call.
InlineCost getInlineCost(CallSite CS, int Threshold);
/// \brief Get an InlineCost with the callee explicitly specified.
InlineCost getInlineCost(CallSite CS, int Threshold);
/// \brief Get an InlineCost with the callee explicitly specified.