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 | 642767a8f648c45c9dabaea089bdf48783ad4806 (patch) | |
tree | 0fb6f8f328b9c8427978c85052fe9062aa656d54 | |
parent | 01320da35e8a0a327ede52cc1d4598b0a317f00b (diff) | |
download | external_llvm-642767a8f648c45c9dabaea089bdf48783ad4806.zip external_llvm-642767a8f648c45c9dabaea089bdf48783ad4806.tar.gz external_llvm-642767a8f648c45c9dabaea089bdf48783ad4806.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106021 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 16d929b..6f3fc99 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/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; } |