mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-26 09:18:56 +00:00
Cache basic block boundaries for faster RegMaskSlots access.
Provide API to get a list of register mask slots and bits in a basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150219 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user