diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-02-10 01:26:29 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-02-10 01:26:29 +0000 |
commit | 25c4195eccda674accd6f0a32736c82234ce705b (patch) | |
tree | c441a21b79b9450e77765db195bb9a8983975dd0 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | aa06de2447d73a6e6b4b30c1b61a2695a2e9669a (diff) | |
download | bcm5719-llvm-25c4195eccda674accd6f0a32736c82234ce705b.tar.gz bcm5719-llvm-25c4195eccda674accd6f0a32736c82234ce705b.zip |
Cache basic block boundaries for faster RegMaskSlots access.
Provide API to get a list of register mask slots and bits in a basic
block.
llvm-svn: 150219
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 7655cf5e930..1b80c9ca849 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -90,6 +90,7 @@ void LiveIntervals::releaseMemory() { r2iMap_.clear(); RegMaskSlots.clear(); RegMaskBits.clear(); + RegMaskBlocks.clear(); // Release VNInfo memory regions, VNInfo objects don't need to be dtor'd. VNInfoAllocator.Reset(); @@ -533,10 +534,14 @@ void LiveIntervals::computeIntervals() { << "********** Function: " << ((Value*)mf_->getFunction())->getName() << '\n'); + RegMaskBlocks.resize(mf_->getNumBlockIDs()); + SmallVector<unsigned, 8> UndefUses; for (MachineFunction::iterator MBBI = mf_->begin(), E = mf_->end(); MBBI != E; ++MBBI) { MachineBasicBlock *MBB = MBBI; + RegMaskBlocks[MBB->getNumber()].first = RegMaskSlots.size(); + if (MBB->empty()) continue; @@ -587,6 +592,10 @@ void LiveIntervals::computeIntervals() { // Move to the next instr slot. MIIndex = indexes_->getNextNonNullIndex(MIIndex); } + + // Compute the number of register mask instructions in this block. + std::pair<unsigned, unsigned> &RMB = RegMaskBlocks[MBB->getNumber()]; + RMB.second = RegMaskSlots.size() - RMB.first;; } // Create empty intervals for registers defined by implicit_def's (except |