diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-04-09 02:59:09 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-04-09 02:59:09 +0000 |
commit | ed47ed4e80d9add78932bafff99701a87d54923c (patch) | |
tree | b036118b1a526dd8d2e920a4ad0e17ce59d483b2 /llvm/lib/CodeGen/EdgeBundles.cpp | |
parent | 4ad6c160a5894b0e3480c5e17b040985ce1893d2 (diff) | |
download | llvm-ed47ed4e80d9add78932bafff99701a87d54923c.zip llvm-ed47ed4e80d9add78932bafff99701a87d54923c.tar.gz llvm-ed47ed4e80d9add78932bafff99701a87d54923c.tar.bz2 |
Build the Hopfield network incrementally when splitting global live ranges.
It is common for large live ranges to have few basic blocks with register uses
and many live-through blocks without any uses. This approach grows the Hopfield
network incrementally around the use blocks, completely avoiding checking
interference for some through blocks.
llvm-svn: 129188
Diffstat (limited to 'llvm/lib/CodeGen/EdgeBundles.cpp')
-rw-r--r-- | llvm/lib/CodeGen/EdgeBundles.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/EdgeBundles.cpp b/llvm/lib/CodeGen/EdgeBundles.cpp index aed8bc9..646e014 100644 --- a/llvm/lib/CodeGen/EdgeBundles.cpp +++ b/llvm/lib/CodeGen/EdgeBundles.cpp @@ -53,6 +53,19 @@ bool EdgeBundles::runOnMachineFunction(MachineFunction &mf) { EC.compress(); if (ViewEdgeBundles) view(); + + // Compute the reverse mapping. + Blocks.clear(); + Blocks.resize(getNumBundles()); + + for (unsigned i = 0, e = MF->getNumBlockIDs(); i != e; ++i) { + unsigned b0 = getBundle(i, 0); + unsigned b1 = getBundle(i, 1); + Blocks[b0].push_back(i); + if (b1 != b0) + Blocks[b1].push_back(i); + } + return false; } @@ -82,5 +95,3 @@ raw_ostream &llvm::WriteGraph(raw_ostream &O, const EdgeBundles &G, O << "}\n"; return O; } - - |