summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SpillPlacement.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-23 03:10:19 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-23 03:10:19 +0000
commite60f103d2d3541e57a6ca8d788e959e03b615e5f (patch)
treeb63125276ada631b7267124f29f96e8f3cba15ee /lib/CodeGen/SpillPlacement.cpp
parentc7931fd725b390142f9112952b1426560000e6b4 (diff)
downloadllvm-e60f103d2d3541e57a6ca8d788e959e03b615e5f.tar.gz
llvm-e60f103d2d3541e57a6ca8d788e959e03b615e5f.tar.bz2
llvm-e60f103d2d3541e57a6ca8d788e959e03b615e5f.tar.xz
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
Diffstat (limited to 'lib/CodeGen/SpillPlacement.cpp')
-rw-r--r--lib/CodeGen/SpillPlacement.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/CodeGen/SpillPlacement.cpp b/lib/CodeGen/SpillPlacement.cpp
index 6949618632..ce7b37bfce 100644
--- a/lib/CodeGen/SpillPlacement.cpp
+++ b/lib/CodeGen/SpillPlacement.cpp
@@ -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) {
for (ArrayRef<unsigned>::iterator I = Links.begin(), E = Links.end(); I != E;
++I) {