diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index 0450c355dce9..c34b628d5fe5 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/lib/CodeGen/LiveInterval.cpp @@ -629,6 +629,12 @@ void LiveInterval::MergeInClobberRanges(const LiveInterval &Clobbers, UnusedValNo = 0; } } + + if (UnusedValNo) { + // Delete the last unused val#. + valnos.pop_back(); + UnusedValNo->~VNInfo(); + } } void LiveInterval::MergeInClobberRange(unsigned Start, unsigned End,