Mercurial > hg > CbC > CbC_llvm
comparison include/llvm/Analysis/InlineCost.h @ 83:60c9769439b8 LLVM3.7
LLVM 3.7
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 18 Feb 2015 14:55:36 +0900 |
parents | 54457678186b |
children | afa8332a0e37 |
comparison
equal
deleted
inserted
replaced
78:af83660cff7b | 83:60c9769439b8 |
---|---|
17 #include "llvm/Analysis/CallGraphSCCPass.h" | 17 #include "llvm/Analysis/CallGraphSCCPass.h" |
18 #include <cassert> | 18 #include <cassert> |
19 #include <climits> | 19 #include <climits> |
20 | 20 |
21 namespace llvm { | 21 namespace llvm { |
22 class AssumptionTracker; | 22 class AssumptionCacheTracker; |
23 class CallSite; | 23 class CallSite; |
24 class DataLayout; | 24 class DataLayout; |
25 class Function; | 25 class Function; |
26 class TargetTransformInfo; | 26 class TargetTransformInfoWrapperPass; |
27 | 27 |
28 namespace InlineConstants { | 28 namespace InlineConstants { |
29 // Various magic constants used to adjust heuristics. | 29 // Various magic constants used to adjust heuristics. |
30 const int InstrCost = 5; | 30 const int InstrCost = 5; |
31 const int IndirectCallThreshold = 100; | 31 const int IndirectCallThreshold = 100; |
75 static InlineCost getNever() { | 75 static InlineCost getNever() { |
76 return InlineCost(NeverInlineCost, 0); | 76 return InlineCost(NeverInlineCost, 0); |
77 } | 77 } |
78 | 78 |
79 /// \brief Test whether the inline cost is low enough for inlining. | 79 /// \brief Test whether the inline cost is low enough for inlining. |
80 LLVM_EXPLICIT operator bool() const { | 80 explicit operator bool() const { |
81 return Cost < Threshold; | 81 return Cost < Threshold; |
82 } | 82 } |
83 | 83 |
84 bool isAlways() const { return Cost == AlwaysInlineCost; } | 84 bool isAlways() const { return Cost == AlwaysInlineCost; } |
85 bool isNever() const { return Cost == NeverInlineCost; } | 85 bool isNever() const { return Cost == NeverInlineCost; } |
98 int getCostDelta() const { return Threshold - getCost(); } | 98 int getCostDelta() const { return Threshold - getCost(); } |
99 }; | 99 }; |
100 | 100 |
101 /// \brief Cost analyzer used by inliner. | 101 /// \brief Cost analyzer used by inliner. |
102 class InlineCostAnalysis : public CallGraphSCCPass { | 102 class InlineCostAnalysis : public CallGraphSCCPass { |
103 const TargetTransformInfo *TTI; | 103 TargetTransformInfoWrapperPass *TTIWP; |
104 AssumptionTracker *AT; | 104 AssumptionCacheTracker *ACT; |
105 | 105 |
106 public: | 106 public: |
107 static char ID; | 107 static char ID; |
108 | 108 |
109 InlineCostAnalysis(); | 109 InlineCostAnalysis(); |