Check the VN of the src register at the two copies, not just the

register number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134309 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2011-07-02 05:34:02 +00:00
parent 839656120b
commit a9badd250c

View File

@ -1203,7 +1203,6 @@ static bool RegistersDefinedFromSameValue(LiveIntervals &li,
VNInfo *VNI,
LiveRange *LR,
SmallVector<MachineInstr*, 8> &DupCopies) {
return false; // To see if this fixes the i386 dragonegg buildbot miscompile.
// FIXME: This is very conservative. For example, we don't handle
// physical registers.
@ -1252,6 +1251,12 @@ static bool RegistersDefinedFromSameValue(LiveIntervals &li,
if (Src != OtherSrc)
return false;
// If the copies use two different value numbers of X, we cannot merge
// A and B.
if (SrcInt.FindLiveRangeContaining(Other->def)->valno !=
SrcInt.FindLiveRangeContaining(VNI->def)->valno)
return false;
DupCopies.push_back(MI);
return true;