summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-10-29 17:37:25 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-10-29 17:37:25 +0000
commitc94fcb1507db5c043558f3f58d389e774bc2f71d (patch)
tree0d24e6f5583f968ff8c1bd83b521b3a6cd06712a /lib
parent44ab89eb376af838d1123293a79975aede501464 (diff)
downloadllvm-c94fcb1507db5c043558f3f58d389e774bc2f71d.tar.gz
llvm-c94fcb1507db5c043558f3f58d389e774bc2f71d.tar.bz2
llvm-c94fcb1507db5c043558f3f58d389e774bc2f71d.tar.xz
Never propagate the idom value out of a block that defines its own value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SplitKit.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp
index 70352fc178..b5012f313b 100644
--- a/lib/CodeGen/SplitKit.cpp
+++ b/lib/CodeGen/SplitKit.cpp
@@ -441,7 +441,8 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
if (VNInfo *VNI = extendTo(Pred, Last)) {
MachineBasicBlock *DefMBB = lis_.getMBBFromIndex(VNI->def);
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;
LOP.first = VNI;
LOP.second = mdt_[lis_.getMBBFromIndex(VNI->def)];
@@ -528,11 +529,14 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
I->second = LiveOutPair(VNI, Node);
}
} else if (IDomValue.first) {
- // No phi-def here. Propagate IDomValue if needed.
+ // No phi-def here. Remember incoming value for IdxMBB.
if (MBB == IdxMBB)
IdxVNI = IDomValue.first;
+ // Propagate IDomValue if needed:
+ // MBB is live-out and doesn't define its own value.
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;
I->second = IDomValue;
DEBUG(dbgs() << " - BB#" << MBB->getNumber()