summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-18 03:06:04 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-18 03:06:04 +0000
commit9ef931e71c06a0390d6387859843be1d6d4daad6 (patch)
treea569cee7f983411f890b6cd40e1e4450a79ca62d /lib/CodeGen/LiveIntervalAnalysis.cpp
parent7cec179a647bff132d7af36d91df877056880c5e (diff)
downloadllvm-9ef931e71c06a0390d6387859843be1d6d4daad6.tar.gz
llvm-9ef931e71c06a0390d6387859843be1d6d4daad6.tar.bz2
llvm-9ef931e71c06a0390d6387859843be1d6d4daad6.tar.xz
Accept instructions that read undefined values.
This is not supposed to happen, but I have seen the x86 rematter getting confused when rematerializing partial redefs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127857 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index c47c839748..d1de6a8539 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -761,7 +761,15 @@ bool LiveIntervals::shrinkToUses(LiveInterval *li,
continue;
SlotIndex Idx = getInstructionIndex(UseMI).getUseIndex();
VNInfo *VNI = li->getVNInfoAt(Idx);
- assert(VNI && "Live interval not live into reading instruction");
+ if (!VNI) {
+ // This shouldn't happen: readsVirtualRegister returns true, but there is
+ // no live value. It is likely caused by a target getting <undef> flags
+ // wrong.
+ DEBUG(dbgs() << Idx << '\t' << *UseMI
+ << "Warning: Instr claims to read non-existent value in "
+ << *li << '\n');
+ continue;
+ }
if (VNI->def == Idx) {
// Special case: An early-clobber tied operand reads and writes the
// register one slot early.