summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-02-10 01:31:31 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-02-10 01:31:31 +0000
commit9ef50bd66cbe18886958cfec560e4f4d680ad82a (patch)
treef3df25f652fb64865588098199f73b0549ffccb8 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent25c4195eccda674accd6f0a32736c82234ce705b (diff)
downloadbcm5719-llvm-9ef50bd66cbe18886958cfec560e4f4d680ad82a.tar.gz
bcm5719-llvm-9ef50bd66cbe18886958cfec560e4f4d680ad82a.zip
Constrain the regmask search space for local live ranges.
When checking a local live range for interference, restrict the binary search to the single block. llvm-svn: 150220
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 1b80c9ca849..b305fc2ab17 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1161,11 +1161,21 @@ bool LiveIntervals::checkRegMaskInterference(LiveInterval &LI,
BitVector &UsableRegs) {
if (LI.empty())
return false;
+ LiveInterval::iterator LiveI = LI.begin(), LiveE = LI.end();
+
+ // Use a smaller arrays for local live ranges.
+ ArrayRef<SlotIndex> Slots;
+ ArrayRef<const uint32_t*> Bits;
+ if (MachineBasicBlock *MBB = intervalIsInOneMBB(LI)) {
+ Slots = getRegMaskSlotsInBlock(MBB->getNumber());
+ Bits = getRegMaskBitsInBlock(MBB->getNumber());
+ } else {
+ Slots = getRegMaskSlots();
+ Bits = getRegMaskBits();
+ }
// We are going to enumerate all the register mask slots contained in LI.
// Start with a binary search of RegMaskSlots to find a starting point.
- LiveInterval::iterator LiveI = LI.begin(), LiveE = LI.end();
- ArrayRef<SlotIndex> Slots = getRegMaskSlots();
ArrayRef<SlotIndex>::iterator SlotI =
std::lower_bound(Slots.begin(), Slots.end(), LiveI->start);
ArrayRef<SlotIndex>::iterator SlotE = Slots.end();
@@ -1187,7 +1197,7 @@ bool LiveIntervals::checkRegMaskInterference(LiveInterval &LI,
Found = true;
}
// Remove usable registers clobbered by this mask.
- UsableRegs.clearBitsNotInMask(RegMaskBits[SlotI-Slots.begin()]);
+ UsableRegs.clearBitsNotInMask(Bits[SlotI-Slots.begin()]);
if (++SlotI == SlotE)
return Found;
}
OpenPOWER on IntegriCloud