aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-03-01 20:59:38 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-03-01 20:59:38 +0000
commite5d90416ee1a4f45eba80789a7a3cbc3d497a4cd (patch)
tree050d8f3ed6ca82084c061e39069daad07985abb3 /include/llvm/CodeGen
parent09a695e3969115362624338a182731c375fd055b (diff)
downloadexternal_llvm-e5d90416ee1a4f45eba80789a7a3cbc3d497a4cd.tar.gz
external_llvm-e5d90416ee1a4f45eba80789a7a3cbc3d497a4cd.tar.bz2
external_llvm-e5d90416ee1a4f45eba80789a7a3cbc3d497a4cd.zip
Use methods to determine if a LiveInterval is spillable.
Don't accidentally produce unspillable intervals for deeply nested loops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97496 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/LiveInterval.h10
-rw-r--r--include/llvm/CodeGen/LiveIntervalAnalysis.h5
2 files changed, 12 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index 512c94d87c..eb5901cf2f 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -569,6 +569,16 @@ namespace llvm {
///
unsigned getSize() const;
+ /// isSpillable - Can this interval be spilled?
+ bool isSpillable() const {
+ return weight != HUGE_VALF;
+ }
+
+ /// markNotSpillable - Mark interval as not spillable
+ void markNotSpillable() {
+ weight = HUGE_VALF;
+ }
+
/// ComputeJoinedWeight - Set the weight of a live interval after
/// Other has been merged into it.
void ComputeJoinedWeight(const LiveInterval &Other);
diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h
index 294eb25fb2..e8856ac103 100644
--- a/include/llvm/CodeGen/LiveIntervalAnalysis.h
+++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h
@@ -70,9 +70,8 @@ namespace llvm {
static char ID; // Pass identification, replacement for typeid
LiveIntervals() : MachineFunctionPass(&ID) {}
- static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth) {
- return (isDef + isUse) * powf(10.0F, (float)loopDepth);
- }
+ // Calculate the spill weight to assign to a single instruction.
+ static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth);
// After summing the spill weights of all defs and uses, the final weight
// should be normalized, dividing the weight of the interval by its size.