mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
Avoid comparing invalid slot indexes, and assert that it doesn't happen.
The SlotIndex created by the default construction does not represent a position in the function, and it doesn't make sense to compare it to other indexes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126924 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -458,7 +458,7 @@ unsigned RALinScan::attemptTrivialCoalescing(LiveInterval &cur, unsigned Reg) {
|
||||
const LiveRange &range = cur.ranges.front();
|
||||
|
||||
VNInfo *vni = range.valno;
|
||||
if (vni->isUnused())
|
||||
if (vni->isUnused() || !vni->def.isValid())
|
||||
return Reg;
|
||||
|
||||
unsigned CandReg;
|
||||
@@ -993,7 +993,7 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur) {
|
||||
// one, e.g. X86::mov32to32_. These move instructions are not coalescable.
|
||||
if (!vrm_->getRegAllocPref(cur->reg) && cur->hasAtLeastOneValue()) {
|
||||
VNInfo *vni = cur->begin()->valno;
|
||||
if (!vni->isUnused()) {
|
||||
if (!vni->isUnused() && vni->def.isValid()) {
|
||||
MachineInstr *CopyMI = li_->getInstructionFromIndex(vni->def);
|
||||
if (CopyMI && CopyMI->isCopy()) {
|
||||
unsigned DstSubReg = CopyMI->getOperand(0).getSubReg();
|
||||
|
||||
Reference in New Issue
Block a user