mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Add a simple method for marking blocks with interference in and out.
This method matches addLinks - All the listed blocks are considered to have interference, so they add a negative bias to their bundles. This could also be done by addConstraints, but that requires building a separate BlockConstraint array. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135844 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -239,6 +239,20 @@ void SpillPlacement::addConstraints(ArrayRef<BlockConstraint> LiveBlocks) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// addPrefSpill - Same as addConstraints(PrefSpill)
|
||||||
|
void SpillPlacement::addPrefSpill(ArrayRef<unsigned> Blocks) {
|
||||||
|
for (ArrayRef<unsigned>::iterator I = Blocks.begin(), E = Blocks.end();
|
||||||
|
I != E; ++I) {
|
||||||
|
float Freq = getBlockFrequency(*I);
|
||||||
|
unsigned ib = bundles->getBundle(*I, 0);
|
||||||
|
unsigned ob = bundles->getBundle(*I, 1);
|
||||||
|
activate(ib);
|
||||||
|
activate(ob);
|
||||||
|
nodes[ib].addBias(-Freq, 1);
|
||||||
|
nodes[ob].addBias(-Freq, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SpillPlacement::addLinks(ArrayRef<unsigned> Links) {
|
void SpillPlacement::addLinks(ArrayRef<unsigned> Links) {
|
||||||
for (ArrayRef<unsigned>::iterator I = Links.begin(), E = Links.end(); I != E;
|
for (ArrayRef<unsigned>::iterator I = Links.begin(), E = Links.end(); I != E;
|
||||||
++I) {
|
++I) {
|
||||||
|
@@ -96,6 +96,10 @@ public:
|
|||||||
/// live out.
|
/// live out.
|
||||||
void addConstraints(ArrayRef<BlockConstraint> LiveBlocks);
|
void addConstraints(ArrayRef<BlockConstraint> LiveBlocks);
|
||||||
|
|
||||||
|
/// addPrefSpill - Add PrefSpill constraints to all blocks listed.
|
||||||
|
/// @param Blocks Array of block numbers that prefer to spill in and out.
|
||||||
|
void addPrefSpill(ArrayRef<unsigned> Blocks);
|
||||||
|
|
||||||
/// addLinks - Add transparent blocks with the given numbers.
|
/// addLinks - Add transparent blocks with the given numbers.
|
||||||
void addLinks(ArrayRef<unsigned> Links);
|
void addLinks(ArrayRef<unsigned> Links);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user