summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SpillPlacement.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-04-07 17:27:46 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-04-07 17:27:46 +0000
commit6d2bbc1c20fe103351df6073e67b535185f04a31 (patch)
treebf1f24658f891bb8e94c835a8f26a43093d67a93 /llvm/lib/CodeGen/SpillPlacement.cpp
parent197c35298a4c1b581b56e3fc2ff9ca0277115110 (diff)
downloadbcm5719-llvm-6d2bbc1c20fe103351df6073e67b535185f04a31.tar.gz
bcm5719-llvm-6d2bbc1c20fe103351df6073e67b535185f04a31.zip
Extract SpillPlacement::addLinks for handling the special transparent blocks.
llvm-svn: 129079
Diffstat (limited to 'llvm/lib/CodeGen/SpillPlacement.cpp')
-rw-r--r--llvm/lib/CodeGen/SpillPlacement.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/SpillPlacement.cpp b/llvm/lib/CodeGen/SpillPlacement.cpp
index 0ccb93f871d..ac7a19267c5 100644
--- a/llvm/lib/CodeGen/SpillPlacement.cpp
+++ b/llvm/lib/CodeGen/SpillPlacement.cpp
@@ -213,23 +213,6 @@ void SpillPlacement::addConstraints(ArrayRef<BlockConstraint> LiveBlocks) {
for (ArrayRef<BlockConstraint>::iterator I = LiveBlocks.begin(),
E = LiveBlocks.end(); I != E; ++I) {
float Freq = getBlockFrequency(I->Number);
-
- // Is this a transparent block? Link ingoing and outgoing bundles.
- if (I->Entry == DontCare && I->Exit == DontCare) {
- unsigned ib = bundles->getBundle(I->Number, 0);
- unsigned ob = bundles->getBundle(I->Number, 1);
-
- // Ignore self-loops.
- if (ib == ob)
- continue;
- activate(ib);
- activate(ob);
- nodes[ib].addLink(ob, Freq, 1);
- nodes[ob].addLink(ib, Freq, 0);
- continue;
- }
-
- // This block is not transparent, but it can still add bias.
const float Bias[] = {
0, // DontCare,
1, // PrefReg,
@@ -253,6 +236,24 @@ void SpillPlacement::addConstraints(ArrayRef<BlockConstraint> LiveBlocks) {
}
}
+void SpillPlacement::addLinks(ArrayRef<unsigned> Links) {
+ for (ArrayRef<unsigned>::iterator I = Links.begin(), E = Links.end(); I != E;
+ ++I) {
+ unsigned Number = *I;
+ unsigned ib = bundles->getBundle(Number, 0);
+ unsigned ob = bundles->getBundle(Number, 1);
+
+ // Ignore self-loops.
+ if (ib == ob)
+ continue;
+ activate(ib);
+ activate(ob);
+ float Freq = getBlockFrequency(Number);
+ nodes[ib].addLink(ob, Freq, 1);
+ nodes[ob].addLink(ib, Freq, 0);
+ }
+}
+
/// iterate - Repeatedly update the Hopfield nodes until stability or the
/// maximum number of iterations is reached.
/// @param Linked - Numbers of linked nodes that need updating.
OpenPOWER on IntegriCloud