1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Never propagate the idom value out of a block that defines its own value.

llvm-svn: 117669
This commit is contained in:
Jakob Stoklund Olesen 2010-10-29 17:37:25 +00:00
parent 6115a7f1d4
commit e577489ba5

View File

@ -441,7 +441,8 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
if (VNInfo *VNI = extendTo(Pred, Last)) { if (VNInfo *VNI = extendTo(Pred, Last)) {
MachineBasicBlock *DefMBB = lis_.getMBBFromIndex(VNI->def); MachineBasicBlock *DefMBB = lis_.getMBBFromIndex(VNI->def);
DEBUG(dbgs() << " found valno #" << VNI->id DEBUG(dbgs() << " found valno #" << VNI->id
<< " at BB#" << DefMBB->getNumber() << '\n'); << " from BB#" << DefMBB->getNumber()
<< " at BB#" << Pred->getNumber() << '\n');
LiveOutPair &LOP = LOIP.first->second; LiveOutPair &LOP = LOIP.first->second;
LOP.first = VNI; LOP.first = VNI;
LOP.second = mdt_[lis_.getMBBFromIndex(VNI->def)]; LOP.second = mdt_[lis_.getMBBFromIndex(VNI->def)];
@ -528,11 +529,14 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
I->second = LiveOutPair(VNI, Node); I->second = LiveOutPair(VNI, Node);
} }
} else if (IDomValue.first) { } else if (IDomValue.first) {
// No phi-def here. Propagate IDomValue if needed. // No phi-def here. Remember incoming value for IdxMBB.
if (MBB == IdxMBB) if (MBB == IdxMBB)
IdxVNI = IDomValue.first; IdxVNI = IDomValue.first;
// Propagate IDomValue if needed:
// MBB is live-out and doesn't define its own value.
LiveOutMap::iterator I = liveOutCache_.find(MBB); LiveOutMap::iterator I = liveOutCache_.find(MBB);
if (I != liveOutCache_.end() && I->second.first != IDomValue.first) { if (I != liveOutCache_.end() && I->second.second != Node &&
I->second.first != IDomValue.first) {
++Changes; ++Changes;
I->second = IDomValue; I->second = IDomValue;
DEBUG(dbgs() << " - BB#" << MBB->getNumber() DEBUG(dbgs() << " - BB#" << MBB->getNumber()