mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Implement LiveRangeCalc::extendToUses() and createDeadDefs().
These LiveRangeCalc methods are to be used when computing a live range from scratch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -48,6 +48,26 @@ LiveInterval::iterator LiveInterval::find(SlotIndex Pos) {
|
||||
return I;
|
||||
}
|
||||
|
||||
VNInfo *LiveInterval::createDeadDef(SlotIndex Def,
|
||||
VNInfo::Allocator &VNInfoAllocator) {
|
||||
assert(!Def.isDead() && "Cannot define a value at the dead slot");
|
||||
iterator I = find(Def);
|
||||
if (I == end()) {
|
||||
VNInfo *VNI = getNextValue(Def, VNInfoAllocator);
|
||||
ranges.push_back(LiveRange(Def, Def.getDeadSlot(), VNI));
|
||||
return VNI;
|
||||
}
|
||||
if (SlotIndex::isSameInstr(Def, I->start)) {
|
||||
assert(I->start == Def && "Cannot insert def, already live");
|
||||
assert(I->valno->def == Def && "Inconsistent existing value def");
|
||||
return I->valno;
|
||||
}
|
||||
assert(SlotIndex::isEarlierInstr(Def, I->start) && "Already live at def");
|
||||
VNInfo *VNI = getNextValue(Def, VNInfoAllocator);
|
||||
ranges.insert(I, LiveRange(Def, Def.getDeadSlot(), VNI));
|
||||
return VNI;
|
||||
}
|
||||
|
||||
/// killedInRange - Return true if the interval has kills in [Start,End).
|
||||
bool LiveInterval::killedInRange(SlotIndex Start, SlotIndex End) const {
|
||||
Ranges::const_iterator r =
|
||||
|
||||
Reference in New Issue
Block a user