mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 07:17:36 +00:00
Drop <def,dead> flags when merging into an unused lane.
The new coalescer can merge a dead def into an unused lane of an otherwise live vector register. Clear the <dead> flag when that happens since the flag refers to the full virtual register which is still live after the partial dead def. This fixes PR14079. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165877 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1739,15 +1739,20 @@ void JoinVals::pruneValues(JoinVals &Other,
|
||||
// has been replaced.
|
||||
Val &OtherV = Other.Vals[Vals[i].OtherVNI->id];
|
||||
bool EraseImpDef = OtherV.IsImplicitDef && OtherV.Resolution == CR_Keep;
|
||||
if (!EraseImpDef && !Def.isBlock()) {
|
||||
if (!Def.isBlock()) {
|
||||
// Remove <def,read-undef> flags. This def is now a partial redef.
|
||||
// Also remove <def,dead> flags since the joined live range will
|
||||
// continue past this instruction.
|
||||
for (MIOperands MO(Indexes->getInstructionFromIndex(Def));
|
||||
MO.isValid(); ++MO)
|
||||
if (MO->isReg() && MO->isDef() && MO->getReg() == LI.reg)
|
||||
MO->setIsUndef(false);
|
||||
if (MO->isReg() && MO->isDef() && MO->getReg() == LI.reg) {
|
||||
MO->setIsUndef(EraseImpDef);
|
||||
MO->setIsDead(false);
|
||||
}
|
||||
// This value will reach instructions below, but we need to make sure
|
||||
// the live range also reaches the instruction at Def.
|
||||
EndPoints.push_back(Def);
|
||||
if (!EraseImpDef)
|
||||
EndPoints.push_back(Def);
|
||||
}
|
||||
DEBUG(dbgs() << "\t\tpruned " << PrintReg(Other.LI.reg) << " at " << Def
|
||||
<< ": " << Other.LI << '\n');
|
||||
|
||||
Reference in New Issue
Block a user