mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-06 14:57:41 +00:00
LiveInterval: Add removeEmptySubRanges().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223887 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6e616d2e97
commit
f2f0589b02
@ -669,6 +669,10 @@ namespace llvm {
|
|||||||
SubRanges = nullptr;
|
SubRanges = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Removes all subranges without any segments (subranges without segments
|
||||||
|
/// are not considered valid and should only exist temporarily).
|
||||||
|
void removeEmptySubRanges();
|
||||||
|
|
||||||
/// getSize - Returns the sum of sizes of all the LiveRange's.
|
/// getSize - Returns the sum of sizes of all the LiveRange's.
|
||||||
///
|
///
|
||||||
unsigned getSize() const;
|
unsigned getSize() const;
|
||||||
|
@ -592,6 +592,23 @@ VNInfo *LiveRange::MergeValueNumberInto(VNInfo *V1, VNInfo *V2) {
|
|||||||
return V2;
|
return V2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LiveInterval::removeEmptySubRanges() {
|
||||||
|
SubRange **NextPtr = &SubRanges;
|
||||||
|
SubRange *I = *NextPtr;
|
||||||
|
while (I != nullptr) {
|
||||||
|
if (!I->empty()) {
|
||||||
|
NextPtr = &I->Next;
|
||||||
|
I = *NextPtr;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Skip empty subranges until we find the first nonempty one.
|
||||||
|
do {
|
||||||
|
I = I->Next;
|
||||||
|
} while (I != nullptr && I->empty());
|
||||||
|
*NextPtr = I;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unsigned LiveInterval::getSize() const {
|
unsigned LiveInterval::getSize() const {
|
||||||
unsigned Sum = 0;
|
unsigned Sum = 0;
|
||||||
for (const_iterator I = begin(), E = end(); I != E; ++I)
|
for (const_iterator I = begin(), E = end(); I != E; ++I)
|
||||||
|
Loading…
Reference in New Issue
Block a user