aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-12-18 20:30:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2024-04-19 21:12:03 +0000
commitc9157d925c489f07ba9c0b2ce47e5149b75969a5 (patch)
tree08bc4a3d9cad3f9ebffa558ddf140b9d9257b219 /contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp
parent2a66844f606a35d68ad8a8061f4bea204274b3bc (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp b/contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp
index 1cf354349c56..c81540602f59 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp
@@ -563,13 +563,15 @@ VNInfo *LiveRange::extendInBlock(SlotIndex StartIdx, SlotIndex Kill) {
return CalcLiveRangeUtilVector(this).extendInBlock(StartIdx, Kill);
}
-/// Remove the specified segment from this range. Note that the segment must
-/// be in a single Segment in its entirety.
void LiveRange::removeSegment(SlotIndex Start, SlotIndex End,
bool RemoveDeadValNo) {
// Find the Segment containing this span.
iterator I = find(Start);
- assert(I != end() && "Segment is not in range!");
+
+ // No Segment found, so nothing to do.
+ if (I == end())
+ return;
+
assert(I->containsInterval(Start, End)
&& "Segment is not entirely in range!");
@@ -629,6 +631,7 @@ void LiveRange::join(LiveRange &Other,
const int *RHSValNoAssignments,
SmallVectorImpl<VNInfo *> &NewVNInfo) {
verify();
+ Other.verify();
// Determine if any of our values are mapped. This is uncommon, so we want
// to avoid the range scan if not.