mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-14 09:38:40 +00:00
Make sure a reserved register has a live interval before merging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149910 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8833ef03b9
commit
602cb9d9f2
@ -1414,8 +1414,12 @@ bool RegisterCoalescer::JoinIntervals(CoalescerPair &CP) {
|
|||||||
// Deny any overlapping intervals. This depends on all the reserved
|
// Deny any overlapping intervals. This depends on all the reserved
|
||||||
// register live ranges to look like dead defs.
|
// register live ranges to look like dead defs.
|
||||||
for (const unsigned *AS = TRI->getOverlaps(CP.getDstReg()); *AS; ++AS) {
|
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;
|
continue;
|
||||||
|
}
|
||||||
if (RHS.overlaps(LIS->getInterval(*AS))) {
|
if (RHS.overlaps(LIS->getInterval(*AS))) {
|
||||||
DEBUG(dbgs() << "\t\tInterference: " << PrintReg(*AS, TRI) << '\n');
|
DEBUG(dbgs() << "\t\tInterference: " << PrintReg(*AS, TRI) << '\n');
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user