summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commitfdc09941f25d894e7bb6525e55134b1a83f1c206 (patch)
tree18d00696bacc2b68632bbd35b8c6bb07a8130dee /llvm/lib
parentc099dde91856135f1af65dc46b0c938acfe734d5 (diff)
downloadbcm5719-llvm-fdc09941f25d894e7bb6525e55134b1a83f1c206.tar.gz
bcm5719-llvm-fdc09941f25d894e7bb6525e55134b1a83f1c206.zip
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. llvm-svn: 127857
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index c47c8397488..d1de6a85398 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud