mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Remove dead code.
Clobber ranges are no longer used when joining physical registers. Instead, all aliases are checked for interference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113084 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
061d21eaf8
commit
07c2b7ff68
@ -358,21 +358,6 @@ namespace llvm {
|
|||||||
/// cause merging of V1/V2 values numbers and compaction of the value space.
|
/// cause merging of V1/V2 values numbers and compaction of the value space.
|
||||||
VNInfo* MergeValueNumberInto(VNInfo *V1, VNInfo *V2);
|
VNInfo* MergeValueNumberInto(VNInfo *V1, VNInfo *V2);
|
||||||
|
|
||||||
/// MergeInClobberRanges - For any live ranges that are not defined in the
|
|
||||||
/// current interval, but are defined in the Clobbers interval, mark them
|
|
||||||
/// used with an unknown definition value. Caller must pass in reference to
|
|
||||||
/// VNInfoAllocator since it will create a new val#.
|
|
||||||
void MergeInClobberRanges(LiveIntervals &li_,
|
|
||||||
const LiveInterval &Clobbers,
|
|
||||||
VNInfo::Allocator &VNInfoAllocator);
|
|
||||||
|
|
||||||
/// MergeInClobberRange - Same as MergeInClobberRanges except it merge in a
|
|
||||||
/// single LiveRange only.
|
|
||||||
void MergeInClobberRange(LiveIntervals &li_,
|
|
||||||
SlotIndex Start,
|
|
||||||
SlotIndex End,
|
|
||||||
VNInfo::Allocator &VNInfoAllocator);
|
|
||||||
|
|
||||||
/// MergeValueInAsValue - Merge all of the live ranges of a specific val#
|
/// MergeValueInAsValue - Merge all of the live ranges of a specific val#
|
||||||
/// in RHS into this live interval as the specified value number.
|
/// in RHS into this live interval as the specified value number.
|
||||||
/// The LiveRanges in RHS are allowed to overlap with LiveRanges in the
|
/// The LiveRanges in RHS are allowed to overlap with LiveRanges in the
|
||||||
|
@ -616,103 +616,6 @@ void LiveInterval::MergeValueInAsValue(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// MergeInClobberRanges - For any live ranges that are not defined in the
|
|
||||||
/// current interval, but are defined in the Clobbers interval, mark them
|
|
||||||
/// used with an unknown definition value.
|
|
||||||
void LiveInterval::MergeInClobberRanges(LiveIntervals &li_,
|
|
||||||
const LiveInterval &Clobbers,
|
|
||||||
VNInfo::Allocator &VNInfoAllocator) {
|
|
||||||
if (Clobbers.empty()) return;
|
|
||||||
|
|
||||||
DenseMap<VNInfo*, VNInfo*> ValNoMaps;
|
|
||||||
VNInfo *UnusedValNo = 0;
|
|
||||||
iterator IP = begin();
|
|
||||||
for (const_iterator I = Clobbers.begin(), E = Clobbers.end(); I != E; ++I) {
|
|
||||||
// For every val# in the Clobbers interval, create a new "unknown" val#.
|
|
||||||
VNInfo *ClobberValNo = 0;
|
|
||||||
DenseMap<VNInfo*, VNInfo*>::iterator VI = ValNoMaps.find(I->valno);
|
|
||||||
if (VI != ValNoMaps.end())
|
|
||||||
ClobberValNo = VI->second;
|
|
||||||
else if (UnusedValNo)
|
|
||||||
ClobberValNo = UnusedValNo;
|
|
||||||
else {
|
|
||||||
UnusedValNo = ClobberValNo =
|
|
||||||
getNextValue(li_.getInvalidIndex(), 0, false, VNInfoAllocator);
|
|
||||||
ValNoMaps.insert(std::make_pair(I->valno, ClobberValNo));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Done = false;
|
|
||||||
SlotIndex Start = I->start, End = I->end;
|
|
||||||
// If a clobber range starts before an existing range and ends after
|
|
||||||
// it, the clobber range will need to be split into multiple ranges.
|
|
||||||
// Loop until the entire clobber range is handled.
|
|
||||||
while (!Done) {
|
|
||||||
Done = true;
|
|
||||||
IP = std::upper_bound(IP, end(), Start);
|
|
||||||
SlotIndex SubRangeStart = Start;
|
|
||||||
SlotIndex SubRangeEnd = End;
|
|
||||||
|
|
||||||
// If the start of this range overlaps with an existing liverange, trim it.
|
|
||||||
if (IP != begin() && IP[-1].end > SubRangeStart) {
|
|
||||||
SubRangeStart = IP[-1].end;
|
|
||||||
// Trimmed away the whole range?
|
|
||||||
if (SubRangeStart >= SubRangeEnd) continue;
|
|
||||||
}
|
|
||||||
// If the end of this range overlaps with an existing liverange, trim it.
|
|
||||||
if (IP != end() && SubRangeEnd > IP->start) {
|
|
||||||
// If the clobber live range extends beyond the existing live range,
|
|
||||||
// it'll need at least another live range, so set the flag to keep
|
|
||||||
// iterating.
|
|
||||||
if (SubRangeEnd > IP->end) {
|
|
||||||
Start = IP->end;
|
|
||||||
Done = false;
|
|
||||||
}
|
|
||||||
SubRangeEnd = IP->start;
|
|
||||||
// If this trimmed away the whole range, ignore it.
|
|
||||||
if (SubRangeStart == SubRangeEnd) continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Insert the clobber interval.
|
|
||||||
IP = addRangeFrom(LiveRange(SubRangeStart, SubRangeEnd, ClobberValNo),
|
|
||||||
IP);
|
|
||||||
UnusedValNo = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (UnusedValNo) {
|
|
||||||
// Delete the last unused val#.
|
|
||||||
valnos.pop_back();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LiveInterval::MergeInClobberRange(LiveIntervals &li_,
|
|
||||||
SlotIndex Start,
|
|
||||||
SlotIndex End,
|
|
||||||
VNInfo::Allocator &VNInfoAllocator) {
|
|
||||||
// Find a value # to use for the clobber ranges. If there is already a value#
|
|
||||||
// for unknown values, use it.
|
|
||||||
VNInfo *ClobberValNo =
|
|
||||||
getNextValue(li_.getInvalidIndex(), 0, false, VNInfoAllocator);
|
|
||||||
|
|
||||||
iterator IP = begin();
|
|
||||||
IP = std::upper_bound(IP, end(), Start);
|
|
||||||
|
|
||||||
// If the start of this range overlaps with an existing liverange, trim it.
|
|
||||||
if (IP != begin() && IP[-1].end > Start) {
|
|
||||||
Start = IP[-1].end;
|
|
||||||
// Trimmed away the whole range?
|
|
||||||
if (Start >= End) return;
|
|
||||||
}
|
|
||||||
// If the end of this range overlaps with an existing liverange, trim it.
|
|
||||||
if (IP != end() && End > IP->start) {
|
|
||||||
End = IP->start;
|
|
||||||
// If this trimmed away the whole range, ignore it.
|
|
||||||
if (Start == End) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Insert the clobber interval.
|
|
||||||
addRangeFrom(LiveRange(Start, End, ClobberValNo), IP);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// MergeValueNumberInto - This method is called when two value nubmers
|
/// MergeValueNumberInto - This method is called when two value nubmers
|
||||||
/// are found to be equivalent. This eliminates V1, replacing all
|
/// are found to be equivalent. This eliminates V1, replacing all
|
||||||
|
Loading…
Reference in New Issue
Block a user