diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-07-23 03:10:19 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-07-23 03:10:19 +0000 |
commit | 0ab5d0ee5b13514a939d9131e9a6227eb6014bae (patch) | |
tree | 30d71f4228c99bcdd67d511a3fc555194a21eb0c /llvm/lib/CodeGen/SpillPlacement.cpp | |
parent | cacefc7dcaa646560e51c367ca3785a37fac69bb (diff) | |
download | bcm5719-llvm-0ab5d0ee5b13514a939d9131e9a6227eb6014bae.tar.gz bcm5719-llvm-0ab5d0ee5b13514a939d9131e9a6227eb6014bae.zip |
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.
llvm-svn: 135844
Diffstat (limited to 'llvm/lib/CodeGen/SpillPlacement.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SpillPlacement.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SpillPlacement.cpp b/llvm/lib/CodeGen/SpillPlacement.cpp index 69496186326..ce7b37bfce5 100644 --- a/llvm/lib/CodeGen/SpillPlacement.cpp +++ b/llvm/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) { |