X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FLivePhysRegs.cpp;h=eef7643367fb672af63538cec3a6759f7659cc03;hb=9758b4ae957d85e4b1e7fff1592f276ae684ee98;hp=b6369275051faed35ccb43b0349bfa62615ff1e3;hpb=46356f6f6fb1b67c4f585139527a998a65289ce9;p=oota-llvm.git diff --git a/lib/CodeGen/LivePhysRegs.cpp b/lib/CodeGen/LivePhysRegs.cpp index b6369275051..eef7643367f 100644 --- a/lib/CodeGen/LivePhysRegs.cpp +++ b/lib/CodeGen/LivePhysRegs.cpp @@ -77,8 +77,9 @@ void LivePhysRegs::stepForward(const MachineInstr &MI, if (Reg == 0) continue; if (O->isDef()) { - if (!O->isDead()) - Clobbers.push_back(std::make_pair(Reg, &*O)); + // Note, dead defs are still recorded. The caller should decide how to + // handle them. + Clobbers.push_back(std::make_pair(Reg, &*O)); } else { if (!O->isKill()) continue; @@ -90,8 +91,12 @@ void LivePhysRegs::stepForward(const MachineInstr &MI, } // Add defs to the set. - for (auto Reg : Clobbers) + for (auto Reg : Clobbers) { + // Skip dead defs. They shouldn't be added to the set. + if (Reg.second->isReg() && Reg.second->isDead()) + continue; addReg(Reg.first); + } } /// Prin the currently live registers to OS.