diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-05-16 23:50:05 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-05-16 23:50:05 +0000 |
| commit | 4edf17d91fffd965cddcfbdebd2f7ff174b22425 (patch) | |
| tree | e6e7803cf7f6b96abb32c2e5d79e70f33c18b852 /llvm/include | |
| parent | c249c411c26d0f70385231555d41a4388377d040 (diff) | |
| download | bcm5719-llvm-4edf17d91fffd965cddcfbdebd2f7ff174b22425.tar.gz bcm5719-llvm-4edf17d91fffd965cddcfbdebd2f7ff174b22425.zip | |
Teach LiveInterval::isZeroLength about null SlotIndexes.
When instructions are deleted, they leave tombstone SlotIndex entries.
The isZeroLength method should ignore these null indexes.
This causes RABasic to sometimes spill a callee-saved register in the
abi-isel.ll test, so don't run that test with -regalloc=basic. Prioritizing
register allocation according to spill weight can cause more registers to be
used.
llvm-svn: 131436
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/CodeGen/LiveInterval.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/include/llvm/CodeGen/LiveInterval.h b/llvm/include/llvm/CodeGen/LiveInterval.h index c5285cec1e2..5fd4d3df266 100644 --- a/llvm/include/llvm/CodeGen/LiveInterval.h +++ b/llvm/include/llvm/CodeGen/LiveInterval.h @@ -492,9 +492,10 @@ namespace llvm { /// Returns true if the live interval is zero length, i.e. no live ranges /// span instructions. It doesn't pay to spill such an interval. - bool isZeroLength() const { + bool isZeroLength(SlotIndexes *Indexes) const { for (const_iterator i = begin(), e = end(); i != e; ++i) - if (i->end.getPrevIndex() > i->start) + if (Indexes->getNextNonNullIndex(i->start).getBaseIndex() < + i->end.getBaseIndex()) return false; return true; } |

