diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-07-02 05:34:02 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-07-02 05:34:02 +0000 |
| commit | 36e11ff81935beb783b93e6c556dffd181c83a26 (patch) | |
| tree | 7b7f5a7e5e2dcb23788cd396d541213bd4ff4710 /llvm/lib/CodeGen/RegisterCoalescer.cpp | |
| parent | 2eca9d5ddfa02298301e77bd578de0d69c8445f3 (diff) | |
| download | bcm5719-llvm-36e11ff81935beb783b93e6c556dffd181c83a26.tar.gz bcm5719-llvm-36e11ff81935beb783b93e6c556dffd181c83a26.zip | |
Check the VN of the src register at the two copies, not just the
register number.
llvm-svn: 134309
Diffstat (limited to 'llvm/lib/CodeGen/RegisterCoalescer.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegisterCoalescer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index d5025b9e636..13ae04283a9 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp @@ -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; |

