mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-27 02:44:08 +00:00
Fix a couple of loops that were processing unused value numbers.
Unused VNInfos should be left alone. Their def SlotIndex doesn't point to anything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161257 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a5b51f5694
commit
1599a64277
@ -652,7 +652,7 @@ void SplitEditor::removeBackCopies(SmallVectorImpl<VNInfo*> &Copies) {
|
||||
// Adjust RegAssign if a register assignment is killed at VNI->def. We
|
||||
// want to avoid calculating the live range of the source register if
|
||||
// possible.
|
||||
AssignI.find(VNI->def.getPrevSlot());
|
||||
AssignI.find(Def.getPrevSlot());
|
||||
if (!AssignI.valid() || AssignI.start() >= Def)
|
||||
continue;
|
||||
// If MI doesn't kill the assigned register, just leave it.
|
||||
@ -739,6 +739,8 @@ void SplitEditor::hoistCopiesForSize() {
|
||||
for (LiveInterval::vni_iterator VI = LI->vni_begin(), VE = LI->vni_end();
|
||||
VI != VE; ++VI) {
|
||||
VNInfo *VNI = *VI;
|
||||
if (VNI->isUnused())
|
||||
continue;
|
||||
VNInfo *ParentVNI = Edit->getParent().getVNInfoAt(VNI->def);
|
||||
assert(ParentVNI && "Parent not live at complement def");
|
||||
|
||||
@ -812,6 +814,8 @@ void SplitEditor::hoistCopiesForSize() {
|
||||
for (LiveInterval::vni_iterator VI = LI->vni_begin(), VE = LI->vni_end();
|
||||
VI != VE; ++VI) {
|
||||
VNInfo *VNI = *VI;
|
||||
if (VNI->isUnused())
|
||||
continue;
|
||||
VNInfo *ParentVNI = Edit->getParent().getVNInfoAt(VNI->def);
|
||||
const DomPair &Dom = NearestDom[ParentVNI->id];
|
||||
if (!Dom.first || Dom.second == VNI->def)
|
||||
|
Loading…
x
Reference in New Issue
Block a user