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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51440
91177308-0d34-0410-b5e6-
96231b3b80d8
}
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
// register interval's spill weight to HUGE_VALF to prevent it from
// being spilled.