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 | f4afdfc501b7185d24a0ef184fe3d0c0bbe22e0c (patch) | |
tree | 747bfe34dc34c5b0b58ac11b3160422da5e7782b /lib/CodeGen/SplitKit.h | |
parent | 9d29cbad32814f31c91cd2464a3c74df412b0aac (diff) | |
download | llvm-f4afdfc501b7185d24a0ef184fe3d0c0bbe22e0c.tar.gz llvm-f4afdfc501b7185d24a0ef184fe3d0c0bbe22e0c.tar.bz2 llvm-f4afdfc501b7185d24a0ef184fe3d0c0bbe22e0c.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.h')
-rw-r--r-- | lib/CodeGen/SplitKit.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h index 20ac8a1fdc..f1ff501fbd 100644 --- a/lib/CodeGen/SplitKit.h +++ b/lib/CodeGen/SplitKit.h @@ -89,7 +89,10 @@ private: SmallVector<BlockInfo, 8> UseBlocks; /// ThroughBlocks - Block numbers where CurLI is live through without uses. - SmallVector<unsigned, 8> ThroughBlocks; + BitVector ThroughBlocks; + + /// NumThroughBlocks - Number of live-through blocks. + unsigned NumThroughBlocks; SlotIndex computeLastSplitPoint(unsigned Num); @@ -135,9 +138,11 @@ public: /// where CurLI has uses. ArrayRef<BlockInfo> getUseBlocks() { return UseBlocks; } - /// getThroughBlocks - Return an array of block numbers where CurLI is live - /// through without uses. - ArrayRef<unsigned> getThroughBlocks() { return ThroughBlocks; } + /// getNumThroughBlocks - Return the number of through blocks. + unsigned getNumThroughBlocks() const { return NumThroughBlocks; } + + /// isThroughBlock - Return true if CurLI is live through MBB without uses. + bool isThroughBlock(unsigned MBB) const { return ThroughBlocks.test(MBB); } typedef SmallPtrSet<const MachineBasicBlock*, 16> BlockPtrSet; |