diff --git a/llvm/lib/CodeGen/LivePhysRegs.cpp b/llvm/lib/CodeGen/LivePhysRegs.cpp --- a/llvm/lib/CodeGen/LivePhysRegs.cpp +++ b/llvm/lib/CodeGen/LivePhysRegs.cpp @@ -88,6 +88,8 @@ if (!Reg.isPhysical()) continue; if (O->isDef()) { + if (O->isDead()) + removeReg(Reg); // Note, dead defs are still recorded. The caller should decide how to // handle them. Clobbers.push_back(std::make_pair(Reg, &*O));