From f4afdfc501b7185d24a0ef184fe3d0c0bbe22e0c Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Sat, 9 Apr 2011 02:59:09 +0000 Subject: 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 --- lib/CodeGen/SplitKit.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/SplitKit.h') 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 UseBlocks; /// ThroughBlocks - Block numbers where CurLI is live through without uses. - SmallVector 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 getUseBlocks() { return UseBlocks; } - /// getThroughBlocks - Return an array of block numbers where CurLI is live - /// through without uses. - ArrayRef 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 BlockPtrSet; -- cgit v1.2.3