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;
}
// 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.