diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-06-15 18:49:14 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-06-15 18:49:14 +0000 |
commit | 6e54c908e077906a4cb5d6b7862ab15e94ec25bc (patch) | |
tree | c497b754b6e6f6a2473f4b44f6242e970e633d80 /llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | 8651121c11e4b047924bafab305b7bec4395941b (diff) | |
download | bcm5719-llvm-6e54c908e077906a4cb5d6b7862ab15e94ec25bc.tar.gz bcm5719-llvm-6e54c908e077906a4cb5d6b7862ab15e94ec25bc.zip |
Fix an exotic bug that only showed up in an internal test case.
SimpleRegisterCoalescing::JoinIntervals() uses CoalescerPair to determine if a
copy is coalescable, and in very rare cases it can return true where LHS is not
live - the coalescable copy can come from an alias of the physreg in LHS.
llvm-svn: 106021
Diffstat (limited to 'llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index 16d929bbfa3..6f3fc99a0ca 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -2310,7 +2310,8 @@ SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS, // Figure out the value # from the RHS. LiveRange *lr = RHS.getLiveRangeContaining(VNI->def.getPrevSlot()); - assert(lr && "Cannot find live range"); + // The copy could be to an aliased physreg. + if (!lr) continue; LHSValsDefinedFromRHS[VNI] = lr->valno; } @@ -2329,7 +2330,8 @@ SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS, // Figure out the value # from the LHS. LiveRange *lr = LHS.getLiveRangeContaining(VNI->def.getPrevSlot()); - assert(lr && "Cannot find live range"); + // The copy could be to an aliased physreg. + if (!lr) continue; RHSValsDefinedFromLHS[VNI] = lr->valno; } |