When rewriting defs and uses after spilling, don't set the weight of a

live interval to infinity if the instruction being rewritten is an
original remat def instruction.  We were only checking against the clone
of the remat def which doesn't actually appear in the IR at all.

llvm-svn: 51440
This commit is contained in:
David Greene 2008-05-22 21:16:33 +00:00
parent 54b52fe13b
commit 830487035e
1 changed files with 3 additions and 1 deletions

View File

@ -1150,7 +1150,9 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
} }
MachineBasicBlock *MBB = MI->getParent(); MachineBasicBlock *MBB = MI->getParent();
if (ImpUse && MI != ReMatDefMI) { // ReMatDefMI is a clone and not in the IR at all, so check
// RefMatOrigDefMI too.
if (ImpUse && MI != ReMatDefMI && MI != ReMatOrigDefMI) {
// Re-matting an instruction with virtual register use. Update the // Re-matting an instruction with virtual register use. Update the
// register interval's spill weight to HUGE_VALF to prevent it from // register interval's spill weight to HUGE_VALF to prevent it from
// being spilled. // being spilled.