summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp4
1 files changed, 3 insertions, 1 deletions
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.
OpenPOWER on IntegriCloud