summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SpillPlacement.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-04-06 19:14:00 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-04-06 19:14:00 +0000
commit6895b87dfebbc1432cd771a8270e2c95158cca32 (patch)
tree99e9a8c93022c83896a0796ad445df19d23e77fb /llvm/lib/CodeGen/SpillPlacement.h
parent36b5d8a6986e8dbdaa965f44af91b45eeb81f760 (diff)
downloadbcm5719-llvm-6895b87dfebbc1432cd771a8270e2c95158cca32.tar.gz
bcm5719-llvm-6895b87dfebbc1432cd771a8270e2c95158cca32.zip
Keep track of the number of positively biased nodes when adding constraints.
If there are no positive nodes, the algorithm can be aborted early. llvm-svn: 129021
Diffstat (limited to 'llvm/lib/CodeGen/SpillPlacement.h')
-rw-r--r--llvm/lib/CodeGen/SpillPlacement.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SpillPlacement.h b/llvm/lib/CodeGen/SpillPlacement.h
index d1c6ceb7857..a67785ddf9b 100644
--- a/llvm/lib/CodeGen/SpillPlacement.h
+++ b/llvm/lib/CodeGen/SpillPlacement.h
@@ -49,6 +49,9 @@ class SpillPlacement : public MachineFunctionPass {
// caller.
BitVector *ActiveNodes;
+ // The number of active nodes with a positive bias.
+ unsigned PositiveNodes;
+
// Block frequencies are computed once. Indexed by block number.
SmallVector<float, 4> BlockFrequency;
@@ -91,6 +94,10 @@ public:
/// out, but not live in.
void addConstraints(ArrayRef<BlockConstraint> LiveBlocks);
+ /// getPositiveNodes - Return the total number of graph nodes with a positive
+ /// bias after adding constraints.
+ unsigned getPositiveNodes() const { return PositiveNodes; }
+
/// finish - Compute the optimal spill code placement given the
/// constraints. No MustSpill constraints will be violated, and the smallest
/// possible number of PrefX constraints will be violated, weighted by
OpenPOWER on IntegriCloud