mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Keep track of the number of positively biased nodes when adding constraints.
If there are no positive nodes, the algorithm can be aborted early. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129021 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user