diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-10-13 17:26:47 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-10-13 17:26:47 +0000 |
commit | ea82bd7f0db946898fa5b6dcb9d110fc837eabbb (patch) | |
tree | 6ad7f56a0309b08e75e30871db55b2468870d118 /llvm/lib/CodeGen | |
parent | 958513ab7709dbff256d374a62d0985978325625 (diff) | |
download | bcm5719-llvm-ea82bd7f0db946898fa5b6dcb9d110fc837eabbb.tar.gz bcm5719-llvm-ea82bd7f0db946898fa5b6dcb9d110fc837eabbb.zip |
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.
llvm-svn: 165877
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/RegisterCoalescer.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index 19e9310d221..ad515c10643 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp @@ -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'); |