diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-02-06 21:52:18 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-02-06 21:52:18 +0000 |
commit | c805369fdc3d8769997a9ce002fe149034d13a1b (patch) | |
tree | ab9ddeab15779c801c6a592cd1a494b406bc79b8 | |
parent | e716741f8be556855b1831ed897ae0f4007bd509 (diff) | |
download | bcm5719-llvm-c805369fdc3d8769997a9ce002fe149034d13a1b.tar.gz bcm5719-llvm-c805369fdc3d8769997a9ce002fe149034d13a1b.zip |
Make sure a reserved register has a live interval before merging.
llvm-svn: 149910
-rw-r--r-- | llvm/lib/CodeGen/RegisterCoalescer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index cc9ec3ce142..c7be0b31e0a 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp @@ -1414,8 +1414,12 @@ bool RegisterCoalescer::JoinIntervals(CoalescerPair &CP) { // Deny any overlapping intervals. This depends on all the reserved // register live ranges to look like dead defs. for (const unsigned *AS = TRI->getOverlaps(CP.getDstReg()); *AS; ++AS) { - if (!LIS->hasInterval(*AS)) + if (!LIS->hasInterval(*AS)) { + // Make sure at least DstReg itself exists before attempting a join. + if (*AS == CP.getDstReg()) + LIS->getOrCreateInterval(CP.getDstReg()); continue; + } if (RHS.overlaps(LIS->getInterval(*AS))) { DEBUG(dbgs() << "\t\tInterference: " << PrintReg(*AS, TRI) << '\n'); return false; |