From 830487035e81914d0a68530da63d40c2e21dc096 Mon Sep 17 00:00:00 2001 From: David Greene Date: Thu, 22 May 2008 21:16:33 +0000 Subject: 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 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp') diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 2558b09ad60..4997302fa6a 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1150,7 +1150,9 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit, } 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. -- cgit v1.2.3